From 507a804cd9a9dd549b1ab7947c49b60891cb60a2 Mon Sep 17 00:00:00 2001 From: cloud-java-bot Date: Wed, 21 Aug 2024 13:45:32 +0000 Subject: [PATCH 1/2] feat: [apihub] new module for apihub --- generation_config.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/generation_config.yaml b/generation_config.yaml index 1c89f1030f34..12147d72bf05 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -158,6 +158,24 @@ libraries: GAPICs: - proto_path: google/cloud/apigeeregistry/v1 +- api_shortname: apihub + name_pretty: API hub API + product_documentation: https://cloud.google.com/apigee/docs/apihub/what-is-api-hub + api_description: API hub lets you consolidate and organize information about all + of the APIs of interest to your organization. API hub lets you capture critical + information about APIs that allows developers to discover and evaluate them + easily and leverage the work of other teams wherever possible. API platform + teams can use API hub to have visibility into and manage their portfolio of APIs. + client_documentation: https://cloud.google.com/java/docs/reference/google-cloud-apihub/latest/overview + release_level: preview + distribution_name: com.google.cloud:google-cloud-apihub + api_id: apihub.googleapis.com + library_type: GAPIC_AUTO + group_id: com.google.cloud + cloud_api: true + GAPICs: + - proto_path: google/cloud/apihub/v1 + requires_billing: true - api_shortname: apikeys name_pretty: API Keys API product_documentation: https://cloud.google.com/api-keys/ From 64c9cbd62b510867827643f4083ce9554295e629 Mon Sep 17 00:00:00 2001 From: cloud-java-bot Date: Wed, 21 Aug 2024 14:02:59 +0000 Subject: [PATCH 2/2] chore: generate libraries at Wed Aug 21 14:00:49 UTC 2024 --- gapic-libraries-bom/pom.xml | 7 + java-apihub/.OwlBot-hermetic.yaml | 35 + java-apihub/.repo-metadata.json | 16 + java-apihub/README.md | 225 + java-apihub/google-cloud-apihub-bom/pom.xml | 43 + java-apihub/google-cloud-apihub/pom.xml | 113 + .../google/cloud/apihub/v1/ApiHubClient.java | 6637 +++++++++++++++++ .../apihub/v1/ApiHubDependenciesClient.java | 1308 ++++ .../apihub/v1/ApiHubDependenciesSettings.java | 281 + .../cloud/apihub/v1/ApiHubPluginClient.java | 847 +++ .../cloud/apihub/v1/ApiHubPluginSettings.java | 251 + .../cloud/apihub/v1/ApiHubSettings.java | 612 ++ .../HostProjectRegistrationServiceClient.java | 1132 +++ ...ostProjectRegistrationServiceSettings.java | 271 + .../cloud/apihub/v1/LintingServiceClient.java | 911 +++ .../apihub/v1/LintingServiceSettings.java | 266 + .../cloud/apihub/v1/ProvisioningClient.java | 968 +++ .../cloud/apihub/v1/ProvisioningSettings.java | 270 + ...RuntimeProjectAttachmentServiceClient.java | 1432 ++++ ...ntimeProjectAttachmentServiceSettings.java | 302 + .../cloud/apihub/v1/gapic_metadata.json | 288 + .../google/cloud/apihub/v1/package-info.java | 171 + .../v1/stub/ApiHubDependenciesStub.java | 88 + .../stub/ApiHubDependenciesStubSettings.java | 629 ++ .../apihub/v1/stub/ApiHubPluginStub.java | 69 + .../v1/stub/ApiHubPluginStubSettings.java | 507 ++ .../cloud/apihub/v1/stub/ApiHubStub.java | 293 + .../apihub/v1/stub/ApiHubStubSettings.java | 1786 +++++ .../v1/stub/GrpcApiHubCallableFactory.java | 113 + ...GrpcApiHubDependenciesCallableFactory.java | 113 + .../v1/stub/GrpcApiHubDependenciesStub.java | 374 + .../stub/GrpcApiHubPluginCallableFactory.java | 113 + .../apihub/v1/stub/GrpcApiHubPluginStub.java | 290 + .../cloud/apihub/v1/stub/GrpcApiHubStub.java | 1363 ++++ ...ectRegistrationServiceCallableFactory.java | 113 + ...rpcHostProjectRegistrationServiceStub.java | 347 + .../GrpcLintingServiceCallableFactory.java | 113 + .../v1/stub/GrpcLintingServiceStub.java | 332 + .../stub/GrpcProvisioningCallableFactory.java | 113 + .../apihub/v1/stub/GrpcProvisioningStub.java | 322 + ...ojectAttachmentServiceCallableFactory.java | 113 + ...pcRuntimeProjectAttachmentServiceStub.java | 432 ++ .../HostProjectRegistrationServiceStub.java | 84 + ...rojectRegistrationServiceStubSettings.java | 628 ++ .../stub/HttpJsonApiHubCallableFactory.java | 101 + ...JsonApiHubDependenciesCallableFactory.java | 101 + .../stub/HttpJsonApiHubDependenciesStub.java | 581 ++ .../HttpJsonApiHubPluginCallableFactory.java | 101 + .../v1/stub/HttpJsonApiHubPluginStub.java | 442 ++ .../apihub/v1/stub/HttpJsonApiHubStub.java | 2421 ++++++ ...ectRegistrationServiceCallableFactory.java | 101 + ...sonHostProjectRegistrationServiceStub.java | 501 ++ ...HttpJsonLintingServiceCallableFactory.java | 101 + .../v1/stub/HttpJsonLintingServiceStub.java | 508 ++ .../HttpJsonProvisioningCallableFactory.java | 101 + .../v1/stub/HttpJsonProvisioningStub.java | 517 ++ ...ojectAttachmentServiceCallableFactory.java | 101 + ...onRuntimeProjectAttachmentServiceStub.java | 640 ++ .../apihub/v1/stub/LintingServiceStub.java | 77 + .../v1/stub/LintingServiceStubSettings.java | 538 ++ .../apihub/v1/stub/ProvisioningStub.java | 89 + .../v1/stub/ProvisioningStubSettings.java | 573 ++ .../RuntimeProjectAttachmentServiceStub.java | 101 + ...eProjectAttachmentServiceStubSettings.java | 695 ++ .../reflect-config.json | 3548 +++++++++ .../apihub/v1/ApiHubClientHttpJsonTest.java | 3707 +++++++++ .../cloud/apihub/v1/ApiHubClientTest.java | 3155 ++++++++ .../ApiHubDependenciesClientHttpJsonTest.java | 668 ++ .../v1/ApiHubDependenciesClientTest.java | 590 ++ .../v1/ApiHubPluginClientHttpJsonTest.java | 481 ++ .../apihub/v1/ApiHubPluginClientTest.java | 436 ++ ...RegistrationServiceClientHttpJsonTest.java | 521 ++ ...tProjectRegistrationServiceClientTest.java | 484 ++ .../v1/LintingServiceClientHttpJsonTest.java | 490 ++ .../apihub/v1/LintingServiceClientTest.java | 438 ++ .../google/cloud/apihub/v1/MockApiHub.java | 59 + .../apihub/v1/MockApiHubDependencies.java | 59 + .../apihub/v1/MockApiHubDependenciesImpl.java | 166 + .../cloud/apihub/v1/MockApiHubImpl.java | 786 ++ .../cloud/apihub/v1/MockApiHubPlugin.java | 59 + .../cloud/apihub/v1/MockApiHubPluginImpl.java | 120 + .../MockHostProjectRegistrationService.java | 59 + ...ockHostProjectRegistrationServiceImpl.java | 126 + .../cloud/apihub/v1/MockLintingService.java | 59 + .../apihub/v1/MockLintingServiceImpl.java | 144 + .../google/cloud/apihub/v1/MockLocations.java | 59 + .../cloud/apihub/v1/MockLocationsImpl.java | 105 + .../cloud/apihub/v1/MockProvisioning.java | 59 + .../cloud/apihub/v1/MockProvisioningImpl.java | 125 + .../MockRuntimeProjectAttachmentService.java | 59 + ...ckRuntimeProjectAttachmentServiceImpl.java | 171 + .../v1/ProvisioningClientHttpJsonTest.java | 518 ++ .../apihub/v1/ProvisioningClientTest.java | 486 ++ ...ctAttachmentServiceClientHttpJsonTest.java | 700 ++ ...imeProjectAttachmentServiceClientTest.java | 641 ++ .../grpc-google-cloud-apihub-v1/pom.xml | 45 + .../apihub/v1/ApiHubDependenciesGrpc.java | 862 +++ .../google/cloud/apihub/v1/ApiHubGrpc.java | 4664 ++++++++++++ .../cloud/apihub/v1/ApiHubPluginGrpc.java | 593 ++ .../HostProjectRegistrationServiceGrpc.java | 668 ++ .../cloud/apihub/v1/LintingServiceGrpc.java | 718 ++ .../cloud/apihub/v1/ProvisioningGrpc.java | 617 ++ .../RuntimeProjectAttachmentServiceGrpc.java | 921 +++ java-apihub/owlbot.py | 36 + java-apihub/pom.xml | 55 + .../clirr-ignored-differences.xml | 19 + .../proto-google-cloud-apihub-v1/pom.xml | 37 + .../java/com/google/cloud/apihub/v1/Api.java | 5067 +++++++++++++ .../cloud/apihub/v1/ApiHubInstance.java | 3310 ++++++++ .../cloud/apihub/v1/ApiHubInstanceName.java | 227 + .../apihub/v1/ApiHubInstanceOrBuilder.java | 319 + .../cloud/apihub/v1/ApiHubResource.java | 2352 ++++++ .../apihub/v1/ApiHubResourceOrBuilder.java | 256 + .../cloud/apihub/v1/ApiHubServiceProto.java | 1037 +++ .../com/google/cloud/apihub/v1/ApiName.java | 216 + .../google/cloud/apihub/v1/ApiOperation.java | 2214 ++++++ .../cloud/apihub/v1/ApiOperationName.java | 298 + .../apihub/v1/ApiOperationOrBuilder.java | 290 + .../google/cloud/apihub/v1/ApiOrBuilder.java | 758 ++ .../com/google/cloud/apihub/v1/Attribute.java | 4805 ++++++++++++ .../google/cloud/apihub/v1/AttributeName.java | 223 + .../cloud/apihub/v1/AttributeOrBuilder.java | 376 + .../cloud/apihub/v1/AttributeValues.java | 3519 +++++++++ .../apihub/v1/AttributeValuesOrBuilder.java | 175 + .../cloud/apihub/v1/CommonFieldsProto.java | 954 +++ .../v1/CreateApiHubInstanceRequest.java | 1173 +++ .../CreateApiHubInstanceRequestOrBuilder.java | 133 + .../cloud/apihub/v1/CreateApiRequest.java | 1154 +++ .../apihub/v1/CreateApiRequestOrBuilder.java | 133 + .../apihub/v1/CreateAttributeRequest.java | 1196 +++ .../v1/CreateAttributeRequestOrBuilder.java | 141 + .../apihub/v1/CreateDependencyRequest.java | 1184 +++ .../v1/CreateDependencyRequestOrBuilder.java | 137 + .../apihub/v1/CreateDeploymentRequest.java | 1196 +++ .../v1/CreateDeploymentRequestOrBuilder.java | 141 + .../apihub/v1/CreateExternalApiRequest.java | 1204 +++ .../v1/CreateExternalApiRequestOrBuilder.java | 143 + .../CreateHostProjectRegistrationRequest.java | 1184 +++ ...stProjectRegistrationRequestOrBuilder.java | 129 + ...CreateRuntimeProjectAttachmentRequest.java | 1188 +++ ...timeProjectAttachmentRequestOrBuilder.java | 132 + .../cloud/apihub/v1/CreateSpecRequest.java | 1168 +++ .../apihub/v1/CreateSpecRequestOrBuilder.java | 137 + .../cloud/apihub/v1/CreateVersionRequest.java | 1173 +++ .../v1/CreateVersionRequestOrBuilder.java | 136 + .../google/cloud/apihub/v1/Definition.java | 2605 +++++++ .../cloud/apihub/v1/DefinitionName.java | 298 + .../cloud/apihub/v1/DefinitionOrBuilder.java | 318 + .../cloud/apihub/v1/DeleteApiRequest.java | 742 ++ .../apihub/v1/DeleteApiRequestOrBuilder.java | 71 + .../apihub/v1/DeleteAttributeRequest.java | 655 ++ .../v1/DeleteAttributeRequestOrBuilder.java | 59 + .../apihub/v1/DeleteDependencyRequest.java | 650 ++ .../v1/DeleteDependencyRequestOrBuilder.java | 57 + .../apihub/v1/DeleteDeploymentRequest.java | 648 ++ .../v1/DeleteDeploymentRequestOrBuilder.java | 57 + .../apihub/v1/DeleteExternalApiRequest.java | 655 ++ .../v1/DeleteExternalApiRequestOrBuilder.java | 59 + ...DeleteRuntimeProjectAttachmentRequest.java | 667 ++ ...timeProjectAttachmentRequestOrBuilder.java | 59 + .../cloud/apihub/v1/DeleteSpecRequest.java | 652 ++ .../apihub/v1/DeleteSpecRequestOrBuilder.java | 59 + .../cloud/apihub/v1/DeleteVersionRequest.java | 752 ++ .../v1/DeleteVersionRequestOrBuilder.java | 73 + .../google/cloud/apihub/v1/Dependency.java | 3409 +++++++++ .../apihub/v1/DependencyEntityReference.java | 1227 +++ .../DependencyEntityReferenceOrBuilder.java | 145 + .../apihub/v1/DependencyErrorDetail.java | 1051 +++ .../v1/DependencyErrorDetailOrBuilder.java | 93 + .../cloud/apihub/v1/DependencyName.java | 223 + .../cloud/apihub/v1/DependencyOrBuilder.java | 423 ++ .../google/cloud/apihub/v1/Deployment.java | 4297 +++++++++++ .../cloud/apihub/v1/DeploymentName.java | 223 + .../cloud/apihub/v1/DeploymentOrBuilder.java | 640 ++ .../cloud/apihub/v1/DisablePluginRequest.java | 648 ++ .../v1/DisablePluginRequestOrBuilder.java | 57 + .../google/cloud/apihub/v1/Documentation.java | 623 ++ .../apihub/v1/DocumentationOrBuilder.java | 51 + .../cloud/apihub/v1/EnablePluginRequest.java | 647 ++ .../v1/EnablePluginRequestOrBuilder.java | 57 + .../google/cloud/apihub/v1/ExternalApi.java | 2918 ++++++++ .../cloud/apihub/v1/ExternalApiName.java | 227 + .../cloud/apihub/v1/ExternalApiOrBuilder.java | 409 + .../apihub/v1/GetApiHubInstanceRequest.java | 657 ++ .../v1/GetApiHubInstanceRequestOrBuilder.java | 59 + .../apihub/v1/GetApiOperationRequest.java | 655 ++ .../v1/GetApiOperationRequestOrBuilder.java | 59 + .../google/cloud/apihub/v1/GetApiRequest.java | 644 ++ .../apihub/v1/GetApiRequestOrBuilder.java | 57 + .../cloud/apihub/v1/GetAttributeRequest.java | 654 ++ .../v1/GetAttributeRequestOrBuilder.java | 59 + .../cloud/apihub/v1/GetDefinitionRequest.java | 655 ++ .../v1/GetDefinitionRequestOrBuilder.java | 59 + .../cloud/apihub/v1/GetDependencyRequest.java | 648 ++ .../v1/GetDependencyRequestOrBuilder.java | 57 + .../cloud/apihub/v1/GetDeploymentRequest.java | 648 ++ .../v1/GetDeploymentRequestOrBuilder.java | 57 + .../apihub/v1/GetExternalApiRequest.java | 655 ++ .../v1/GetExternalApiRequestOrBuilder.java | 59 + .../v1/GetHostProjectRegistrationRequest.java | 656 ++ ...stProjectRegistrationRequestOrBuilder.java | 57 + .../cloud/apihub/v1/GetPluginRequest.java | 647 ++ .../apihub/v1/GetPluginRequestOrBuilder.java | 57 + .../GetRuntimeProjectAttachmentRequest.java | 663 ++ ...timeProjectAttachmentRequestOrBuilder.java | 59 + .../apihub/v1/GetSpecContentsRequest.java | 655 ++ .../v1/GetSpecContentsRequestOrBuilder.java | 59 + .../cloud/apihub/v1/GetSpecRequest.java | 652 ++ .../apihub/v1/GetSpecRequestOrBuilder.java | 59 + .../v1/GetStyleGuideContentsRequest.java | 661 ++ ...GetStyleGuideContentsRequestOrBuilder.java | 61 + .../cloud/apihub/v1/GetStyleGuideRequest.java | 653 ++ .../v1/GetStyleGuideRequestOrBuilder.java | 59 + .../cloud/apihub/v1/GetVersionRequest.java | 652 ++ .../apihub/v1/GetVersionRequestOrBuilder.java | 59 + .../apihub/v1/HostProjectRegistration.java | 1160 +++ .../v1/HostProjectRegistrationName.java | 240 + .../v1/HostProjectRegistrationOrBuilder.java | 128 + .../HostProjectRegistrationServiceProto.java | 190 + .../google/cloud/apihub/v1/HttpOperation.java | 1175 +++ .../apihub/v1/HttpOperationOrBuilder.java | 93 + .../com/google/cloud/apihub/v1/Issue.java | 1532 ++++ .../cloud/apihub/v1/IssueOrBuilder.java | 193 + .../google/cloud/apihub/v1/LintResponse.java | 3031 ++++++++ .../apihub/v1/LintResponseOrBuilder.java | 266 + .../cloud/apihub/v1/LintSpecRequest.java | 652 ++ .../apihub/v1/LintSpecRequestOrBuilder.java | 59 + .../com/google/cloud/apihub/v1/LintState.java | 177 + .../com/google/cloud/apihub/v1/Linter.java | 177 + .../cloud/apihub/v1/LintingServiceProto.java | 198 + .../apihub/v1/ListApiOperationsRequest.java | 1425 ++++ .../v1/ListApiOperationsRequestOrBuilder.java | 211 + .../apihub/v1/ListApiOperationsResponse.java | 1201 +++ .../ListApiOperationsResponseOrBuilder.java | 120 + .../cloud/apihub/v1/ListApisRequest.java | 1632 ++++ .../apihub/v1/ListApisRequestOrBuilder.java | 271 + .../cloud/apihub/v1/ListApisResponse.java | 1116 +++ .../apihub/v1/ListApisResponseOrBuilder.java | 104 + .../apihub/v1/ListAttributesRequest.java | 1439 ++++ .../v1/ListAttributesRequestOrBuilder.java | 215 + .../apihub/v1/ListAttributesResponse.java | 1126 +++ .../v1/ListAttributesResponseOrBuilder.java | 105 + .../apihub/v1/ListDependenciesRequest.java | 1378 ++++ .../v1/ListDependenciesRequestOrBuilder.java | 197 + .../apihub/v1/ListDependenciesResponse.java | 1153 +++ .../v1/ListDependenciesResponseOrBuilder.java | 110 + .../apihub/v1/ListDeploymentsRequest.java | 1544 ++++ .../v1/ListDeploymentsRequestOrBuilder.java | 245 + .../apihub/v1/ListDeploymentsResponse.java | 1127 +++ .../v1/ListDeploymentsResponseOrBuilder.java | 105 + .../apihub/v1/ListExternalApisRequest.java | 963 +++ .../v1/ListExternalApisRequestOrBuilder.java | 106 + .../apihub/v1/ListExternalApisResponse.java | 1174 +++ .../v1/ListExternalApisResponseOrBuilder.java | 115 + .../ListHostProjectRegistrationsRequest.java | 1457 ++++ ...tProjectRegistrationsRequestOrBuilder.java | 190 + .../ListHostProjectRegistrationsResponse.java | 1204 +++ ...ProjectRegistrationsResponseOrBuilder.java | 112 + .../ListRuntimeProjectAttachmentsRequest.java | 1458 ++++ ...imeProjectAttachmentsRequestOrBuilder.java | 190 + ...ListRuntimeProjectAttachmentsResponse.java | 1210 +++ ...meProjectAttachmentsResponseOrBuilder.java | 117 + .../cloud/apihub/v1/ListSpecsRequest.java | 1499 ++++ .../apihub/v1/ListSpecsRequestOrBuilder.java | 233 + .../cloud/apihub/v1/ListSpecsResponse.java | 1119 +++ .../apihub/v1/ListSpecsResponseOrBuilder.java | 104 + .../cloud/apihub/v1/ListVersionsRequest.java | 1550 ++++ .../v1/ListVersionsRequestOrBuilder.java | 247 + .../cloud/apihub/v1/ListVersionsResponse.java | 1126 +++ .../v1/ListVersionsResponseOrBuilder.java | 104 + .../google/cloud/apihub/v1/LocationName.java | 192 + .../v1/LookupApiHubInstanceRequest.java | 665 ++ .../LookupApiHubInstanceRequestOrBuilder.java | 61 + .../v1/LookupApiHubInstanceResponse.java | 728 ++ ...LookupApiHubInstanceResponseOrBuilder.java | 61 + ...LookupRuntimeProjectAttachmentRequest.java | 667 ++ ...timeProjectAttachmentRequestOrBuilder.java | 59 + ...ookupRuntimeProjectAttachmentResponse.java | 750 ++ ...imeProjectAttachmentResponseOrBuilder.java | 62 + .../cloud/apihub/v1/OpenApiSpecDetails.java | 1277 ++++ .../v1/OpenApiSpecDetailsOrBuilder.java | 123 + .../cloud/apihub/v1/OperationDetails.java | 1427 ++++ .../apihub/v1/OperationDetailsOrBuilder.java | 150 + .../cloud/apihub/v1/OperationMetadata.java | 1847 +++++ .../apihub/v1/OperationMetadataOrBuilder.java | 219 + .../com/google/cloud/apihub/v1/Owner.java | 802 ++ .../cloud/apihub/v1/OwnerOrBuilder.java | 76 + .../java/com/google/cloud/apihub/v1/Path.java | 801 ++ .../google/cloud/apihub/v1/PathOrBuilder.java | 76 + .../com/google/cloud/apihub/v1/Plugin.java | 1710 +++++ .../google/cloud/apihub/v1/PluginName.java | 223 + .../cloud/apihub/v1/PluginOrBuilder.java | 198 + .../cloud/apihub/v1/PluginServiceProto.java | 158 + .../com/google/cloud/apihub/v1/Point.java | 623 ++ .../cloud/apihub/v1/PointOrBuilder.java | 52 + .../apihub/v1/ProvisioningServiceProto.java | 163 + .../com/google/cloud/apihub/v1/Range.java | 977 +++ .../cloud/apihub/v1/RangeOrBuilder.java | 96 + .../apihub/v1/RuntimeProjectAttachment.java | 1151 +++ .../v1/RuntimeProjectAttachmentName.java | 240 + .../v1/RuntimeProjectAttachmentOrBuilder.java | 126 + .../RuntimeProjectAttachmentServiceProto.java | 250 + .../com/google/cloud/apihub/v1/Schema.java | 736 ++ .../cloud/apihub/v1/SchemaOrBuilder.java | 67 + .../apihub/v1/SearchResourcesRequest.java | 1496 ++++ .../v1/SearchResourcesRequestOrBuilder.java | 204 + .../apihub/v1/SearchResourcesResponse.java | 1169 +++ .../v1/SearchResourcesResponseOrBuilder.java | 114 + .../google/cloud/apihub/v1/SearchResult.java | 731 ++ .../apihub/v1/SearchResultOrBuilder.java | 64 + .../com/google/cloud/apihub/v1/Severity.java | 221 + .../java/com/google/cloud/apihub/v1/Spec.java | 4004 ++++++++++ .../google/cloud/apihub/v1/SpecContents.java | 726 ++ .../apihub/v1/SpecContentsOrBuilder.java | 66 + .../google/cloud/apihub/v1/SpecDetails.java | 1073 +++ .../cloud/apihub/v1/SpecDetailsOrBuilder.java | 106 + .../com/google/cloud/apihub/v1/SpecName.java | 288 + .../google/cloud/apihub/v1/SpecOrBuilder.java | 536 ++ .../google/cloud/apihub/v1/StyleGuide.java | 1103 +++ .../cloud/apihub/v1/StyleGuideContents.java | 720 ++ .../v1/StyleGuideContentsOrBuilder.java | 64 + .../cloud/apihub/v1/StyleGuideName.java | 223 + .../cloud/apihub/v1/StyleGuideOrBuilder.java | 125 + .../cloud/apihub/v1/UpdateApiRequest.java | 1036 +++ .../apihub/v1/UpdateApiRequestOrBuilder.java | 111 + .../apihub/v1/UpdateAttributeRequest.java | 1071 +++ .../v1/UpdateAttributeRequestOrBuilder.java | 117 + .../apihub/v1/UpdateDependencyRequest.java | 1061 +++ .../v1/UpdateDependencyRequestOrBuilder.java | 114 + .../apihub/v1/UpdateDeploymentRequest.java | 1071 +++ .../v1/UpdateDeploymentRequestOrBuilder.java | 117 + .../apihub/v1/UpdateExternalApiRequest.java | 1072 +++ .../v1/UpdateExternalApiRequestOrBuilder.java | 117 + .../cloud/apihub/v1/UpdateSpecRequest.java | 1036 +++ .../apihub/v1/UpdateSpecRequestOrBuilder.java | 111 + .../apihub/v1/UpdateStyleGuideRequest.java | 1021 +++ .../v1/UpdateStyleGuideRequestOrBuilder.java | 105 + .../cloud/apihub/v1/UpdateVersionRequest.java | 1055 +++ .../v1/UpdateVersionRequestOrBuilder.java | 114 + .../com/google/cloud/apihub/v1/Version.java | 5099 +++++++++++++ .../google/cloud/apihub/v1/VersionName.java | 257 + .../cloud/apihub/v1/VersionOrBuilder.java | 818 ++ .../cloud/apihub/v1/apihub_service.proto | 1836 +++++ .../cloud/apihub/v1/common_fields.proto | 1297 ++++ .../host_project_registration_service.proto | 207 + .../cloud/apihub/v1/linting_service.proto | 159 + .../cloud/apihub/v1/plugin_service.proto | 148 + .../apihub/v1/provisioning_service.proto | 136 + .../runtime_project_attachment_service.proto | 261 + .../SyncCreateSetCredentialsProvider.java | 44 + .../SyncCreateSetCredentialsProvider1.java | 39 + .../apihub/create/SyncCreateSetEndpoint.java | 40 + .../v1/apihub/createapi/AsyncCreateApi.java | 51 + .../v1/apihub/createapi/SyncCreateApi.java | 48 + .../SyncCreateApiLocationnameApiString.java | 44 + .../SyncCreateApiStringApiString.java | 44 + .../createattribute/AsyncCreateAttribute.java | 51 + .../createattribute/SyncCreateAttribute.java | 48 + ...eAttributeLocationnameAttributeString.java | 44 + ...cCreateAttributeStringAttributeString.java | 44 + .../AsyncCreateDeployment.java | 51 + .../SyncCreateDeployment.java | 48 + ...eploymentLocationnameDeploymentString.java | 44 + ...reateDeploymentStringDeploymentString.java | 44 + .../AsyncCreateExternalApi.java | 51 + .../SyncCreateExternalApi.java | 48 + ...ernalApiLocationnameExternalapiString.java | 44 + ...ateExternalApiStringExternalapiString.java | 44 + .../v1/apihub/createspec/AsyncCreateSpec.java | 51 + .../v1/apihub/createspec/SyncCreateSpec.java | 48 + .../SyncCreateSpecStringSpecString.java | 44 + .../SyncCreateSpecVersionnameSpecString.java | 44 + .../createversion/AsyncCreateVersion.java | 51 + .../createversion/SyncCreateVersion.java | 48 + ...SyncCreateVersionApinameVersionString.java | 44 + .../SyncCreateVersionStringVersionString.java | 44 + .../v1/apihub/deleteapi/AsyncDeleteApi.java | 50 + .../v1/apihub/deleteapi/SyncDeleteApi.java | 47 + .../deleteapi/SyncDeleteApiApiname.java | 42 + .../apihub/deleteapi/SyncDeleteApiString.java | 42 + .../deleteattribute/AsyncDeleteAttribute.java | 49 + .../deleteattribute/SyncDeleteAttribute.java | 46 + .../SyncDeleteAttributeAttributename.java | 42 + .../SyncDeleteAttributeString.java | 42 + .../AsyncDeleteDeployment.java | 49 + .../SyncDeleteDeployment.java | 46 + .../SyncDeleteDeploymentDeploymentname.java | 42 + .../SyncDeleteDeploymentString.java | 42 + .../AsyncDeleteExternalApi.java | 49 + .../SyncDeleteExternalApi.java | 46 + .../SyncDeleteExternalApiExternalapiname.java | 42 + .../SyncDeleteExternalApiString.java | 42 + .../v1/apihub/deletespec/AsyncDeleteSpec.java | 50 + .../v1/apihub/deletespec/SyncDeleteSpec.java | 47 + .../deletespec/SyncDeleteSpecSpecname.java | 42 + .../deletespec/SyncDeleteSpecString.java | 43 + .../deleteversion/AsyncDeleteVersion.java | 50 + .../deleteversion/SyncDeleteVersion.java | 47 + .../SyncDeleteVersionString.java | 42 + .../SyncDeleteVersionVersionname.java | 42 + .../apihub/v1/apihub/getapi/AsyncGetApi.java | 49 + .../apihub/v1/apihub/getapi/SyncGetApi.java | 46 + .../v1/apihub/getapi/SyncGetApiApiname.java | 42 + .../v1/apihub/getapi/SyncGetApiString.java | 42 + .../getapioperation/AsyncGetApiOperation.java | 52 + .../getapioperation/SyncGetApiOperation.java | 49 + .../SyncGetApiOperationApioperationname.java | 43 + .../SyncGetApiOperationString.java | 44 + .../getattribute/AsyncGetAttribute.java | 49 + .../apihub/getattribute/SyncGetAttribute.java | 46 + .../SyncGetAttributeAttributename.java | 42 + .../getattribute/SyncGetAttributeString.java | 42 + .../getdefinition/AsyncGetDefinition.java | 51 + .../getdefinition/SyncGetDefinition.java | 48 + .../SyncGetDefinitionDefinitionname.java | 43 + .../SyncGetDefinitionString.java | 44 + .../getdeployment/AsyncGetDeployment.java | 49 + .../getdeployment/SyncGetDeployment.java | 46 + .../SyncGetDeploymentDeploymentname.java | 42 + .../SyncGetDeploymentString.java | 42 + .../getexternalapi/AsyncGetExternalApi.java | 49 + .../getexternalapi/SyncGetExternalApi.java | 46 + .../SyncGetExternalApiExternalapiname.java | 42 + .../SyncGetExternalApiString.java | 42 + .../apihub/getlocation/AsyncGetLocation.java | 45 + .../apihub/getlocation/SyncGetLocation.java | 42 + .../v1/apihub/getspec/AsyncGetSpec.java | 50 + .../apihub/v1/apihub/getspec/SyncGetSpec.java | 47 + .../apihub/getspec/SyncGetSpecSpecname.java | 42 + .../v1/apihub/getspec/SyncGetSpecString.java | 43 + .../getspeccontents/AsyncGetSpecContents.java | 50 + .../getspeccontents/SyncGetSpecContents.java | 47 + .../SyncGetSpecContentsSpecname.java | 42 + .../SyncGetSpecContentsString.java | 43 + .../v1/apihub/getversion/AsyncGetVersion.java | 49 + .../v1/apihub/getversion/SyncGetVersion.java | 46 + .../getversion/SyncGetVersionString.java | 42 + .../getversion/SyncGetVersionVersionname.java | 42 + .../AsyncListApiOperations.java | 55 + .../AsyncListApiOperationsPaged.java | 62 + .../SyncListApiOperations.java | 51 + .../SyncListApiOperationsString.java | 44 + .../SyncListApiOperationsVersionname.java | 44 + .../v1/apihub/listapis/AsyncListApis.java | 54 + .../apihub/listapis/AsyncListApisPaged.java | 62 + .../v1/apihub/listapis/SyncListApis.java | 51 + .../listapis/SyncListApisLocationname.java | 44 + .../apihub/listapis/SyncListApisString.java | 44 + .../listattributes/AsyncListAttributes.java | 54 + .../AsyncListAttributesPaged.java | 62 + .../listattributes/SyncListAttributes.java | 51 + .../SyncListAttributesLocationname.java | 44 + .../SyncListAttributesString.java | 44 + .../listdeployments/AsyncListDeployments.java | 55 + .../AsyncListDeploymentsPaged.java | 62 + .../listdeployments/SyncListDeployments.java | 51 + .../SyncListDeploymentsLocationname.java | 44 + .../SyncListDeploymentsString.java | 44 + .../AsyncListExternalApis.java | 54 + .../AsyncListExternalApisPaged.java | 61 + .../SyncListExternalApis.java | 50 + .../SyncListExternalApisLocationname.java | 44 + .../SyncListExternalApisString.java | 44 + .../listlocations/AsyncListLocations.java | 53 + .../AsyncListLocationsPaged.java | 61 + .../listlocations/SyncListLocations.java | 50 + .../v1/apihub/listspecs/AsyncListSpecs.java | 54 + .../apihub/listspecs/AsyncListSpecsPaged.java | 62 + .../v1/apihub/listspecs/SyncListSpecs.java | 51 + .../apihub/listspecs/SyncListSpecsString.java | 44 + .../listspecs/SyncListSpecsVersionname.java | 44 + .../listversions/AsyncListVersions.java | 54 + .../listversions/AsyncListVersionsPaged.java | 62 + .../apihub/listversions/SyncListVersions.java | 51 + .../listversions/SyncListVersionsApiname.java | 44 + .../listversions/SyncListVersionsString.java | 44 + .../searchresources/AsyncSearchResources.java | 56 + .../AsyncSearchResourcesPaged.java | 63 + .../searchresources/SyncSearchResources.java | 52 + ...SyncSearchResourcesLocationnameString.java | 45 + .../SyncSearchResourcesStringString.java | 45 + .../v1/apihub/updateapi/AsyncUpdateApi.java | 50 + .../v1/apihub/updateapi/SyncUpdateApi.java | 47 + .../updateapi/SyncUpdateApiApiFieldmask.java | 43 + .../updateattribute/AsyncUpdateAttribute.java | 50 + .../updateattribute/SyncUpdateAttribute.java | 47 + ...SyncUpdateAttributeAttributeFieldmask.java | 43 + .../AsyncUpdateDeployment.java | 50 + .../SyncUpdateDeployment.java | 47 + ...ncUpdateDeploymentDeploymentFieldmask.java | 43 + .../AsyncUpdateExternalApi.java | 50 + .../SyncUpdateExternalApi.java | 47 + ...UpdateExternalApiExternalapiFieldmask.java | 43 + .../v1/apihub/updatespec/AsyncUpdateSpec.java | 50 + .../v1/apihub/updatespec/SyncUpdateSpec.java | 47 + .../SyncUpdateSpecSpecFieldmask.java | 43 + .../updateversion/AsyncUpdateVersion.java | 50 + .../updateversion/SyncUpdateVersion.java | 47 + .../SyncUpdateVersionVersionFieldmask.java | 43 + .../SyncCreateSetCredentialsProvider.java | 45 + .../SyncCreateSetCredentialsProvider1.java | 41 + .../create/SyncCreateSetEndpoint.java | 42 + .../AsyncCreateDependency.java | 52 + .../SyncCreateDependency.java | 48 + ...ependencyLocationnameDependencyString.java | 45 + ...reateDependencyStringDependencyString.java | 45 + .../AsyncDeleteDependency.java | 50 + .../SyncDeleteDependency.java | 46 + .../SyncDeleteDependencyDependencyname.java | 42 + .../SyncDeleteDependencyString.java | 42 + .../getdependency/AsyncGetDependency.java | 50 + .../getdependency/SyncGetDependency.java | 46 + .../SyncGetDependencyDependencyname.java | 42 + .../SyncGetDependencyString.java | 42 + .../getlocation/AsyncGetLocation.java | 46 + .../getlocation/SyncGetLocation.java | 42 + .../AsyncListDependencies.java | 55 + .../AsyncListDependenciesPaged.java | 63 + .../SyncListDependencies.java | 51 + .../SyncListDependenciesLocationname.java | 44 + .../SyncListDependenciesString.java | 44 + .../listlocations/AsyncListLocations.java | 54 + .../AsyncListLocationsPaged.java | 62 + .../listlocations/SyncListLocations.java | 50 + .../AsyncUpdateDependency.java | 51 + .../SyncUpdateDependency.java | 47 + ...ncUpdateDependencyDependencyFieldmask.java | 43 + .../SyncCreateDependency.java | 50 + .../SyncCreateSetCredentialsProvider.java | 44 + .../SyncCreateSetCredentialsProvider1.java | 39 + .../create/SyncCreateSetEndpoint.java | 41 + .../disableplugin/AsyncDisablePlugin.java | 49 + .../disableplugin/SyncDisablePlugin.java | 46 + .../SyncDisablePluginPluginname.java | 42 + .../SyncDisablePluginString.java | 42 + .../enableplugin/AsyncEnablePlugin.java | 49 + .../enableplugin/SyncEnablePlugin.java | 46 + .../SyncEnablePluginPluginname.java | 42 + .../enableplugin/SyncEnablePluginString.java | 42 + .../getlocation/AsyncGetLocation.java | 45 + .../getlocation/SyncGetLocation.java | 42 + .../getplugin/AsyncGetPlugin.java | 49 + .../apihubplugin/getplugin/SyncGetPlugin.java | 46 + .../getplugin/SyncGetPluginPluginname.java | 42 + .../getplugin/SyncGetPluginString.java | 42 + .../listlocations/AsyncListLocations.java | 54 + .../AsyncListLocationsPaged.java | 61 + .../listlocations/SyncListLocations.java | 50 + .../getplugin/SyncGetPlugin.java | 48 + .../createapi/SyncCreateApi.java | 48 + .../SyncCreateSetCredentialsProvider.java | 45 + .../SyncCreateSetCredentialsProvider1.java | 41 + .../create/SyncCreateSetEndpoint.java | 42 + .../AsyncCreateHostProjectRegistration.java | 55 + .../SyncCreateHostProjectRegistration.java | 50 + ...tionnameHostprojectregistrationString.java | 49 + ...onStringHostprojectregistrationString.java | 49 + .../AsyncGetHostProjectRegistration.java | 56 + .../SyncGetHostProjectRegistration.java | 51 + ...gistrationHostprojectregistrationname.java | 45 + .../SyncGetHostProjectRegistrationString.java | 46 + .../getlocation/AsyncGetLocation.java | 47 + .../getlocation/SyncGetLocation.java | 43 + .../AsyncListHostProjectRegistrations.java | 59 + ...syncListHostProjectRegistrationsPaged.java | 67 + .../SyncListHostProjectRegistrations.java | 54 + ...tHostProjectRegistrationsLocationname.java | 46 + ...yncListHostProjectRegistrationsString.java | 46 + .../listlocations/AsyncListLocations.java | 55 + .../AsyncListLocationsPaged.java | 63 + .../listlocations/SyncListLocations.java | 52 + .../SyncCreateHostProjectRegistration.java | 50 + .../SyncCreateSetCredentialsProvider.java | 44 + .../SyncCreateSetCredentialsProvider1.java | 40 + .../create/SyncCreateSetEndpoint.java | 41 + .../getlocation/AsyncGetLocation.java | 45 + .../getlocation/SyncGetLocation.java | 42 + .../getstyleguide/AsyncGetStyleGuide.java | 50 + .../getstyleguide/SyncGetStyleGuide.java | 46 + .../SyncGetStyleGuideString.java | 42 + .../SyncGetStyleGuideStyleguidename.java | 42 + .../AsyncGetStyleGuideContents.java | 50 + .../SyncGetStyleGuideContents.java | 46 + .../SyncGetStyleGuideContentsString.java | 42 + ...ncGetStyleGuideContentsStyleguidename.java | 42 + .../lintspec/AsyncLintSpec.java | 50 + .../lintingservice/lintspec/SyncLintSpec.java | 47 + .../listlocations/AsyncListLocations.java | 54 + .../AsyncListLocationsPaged.java | 61 + .../listlocations/SyncListLocations.java | 50 + .../AsyncUpdateStyleGuide.java | 51 + .../SyncUpdateStyleGuide.java | 47 + ...ncUpdateStyleGuideStyleguideFieldmask.java | 43 + .../getstyleguide/SyncGetStyleGuide.java | 49 + .../SyncCreateSetCredentialsProvider.java | 44 + .../SyncCreateSetCredentialsProvider1.java | 39 + .../create/SyncCreateSetEndpoint.java | 41 + .../AsyncCreateApiHubInstance.java | 53 + .../AsyncCreateApiHubInstanceLRO.java | 53 + .../SyncCreateApiHubInstance.java | 48 + ...tanceLocationnameApihubinstanceString.java | 47 + ...HubInstanceStringApihubinstanceString.java | 47 + .../AsyncGetApiHubInstance.java | 51 + .../SyncGetApiHubInstance.java | 47 + ...ncGetApiHubInstanceApihubinstancename.java | 43 + .../SyncGetApiHubInstanceString.java | 43 + .../getlocation/AsyncGetLocation.java | 45 + .../getlocation/SyncGetLocation.java | 42 + .../listlocations/AsyncListLocations.java | 54 + .../AsyncListLocationsPaged.java | 61 + .../listlocations/SyncListLocations.java | 50 + .../AsyncLookupApiHubInstance.java | 50 + .../SyncLookupApiHubInstance.java | 46 + .../SyncLookupApiHubInstanceLocationname.java | 42 + .../SyncLookupApiHubInstanceString.java | 42 + .../SyncGetApiHubInstance.java | 48 + .../SyncCreateSetCredentialsProvider.java | 45 + .../SyncCreateSetCredentialsProvider1.java | 41 + .../create/SyncCreateSetEndpoint.java | 42 + .../AsyncCreateRuntimeProjectAttachment.java | 55 + .../SyncCreateRuntimeProjectAttachment.java | 50 + ...ionnameRuntimeprojectattachmentString.java | 49 + ...tStringRuntimeprojectattachmentString.java | 49 + .../AsyncDeleteRuntimeProjectAttachment.java | 56 + .../SyncDeleteRuntimeProjectAttachment.java | 50 + ...ttachmentRuntimeprojectattachmentname.java | 46 + ...cDeleteRuntimeProjectAttachmentString.java | 45 + .../getlocation/AsyncGetLocation.java | 47 + .../getlocation/SyncGetLocation.java | 43 + .../AsyncGetRuntimeProjectAttachment.java | 56 + .../SyncGetRuntimeProjectAttachment.java | 51 + ...ttachmentRuntimeprojectattachmentname.java | 47 + ...SyncGetRuntimeProjectAttachmentString.java | 46 + .../listlocations/AsyncListLocations.java | 55 + .../AsyncListLocationsPaged.java | 63 + .../listlocations/SyncListLocations.java | 52 + .../AsyncListRuntimeProjectAttachments.java | 59 + ...yncListRuntimeProjectAttachmentsPaged.java | 67 + .../SyncListRuntimeProjectAttachments.java | 56 + ...RuntimeProjectAttachmentsLocationname.java | 48 + ...ncListRuntimeProjectAttachmentsString.java | 48 + .../AsyncLookupRuntimeProjectAttachment.java | 53 + .../SyncLookupRuntimeProjectAttachment.java | 48 + ...pRuntimeProjectAttachmentLocationname.java | 44 + ...cLookupRuntimeProjectAttachmentString.java | 44 + .../SyncCreateRuntimeProjectAttachment.java | 50 + .../SyncCreateDependency.java | 50 + .../getplugin/SyncGetPlugin.java | 49 + .../createapi/SyncCreateApi.java | 48 + .../SyncCreateHostProjectRegistration.java | 51 + .../getstyleguide/SyncGetStyleGuide.java | 49 + .../SyncGetApiHubInstance.java | 49 + .../SyncCreateRuntimeProjectAttachment.java | 51 + pom.xml | 1 + versions.txt | 3 + 655 files changed, 241175 insertions(+) create mode 100644 java-apihub/.OwlBot-hermetic.yaml create mode 100644 java-apihub/.repo-metadata.json create mode 100644 java-apihub/README.md create mode 100644 java-apihub/google-cloud-apihub-bom/pom.xml create mode 100644 java-apihub/google-cloud-apihub/pom.xml create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ApiHubClient.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ApiHubDependenciesClient.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ApiHubDependenciesSettings.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ApiHubPluginClient.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ApiHubPluginSettings.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ApiHubSettings.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/HostProjectRegistrationServiceClient.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/HostProjectRegistrationServiceSettings.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/LintingServiceClient.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/LintingServiceSettings.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ProvisioningClient.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ProvisioningSettings.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentServiceClient.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentServiceSettings.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/gapic_metadata.json create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/package-info.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ApiHubDependenciesStub.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ApiHubDependenciesStubSettings.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ApiHubPluginStub.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ApiHubPluginStubSettings.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ApiHubStub.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ApiHubStubSettings.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcApiHubCallableFactory.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcApiHubDependenciesCallableFactory.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcApiHubDependenciesStub.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcApiHubPluginCallableFactory.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcApiHubPluginStub.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcApiHubStub.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcHostProjectRegistrationServiceCallableFactory.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcHostProjectRegistrationServiceStub.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcLintingServiceCallableFactory.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcLintingServiceStub.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcProvisioningCallableFactory.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcProvisioningStub.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcRuntimeProjectAttachmentServiceCallableFactory.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcRuntimeProjectAttachmentServiceStub.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HostProjectRegistrationServiceStub.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HostProjectRegistrationServiceStubSettings.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonApiHubCallableFactory.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonApiHubDependenciesCallableFactory.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonApiHubDependenciesStub.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonApiHubPluginCallableFactory.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonApiHubPluginStub.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonApiHubStub.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonHostProjectRegistrationServiceCallableFactory.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonHostProjectRegistrationServiceStub.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonLintingServiceCallableFactory.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonLintingServiceStub.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonProvisioningCallableFactory.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonProvisioningStub.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonRuntimeProjectAttachmentServiceCallableFactory.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonRuntimeProjectAttachmentServiceStub.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/LintingServiceStub.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/LintingServiceStubSettings.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ProvisioningStub.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ProvisioningStubSettings.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/RuntimeProjectAttachmentServiceStub.java create mode 100644 java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/RuntimeProjectAttachmentServiceStubSettings.java create mode 100644 java-apihub/google-cloud-apihub/src/main/resources/META-INF/native-image/com.google.cloud.apihub.v1/reflect-config.json create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ApiHubClientHttpJsonTest.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ApiHubClientTest.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ApiHubDependenciesClientHttpJsonTest.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ApiHubDependenciesClientTest.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ApiHubPluginClientHttpJsonTest.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ApiHubPluginClientTest.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/HostProjectRegistrationServiceClientHttpJsonTest.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/HostProjectRegistrationServiceClientTest.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/LintingServiceClientHttpJsonTest.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/LintingServiceClientTest.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockApiHub.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockApiHubDependencies.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockApiHubDependenciesImpl.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockApiHubImpl.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockApiHubPlugin.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockApiHubPluginImpl.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockHostProjectRegistrationService.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockHostProjectRegistrationServiceImpl.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockLintingService.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockLintingServiceImpl.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockLocations.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockLocationsImpl.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockProvisioning.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockProvisioningImpl.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockRuntimeProjectAttachmentService.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockRuntimeProjectAttachmentServiceImpl.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ProvisioningClientHttpJsonTest.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ProvisioningClientTest.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentServiceClientHttpJsonTest.java create mode 100644 java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentServiceClientTest.java create mode 100644 java-apihub/grpc-google-cloud-apihub-v1/pom.xml create mode 100644 java-apihub/grpc-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubDependenciesGrpc.java create mode 100644 java-apihub/grpc-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubGrpc.java create mode 100644 java-apihub/grpc-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubPluginGrpc.java create mode 100644 java-apihub/grpc-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/HostProjectRegistrationServiceGrpc.java create mode 100644 java-apihub/grpc-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LintingServiceGrpc.java create mode 100644 java-apihub/grpc-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ProvisioningGrpc.java create mode 100644 java-apihub/grpc-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentServiceGrpc.java create mode 100644 java-apihub/owlbot.py create mode 100644 java-apihub/pom.xml create mode 100644 java-apihub/proto-google-cloud-apihub-v1/clirr-ignored-differences.xml create mode 100644 java-apihub/proto-google-cloud-apihub-v1/pom.xml create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Api.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubInstance.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubInstanceName.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubInstanceOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubResource.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubResourceOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubServiceProto.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiName.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiOperation.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiOperationName.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiOperationOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Attribute.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/AttributeName.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/AttributeOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/AttributeValues.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/AttributeValuesOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CommonFieldsProto.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateApiHubInstanceRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateApiHubInstanceRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateApiRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateApiRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateAttributeRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateAttributeRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateDependencyRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateDependencyRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateDeploymentRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateDeploymentRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateExternalApiRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateExternalApiRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateHostProjectRegistrationRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateHostProjectRegistrationRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateRuntimeProjectAttachmentRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateRuntimeProjectAttachmentRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateSpecRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateSpecRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateVersionRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateVersionRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Definition.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DefinitionName.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DefinitionOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteApiRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteApiRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteAttributeRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteAttributeRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteDependencyRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteDependencyRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteDeploymentRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteDeploymentRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteExternalApiRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteExternalApiRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteRuntimeProjectAttachmentRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteRuntimeProjectAttachmentRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteSpecRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteSpecRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteVersionRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteVersionRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Dependency.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DependencyEntityReference.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DependencyEntityReferenceOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DependencyErrorDetail.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DependencyErrorDetailOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DependencyName.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DependencyOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Deployment.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeploymentName.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeploymentOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DisablePluginRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DisablePluginRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Documentation.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DocumentationOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/EnablePluginRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/EnablePluginRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ExternalApi.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ExternalApiName.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ExternalApiOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetApiHubInstanceRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetApiHubInstanceRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetApiOperationRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetApiOperationRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetApiRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetApiRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetAttributeRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetAttributeRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetDefinitionRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetDefinitionRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetDependencyRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetDependencyRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetDeploymentRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetDeploymentRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetExternalApiRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetExternalApiRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetHostProjectRegistrationRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetHostProjectRegistrationRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetPluginRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetPluginRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetRuntimeProjectAttachmentRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetRuntimeProjectAttachmentRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetSpecContentsRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetSpecContentsRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetSpecRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetSpecRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetStyleGuideContentsRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetStyleGuideContentsRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetStyleGuideRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetStyleGuideRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetVersionRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetVersionRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/HostProjectRegistration.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/HostProjectRegistrationName.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/HostProjectRegistrationOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/HostProjectRegistrationServiceProto.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/HttpOperation.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/HttpOperationOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Issue.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/IssueOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LintResponse.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LintResponseOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LintSpecRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LintSpecRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LintState.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Linter.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LintingServiceProto.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApiOperationsRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApiOperationsRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApiOperationsResponse.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApiOperationsResponseOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApisRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApisRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApisResponse.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApisResponseOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListAttributesRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListAttributesRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListAttributesResponse.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListAttributesResponseOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDependenciesRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDependenciesRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDependenciesResponse.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDependenciesResponseOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDeploymentsRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDeploymentsRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDeploymentsResponse.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDeploymentsResponseOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListExternalApisRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListExternalApisRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListExternalApisResponse.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListExternalApisResponseOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListHostProjectRegistrationsRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListHostProjectRegistrationsRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListHostProjectRegistrationsResponse.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListHostProjectRegistrationsResponseOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListRuntimeProjectAttachmentsRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListRuntimeProjectAttachmentsRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListRuntimeProjectAttachmentsResponse.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListRuntimeProjectAttachmentsResponseOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListSpecsRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListSpecsRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListSpecsResponse.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListSpecsResponseOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListVersionsRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListVersionsRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListVersionsResponse.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListVersionsResponseOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LocationName.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupApiHubInstanceRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupApiHubInstanceRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupApiHubInstanceResponse.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupApiHubInstanceResponseOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupRuntimeProjectAttachmentRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupRuntimeProjectAttachmentRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupRuntimeProjectAttachmentResponse.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupRuntimeProjectAttachmentResponseOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/OpenApiSpecDetails.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/OpenApiSpecDetailsOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/OperationDetails.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/OperationDetailsOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/OperationMetadata.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/OperationMetadataOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Owner.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/OwnerOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Path.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/PathOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Plugin.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/PluginName.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/PluginOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/PluginServiceProto.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Point.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/PointOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ProvisioningServiceProto.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Range.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/RangeOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/RuntimeProjectAttachment.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentName.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentServiceProto.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Schema.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SchemaOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SearchResourcesRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SearchResourcesRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SearchResourcesResponse.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SearchResourcesResponseOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SearchResult.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SearchResultOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Severity.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Spec.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SpecContents.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SpecContentsOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SpecDetails.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SpecDetailsOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SpecName.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SpecOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/StyleGuide.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/StyleGuideContents.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/StyleGuideContentsOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/StyleGuideName.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/StyleGuideOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateApiRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateApiRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateAttributeRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateAttributeRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateDependencyRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateDependencyRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateDeploymentRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateDeploymentRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateExternalApiRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateExternalApiRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateSpecRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateSpecRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateStyleGuideRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateStyleGuideRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateVersionRequest.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateVersionRequestOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Version.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/VersionName.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/VersionOrBuilder.java create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/proto/google/cloud/apihub/v1/apihub_service.proto create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/proto/google/cloud/apihub/v1/common_fields.proto create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/proto/google/cloud/apihub/v1/host_project_registration_service.proto create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/proto/google/cloud/apihub/v1/linting_service.proto create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/proto/google/cloud/apihub/v1/plugin_service.proto create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/proto/google/cloud/apihub/v1/provisioning_service.proto create mode 100644 java-apihub/proto-google-cloud-apihub-v1/src/main/proto/google/cloud/apihub/v1/runtime_project_attachment_service.proto create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/create/SyncCreateSetCredentialsProvider1.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/create/SyncCreateSetEndpoint.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createapi/AsyncCreateApi.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createapi/SyncCreateApi.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createapi/SyncCreateApiLocationnameApiString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createapi/SyncCreateApiStringApiString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createattribute/AsyncCreateAttribute.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createattribute/SyncCreateAttribute.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createattribute/SyncCreateAttributeLocationnameAttributeString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createattribute/SyncCreateAttributeStringAttributeString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createdeployment/AsyncCreateDeployment.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createdeployment/SyncCreateDeployment.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createdeployment/SyncCreateDeploymentLocationnameDeploymentString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createdeployment/SyncCreateDeploymentStringDeploymentString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createexternalapi/AsyncCreateExternalApi.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createexternalapi/SyncCreateExternalApi.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createexternalapi/SyncCreateExternalApiLocationnameExternalapiString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createexternalapi/SyncCreateExternalApiStringExternalapiString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createspec/AsyncCreateSpec.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createspec/SyncCreateSpec.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createspec/SyncCreateSpecStringSpecString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createspec/SyncCreateSpecVersionnameSpecString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createversion/AsyncCreateVersion.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createversion/SyncCreateVersion.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createversion/SyncCreateVersionApinameVersionString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createversion/SyncCreateVersionStringVersionString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteapi/AsyncDeleteApi.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteapi/SyncDeleteApi.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteapi/SyncDeleteApiApiname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteapi/SyncDeleteApiString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteattribute/AsyncDeleteAttribute.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteattribute/SyncDeleteAttribute.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteattribute/SyncDeleteAttributeAttributename.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteattribute/SyncDeleteAttributeString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletedeployment/AsyncDeleteDeployment.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletedeployment/SyncDeleteDeployment.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletedeployment/SyncDeleteDeploymentDeploymentname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletedeployment/SyncDeleteDeploymentString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteexternalapi/AsyncDeleteExternalApi.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteexternalapi/SyncDeleteExternalApi.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteexternalapi/SyncDeleteExternalApiExternalapiname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteexternalapi/SyncDeleteExternalApiString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletespec/AsyncDeleteSpec.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletespec/SyncDeleteSpec.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletespec/SyncDeleteSpecSpecname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletespec/SyncDeleteSpecString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteversion/AsyncDeleteVersion.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteversion/SyncDeleteVersion.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteversion/SyncDeleteVersionString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteversion/SyncDeleteVersionVersionname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapi/AsyncGetApi.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapi/SyncGetApi.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapi/SyncGetApiApiname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapi/SyncGetApiString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapioperation/AsyncGetApiOperation.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapioperation/SyncGetApiOperation.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapioperation/SyncGetApiOperationApioperationname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapioperation/SyncGetApiOperationString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getattribute/AsyncGetAttribute.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getattribute/SyncGetAttribute.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getattribute/SyncGetAttributeAttributename.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getattribute/SyncGetAttributeString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdefinition/AsyncGetDefinition.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdefinition/SyncGetDefinition.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdefinition/SyncGetDefinitionDefinitionname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdefinition/SyncGetDefinitionString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdeployment/AsyncGetDeployment.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdeployment/SyncGetDeployment.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdeployment/SyncGetDeploymentDeploymentname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdeployment/SyncGetDeploymentString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getexternalapi/AsyncGetExternalApi.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getexternalapi/SyncGetExternalApi.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getexternalapi/SyncGetExternalApiExternalapiname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getexternalapi/SyncGetExternalApiString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getlocation/AsyncGetLocation.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getlocation/SyncGetLocation.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspec/AsyncGetSpec.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspec/SyncGetSpec.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspec/SyncGetSpecSpecname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspec/SyncGetSpecString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspeccontents/AsyncGetSpecContents.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspeccontents/SyncGetSpecContents.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspeccontents/SyncGetSpecContentsSpecname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspeccontents/SyncGetSpecContentsString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getversion/AsyncGetVersion.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getversion/SyncGetVersion.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getversion/SyncGetVersionString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getversion/SyncGetVersionVersionname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapioperations/AsyncListApiOperations.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapioperations/AsyncListApiOperationsPaged.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapioperations/SyncListApiOperations.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapioperations/SyncListApiOperationsString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapioperations/SyncListApiOperationsVersionname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapis/AsyncListApis.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapis/AsyncListApisPaged.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapis/SyncListApis.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapis/SyncListApisLocationname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapis/SyncListApisString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listattributes/AsyncListAttributes.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listattributes/AsyncListAttributesPaged.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listattributes/SyncListAttributes.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listattributes/SyncListAttributesLocationname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listattributes/SyncListAttributesString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listdeployments/AsyncListDeployments.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listdeployments/AsyncListDeploymentsPaged.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listdeployments/SyncListDeployments.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listdeployments/SyncListDeploymentsLocationname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listdeployments/SyncListDeploymentsString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listexternalapis/AsyncListExternalApis.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listexternalapis/AsyncListExternalApisPaged.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listexternalapis/SyncListExternalApis.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listexternalapis/SyncListExternalApisLocationname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listexternalapis/SyncListExternalApisString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listlocations/AsyncListLocations.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listlocations/AsyncListLocationsPaged.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listlocations/SyncListLocations.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listspecs/AsyncListSpecs.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listspecs/AsyncListSpecsPaged.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listspecs/SyncListSpecs.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listspecs/SyncListSpecsString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listspecs/SyncListSpecsVersionname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listversions/AsyncListVersions.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listversions/AsyncListVersionsPaged.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listversions/SyncListVersions.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listversions/SyncListVersionsApiname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listversions/SyncListVersionsString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/searchresources/AsyncSearchResources.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/searchresources/AsyncSearchResourcesPaged.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/searchresources/SyncSearchResources.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/searchresources/SyncSearchResourcesLocationnameString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/searchresources/SyncSearchResourcesStringString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateapi/AsyncUpdateApi.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateapi/SyncUpdateApi.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateapi/SyncUpdateApiApiFieldmask.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateattribute/AsyncUpdateAttribute.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateattribute/SyncUpdateAttribute.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateattribute/SyncUpdateAttributeAttributeFieldmask.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updatedeployment/AsyncUpdateDeployment.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updatedeployment/SyncUpdateDeployment.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updatedeployment/SyncUpdateDeploymentDeploymentFieldmask.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateexternalapi/AsyncUpdateExternalApi.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateexternalapi/SyncUpdateExternalApi.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateexternalapi/SyncUpdateExternalApiExternalapiFieldmask.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updatespec/AsyncUpdateSpec.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updatespec/SyncUpdateSpec.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updatespec/SyncUpdateSpecSpecFieldmask.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateversion/AsyncUpdateVersion.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateversion/SyncUpdateVersion.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateversion/SyncUpdateVersionVersionFieldmask.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/create/SyncCreateSetCredentialsProvider1.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/create/SyncCreateSetEndpoint.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/createdependency/AsyncCreateDependency.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/createdependency/SyncCreateDependency.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/createdependency/SyncCreateDependencyLocationnameDependencyString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/createdependency/SyncCreateDependencyStringDependencyString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/deletedependency/AsyncDeleteDependency.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/deletedependency/SyncDeleteDependency.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/deletedependency/SyncDeleteDependencyDependencyname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/deletedependency/SyncDeleteDependencyString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/getdependency/AsyncGetDependency.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/getdependency/SyncGetDependency.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/getdependency/SyncGetDependencyDependencyname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/getdependency/SyncGetDependencyString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/getlocation/AsyncGetLocation.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/getlocation/SyncGetLocation.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listdependencies/AsyncListDependencies.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listdependencies/AsyncListDependenciesPaged.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listdependencies/SyncListDependencies.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listdependencies/SyncListDependenciesLocationname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listdependencies/SyncListDependenciesString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listlocations/AsyncListLocations.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listlocations/AsyncListLocationsPaged.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listlocations/SyncListLocations.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/updatedependency/AsyncUpdateDependency.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/updatedependency/SyncUpdateDependency.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/updatedependency/SyncUpdateDependencyDependencyFieldmask.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependenciessettings/createdependency/SyncCreateDependency.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/create/SyncCreateSetCredentialsProvider1.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/create/SyncCreateSetEndpoint.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/disableplugin/AsyncDisablePlugin.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/disableplugin/SyncDisablePlugin.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/disableplugin/SyncDisablePluginPluginname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/disableplugin/SyncDisablePluginString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/enableplugin/AsyncEnablePlugin.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/enableplugin/SyncEnablePlugin.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/enableplugin/SyncEnablePluginPluginname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/enableplugin/SyncEnablePluginString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/getlocation/AsyncGetLocation.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/getlocation/SyncGetLocation.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/getplugin/AsyncGetPlugin.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/getplugin/SyncGetPlugin.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/getplugin/SyncGetPluginPluginname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/getplugin/SyncGetPluginString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/listlocations/AsyncListLocations.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/listlocations/AsyncListLocationsPaged.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/listlocations/SyncListLocations.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubpluginsettings/getplugin/SyncGetPlugin.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubsettings/createapi/SyncCreateApi.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/create/SyncCreateSetCredentialsProvider1.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/create/SyncCreateSetEndpoint.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/createhostprojectregistration/AsyncCreateHostProjectRegistration.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/createhostprojectregistration/SyncCreateHostProjectRegistration.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/createhostprojectregistration/SyncCreateHostProjectRegistrationLocationnameHostprojectregistrationString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/createhostprojectregistration/SyncCreateHostProjectRegistrationStringHostprojectregistrationString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/gethostprojectregistration/AsyncGetHostProjectRegistration.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/gethostprojectregistration/SyncGetHostProjectRegistration.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/gethostprojectregistration/SyncGetHostProjectRegistrationHostprojectregistrationname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/gethostprojectregistration/SyncGetHostProjectRegistrationString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/getlocation/AsyncGetLocation.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/getlocation/SyncGetLocation.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listhostprojectregistrations/AsyncListHostProjectRegistrations.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listhostprojectregistrations/AsyncListHostProjectRegistrationsPaged.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listhostprojectregistrations/SyncListHostProjectRegistrations.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listhostprojectregistrations/SyncListHostProjectRegistrationsLocationname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listhostprojectregistrations/SyncListHostProjectRegistrationsString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listlocations/AsyncListLocations.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listlocations/AsyncListLocationsPaged.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listlocations/SyncListLocations.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservicesettings/createhostprojectregistration/SyncCreateHostProjectRegistration.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/create/SyncCreateSetCredentialsProvider1.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/create/SyncCreateSetEndpoint.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getlocation/AsyncGetLocation.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getlocation/SyncGetLocation.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguide/AsyncGetStyleGuide.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguide/SyncGetStyleGuide.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguide/SyncGetStyleGuideString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguide/SyncGetStyleGuideStyleguidename.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguidecontents/AsyncGetStyleGuideContents.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguidecontents/SyncGetStyleGuideContents.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguidecontents/SyncGetStyleGuideContentsString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguidecontents/SyncGetStyleGuideContentsStyleguidename.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/lintspec/AsyncLintSpec.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/lintspec/SyncLintSpec.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/listlocations/AsyncListLocations.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/listlocations/AsyncListLocationsPaged.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/listlocations/SyncListLocations.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/updatestyleguide/AsyncUpdateStyleGuide.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/updatestyleguide/SyncUpdateStyleGuide.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/updatestyleguide/SyncUpdateStyleGuideStyleguideFieldmask.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservicesettings/getstyleguide/SyncGetStyleGuide.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/create/SyncCreateSetCredentialsProvider1.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/create/SyncCreateSetEndpoint.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/createapihubinstance/AsyncCreateApiHubInstance.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/createapihubinstance/AsyncCreateApiHubInstanceLRO.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/createapihubinstance/SyncCreateApiHubInstance.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/createapihubinstance/SyncCreateApiHubInstanceLocationnameApihubinstanceString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/createapihubinstance/SyncCreateApiHubInstanceStringApihubinstanceString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/getapihubinstance/AsyncGetApiHubInstance.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/getapihubinstance/SyncGetApiHubInstance.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/getapihubinstance/SyncGetApiHubInstanceApihubinstancename.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/getapihubinstance/SyncGetApiHubInstanceString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/getlocation/AsyncGetLocation.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/getlocation/SyncGetLocation.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/listlocations/AsyncListLocations.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/listlocations/AsyncListLocationsPaged.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/listlocations/SyncListLocations.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/lookupapihubinstance/AsyncLookupApiHubInstance.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/lookupapihubinstance/SyncLookupApiHubInstance.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/lookupapihubinstance/SyncLookupApiHubInstanceLocationname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/lookupapihubinstance/SyncLookupApiHubInstanceString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioningsettings/getapihubinstance/SyncGetApiHubInstance.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/create/SyncCreateSetCredentialsProvider1.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/create/SyncCreateSetEndpoint.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/createruntimeprojectattachment/AsyncCreateRuntimeProjectAttachment.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/createruntimeprojectattachment/SyncCreateRuntimeProjectAttachment.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/createruntimeprojectattachment/SyncCreateRuntimeProjectAttachmentLocationnameRuntimeprojectattachmentString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/createruntimeprojectattachment/SyncCreateRuntimeProjectAttachmentStringRuntimeprojectattachmentString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/deleteruntimeprojectattachment/AsyncDeleteRuntimeProjectAttachment.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/deleteruntimeprojectattachment/SyncDeleteRuntimeProjectAttachment.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/deleteruntimeprojectattachment/SyncDeleteRuntimeProjectAttachmentRuntimeprojectattachmentname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/deleteruntimeprojectattachment/SyncDeleteRuntimeProjectAttachmentString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/getlocation/AsyncGetLocation.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/getlocation/SyncGetLocation.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/getruntimeprojectattachment/AsyncGetRuntimeProjectAttachment.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/getruntimeprojectattachment/SyncGetRuntimeProjectAttachment.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/getruntimeprojectattachment/SyncGetRuntimeProjectAttachmentRuntimeprojectattachmentname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/getruntimeprojectattachment/SyncGetRuntimeProjectAttachmentString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listlocations/AsyncListLocations.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listlocations/AsyncListLocationsPaged.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listlocations/SyncListLocations.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listruntimeprojectattachments/AsyncListRuntimeProjectAttachments.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listruntimeprojectattachments/AsyncListRuntimeProjectAttachmentsPaged.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listruntimeprojectattachments/SyncListRuntimeProjectAttachments.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listruntimeprojectattachments/SyncListRuntimeProjectAttachmentsLocationname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listruntimeprojectattachments/SyncListRuntimeProjectAttachmentsString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/lookupruntimeprojectattachment/AsyncLookupRuntimeProjectAttachment.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/lookupruntimeprojectattachment/SyncLookupRuntimeProjectAttachment.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/lookupruntimeprojectattachment/SyncLookupRuntimeProjectAttachmentLocationname.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/lookupruntimeprojectattachment/SyncLookupRuntimeProjectAttachmentString.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservicesettings/createruntimeprojectattachment/SyncCreateRuntimeProjectAttachment.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/stub/apihubdependenciesstubsettings/createdependency/SyncCreateDependency.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/stub/apihubpluginstubsettings/getplugin/SyncGetPlugin.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/stub/apihubstubsettings/createapi/SyncCreateApi.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/stub/hostprojectregistrationservicestubsettings/createhostprojectregistration/SyncCreateHostProjectRegistration.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/stub/lintingservicestubsettings/getstyleguide/SyncGetStyleGuide.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/stub/provisioningstubsettings/getapihubinstance/SyncGetApiHubInstance.java create mode 100644 java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/stub/runtimeprojectattachmentservicestubsettings/createruntimeprojectattachment/SyncCreateRuntimeProjectAttachment.java diff --git a/gapic-libraries-bom/pom.xml b/gapic-libraries-bom/pom.xml index 62b8b7eda1e3..d35d6f0d7b09 100644 --- a/gapic-libraries-bom/pom.xml +++ b/gapic-libraries-bom/pom.xml @@ -105,6 +105,13 @@ pom import + + com.google.cloud + google-cloud-apihub-bom + 0.0.1-SNAPSHOT + pom + import + com.google.cloud google-cloud-apikeys-bom diff --git a/java-apihub/.OwlBot-hermetic.yaml b/java-apihub/.OwlBot-hermetic.yaml new file mode 100644 index 000000000000..6f67c7f6724a --- /dev/null +++ b/java-apihub/.OwlBot-hermetic.yaml @@ -0,0 +1,35 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.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. + + +deep-remove-regex: +- "/java-apihub/grpc-google-.*/src" +- "/java-apihub/proto-google-.*/src" +- "/java-apihub/google-.*/src" +- "/java-apihub/samples/snippets/generated" + +deep-preserve-regex: +- "/java-apihub/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/cloud/apihub/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-apihub/$1/proto-google-cloud-apihub-$1/src" +- source: "/google/cloud/apihub/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-apihub/$1/grpc-google-cloud-apihub-$1/src" +- source: "/google/cloud/apihub/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/java-apihub/$1/google-cloud-apihub/src" +- source: "/google/cloud/apihub/(v.*)/.*-java/samples/snippets/generated" + dest: "/owl-bot-staging/java-apihub/$1/samples/snippets/generated" + +api-name: apihub \ No newline at end of file diff --git a/java-apihub/.repo-metadata.json b/java-apihub/.repo-metadata.json new file mode 100644 index 000000000000..72c79d1c551d --- /dev/null +++ b/java-apihub/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "api_shortname": "apihub", + "name_pretty": "API hub API", + "product_documentation": "https://cloud.google.com/apigee/docs/apihub/what-is-api-hub", + "api_description": "API hub lets you consolidate and organize information about all of the APIs of interest to your organization. API hub lets you capture critical information about APIs that allows developers to discover and evaluate them easily and leverage the work of other teams wherever possible. API platform teams can use API hub to have visibility into and manage their portfolio of APIs.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-apihub/latest/overview", + "release_level": "preview", + "transport": "both", + "language": "java", + "repo": "googleapis/google-cloud-java", + "repo_short": "java-apihub", + "distribution_name": "com.google.cloud:google-cloud-apihub", + "api_id": "apihub.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true +} \ No newline at end of file diff --git a/java-apihub/README.md b/java-apihub/README.md new file mode 100644 index 000000000000..bc9573c1f5dd --- /dev/null +++ b/java-apihub/README.md @@ -0,0 +1,225 @@ +# Google API hub API Client for Java + +Java idiomatic client for [API hub API][product-docs]. + +[![Maven][maven-version-image]][maven-version-link] +![Stability][stability-image] + +- [Product Documentation][product-docs] +- [Client Library Documentation][javadocs] + +> Note: This client is a work-in-progress, and may occasionally +> make backwards-incompatible changes. + + +## Quickstart + + +If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: + +```xml + + + + com.google.cloud + libraries-bom + 26.44.0 + pom + import + + + + + + + com.google.cloud + google-cloud-apihub + +``` + +If you are using Maven without the BOM, add this to your dependencies: + + + +```xml + + com.google.cloud + google-cloud-apihub + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.cloud:google-cloud-apihub:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-apihub" % "0.0.0" +``` + + +## Authentication + +See the [Authentication][authentication] section in the base directory's README. + +## Authorization + +The client application making API calls must be granted [authorization scopes][auth-scopes] required for the desired API hub API APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the API hub API API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the API hub API [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google API hub API. +[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by +[installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: +`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +### Installation and setup + +You'll need to obtain the `google-cloud-apihub` library. See the [Quickstart](#quickstart) section +to add `google-cloud-apihub` as a dependency in your code. + +## About API hub API + + +[API hub API][product-docs] API hub lets you consolidate and organize information about all of the APIs of interest to your organization. API hub lets you capture critical information about APIs that allows developers to discover and evaluate them easily and leverage the work of other teams wherever possible. API platform teams can use API hub to have visibility into and manage their portfolio of APIs. + +See the [API hub API client library docs][javadocs] to learn how to +use this API hub API Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +API hub API uses both gRPC and HTTP/JSON for the transport layer. + +## Supported Java Versions + +Java 8 or above is required for using this client. + +Google's Java client libraries, +[Google Cloud Client Libraries][cloudlibs] +and +[Google Cloud API Libraries][apilibs], +follow the +[Oracle Java SE support roadmap][oracle] +(see the Oracle Java SE Product Releases section). + +### For new development + +In general, new feature development occurs with support for the lowest Java +LTS version covered by Oracle's Premier Support (which typically lasts 5 years +from initial General Availability). If the minimum required JVM for a given +library is changed, it is accompanied by a [semver][semver] major release. + +Java 11 and (in September 2021) Java 17 are the best choices for new +development. + +### Keeping production systems current + +Google tests its client libraries with all current LTS versions covered by +Oracle's Extended Support (which typically lasts 8 years from initial +General Availability). + +#### Legacy support + +Google's client libraries support legacy versions of Java runtimes with long +term stable libraries that don't receive feature updates on a best efforts basis +as it may not be possible to backport all patches. + +Google provides updates on a best efforts basis to apps that continue to use +Java 7, though apps might need to upgrade to current versions of the library +that supports their JVM. + +#### Where to find specific information + +The latest versions and the supported Java versions are identified on +the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` +and on [google-cloud-java][g-c-j]. + +## Versioning + + +This library follows [Semantic Versioning](http://semver.org/). + + +It is currently in major version zero (``0.y.z``), which means that anything may change at any time +and the public API should not be considered stable. + + +## Contributing + + +Contributions to this library are always welcome and highly encouraged. + +See [CONTRIBUTING][contributing] for more information how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in +this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more +information. + + +## License + +Apache 2.0 - See [LICENSE][license] for more information. + +## CI Status + +Java Version | Status +------------ | ------ +Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] +Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] +Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] +Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] + +Java is a registered trademark of Oracle and/or its affiliates. + +[product-docs]: https://cloud.google.com/apigee/docs/apihub/what-is-api-hub +[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-apihub/latest/overview +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html +[stability-image]: https://img.shields.io/badge/stability-preview-yellow +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-apihub.svg +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-apihub/0.0.0 +[authentication]: https://github.com/googleapis/google-cloud-java#authentication +[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes +[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles +[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy +[developer-console]: https://console.developers.google.com/ +[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects +[cloud-cli]: https://cloud.google.com/cli +[troubleshooting]: https://github.com/googleapis/google-cloud-java/blob/main/TROUBLESHOOTING.md +[contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing +[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=apihub.googleapis.com +[libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png + +[semver]: https://semver.org/ +[cloudlibs]: https://cloud.google.com/apis/docs/client-libraries-explained +[apilibs]: https://cloud.google.com/apis/docs/client-libraries-explained#google_api_client_libraries +[oracle]: https://www.oracle.com/java/technologies/java-se-support-roadmap.html +[g-c-j]: http://github.com/googleapis/google-cloud-java diff --git a/java-apihub/google-cloud-apihub-bom/pom.xml b/java-apihub/google-cloud-apihub-bom/pom.xml new file mode 100644 index 000000000000..822353826159 --- /dev/null +++ b/java-apihub/google-cloud-apihub-bom/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + com.google.cloud + google-cloud-apihub-bom + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-pom-parent + 1.42.0-SNAPSHOT + ../../google-cloud-pom-parent/pom.xml + + + Google API hub API BOM + + BOM for API hub API + + + + true + + + + + + com.google.cloud + google-cloud-apihub + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-apihub-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-apihub-v1 + 0.0.1-SNAPSHOT + + + + diff --git a/java-apihub/google-cloud-apihub/pom.xml b/java-apihub/google-cloud-apihub/pom.xml new file mode 100644 index 000000000000..0ad9d489427e --- /dev/null +++ b/java-apihub/google-cloud-apihub/pom.xml @@ -0,0 +1,113 @@ + + + 4.0.0 + com.google.cloud + google-cloud-apihub + 0.0.1-SNAPSHOT + jar + Google API hub API + API hub API API hub lets you consolidate and organize information about all of the APIs of interest to your organization. API hub lets you capture critical information about APIs that allows developers to discover and evaluate them easily and leverage the work of other teams wherever possible. API platform teams can use API hub to have visibility into and manage their portfolio of APIs. + + com.google.cloud + google-cloud-apihub-parent + 0.0.1-SNAPSHOT + + + google-cloud-apihub + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.api + api-common + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + + com.google.api.grpc + proto-google-cloud-apihub-v1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + com.google.api + gax-httpjson + + + com.google.api.grpc + grpc-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api.grpc + grpc-google-iam-v1 + + + org.threeten + threetenbp + + + + + junit + junit + test + + + + com.google.api.grpc + grpc-google-cloud-apihub-v1 + test + + + + com.google.api + gax + testlib + test + + + com.google.api + gax-grpc + testlib + test + + + com.google.api + gax-httpjson + testlib + test + + + diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ApiHubClient.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ApiHubClient.java new file mode 100644 index 000000000000..1af5d3bd11d1 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ApiHubClient.java @@ -0,0 +1,6637 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +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.cloud.apihub.v1.stub.ApiHubStub; +import com.google.cloud.apihub.v1.stub.ApiHubStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +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: This service provides all methods related to the API hub. + * + *

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
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   Api api = Api.newBuilder().build();
+ *   String apiId = "apiId93021397";
+ *   Api response = apiHubClient.createApi(parent, api, apiId);
+ * }
+ * }
+ * + *

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

CreateApi

Create an API resource in the API hub. Once an API resource is created, versions can be added to it.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createApi(CreateApiRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • createApi(LocationName parent, Api api, String apiId) + *

  • createApi(String parent, Api api, String apiId) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createApiCallable() + *

+ *

GetApi

Get API resource details including the API versions contained in it.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getApi(GetApiRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getApi(ApiName name) + *

  • getApi(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getApiCallable() + *

+ *

ListApis

List API resources in the API hub.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listApis(ListApisRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listApis(LocationName parent) + *

  • listApis(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listApisPagedCallable() + *

  • listApisCallable() + *

+ *

UpdateApi

Update an API resource in the API hub. The following fields in the [API][] can be updated: + *

    + *
  • [display_name][google.cloud.apihub.v1.Api.display_name] + *
  • [description][google.cloud.apihub.v1.Api.description] + *
  • [owner][google.cloud.apihub.v1.Api.owner] + *
  • [documentation][google.cloud.apihub.v1.Api.documentation] + *
  • [target_user][google.cloud.apihub.v1.Api.target_user] + *
  • [team][google.cloud.apihub.v1.Api.team] + *
  • [business_unit][google.cloud.apihub.v1.Api.business_unit] + *
  • [maturity_level][google.cloud.apihub.v1.Api.maturity_level] + *
  • [attributes][google.cloud.apihub.v1.Api.attributes] + *
+ *

The [update_mask][google.cloud.apihub.v1.UpdateApiRequest.update_mask] should be used to specify the fields being updated. + *

Updating the owner field requires complete owner message and updates both owner and email fields.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateApi(UpdateApiRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • updateApi(Api api, FieldMask updateMask) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateApiCallable() + *

+ *

DeleteApi

Delete an API resource in the API hub. API can only be deleted if all underlying versions are deleted.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteApi(DeleteApiRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteApi(ApiName name) + *

  • deleteApi(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteApiCallable() + *

+ *

CreateVersion

Create an API version for an API resource in the API hub.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createVersion(CreateVersionRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • createVersion(ApiName parent, Version version, String versionId) + *

  • createVersion(String parent, Version version, String versionId) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createVersionCallable() + *

+ *

GetVersion

Get details about the API version of an API resource. This will include information about the specs and operations present in the API version as well as the deployments linked to it.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getVersion(GetVersionRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getVersion(VersionName name) + *

  • getVersion(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getVersionCallable() + *

+ *

ListVersions

List API versions of an API resource in the API hub.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listVersions(ListVersionsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listVersions(ApiName parent) + *

  • listVersions(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listVersionsPagedCallable() + *

  • listVersionsCallable() + *

+ *

UpdateVersion

Update API version. The following fields in the [version][google.cloud.apihub.v1.Version] can be updated currently: + *

    + *
  • [display_name][google.cloud.apihub.v1.Version.display_name] + *
  • [description][google.cloud.apihub.v1.Version.description] + *
  • [documentation][google.cloud.apihub.v1.Version.documentation] + *
  • [deployments][google.cloud.apihub.v1.Version.deployments] + *
  • [lifecycle][google.cloud.apihub.v1.Version.lifecycle] + *
  • [compliance][google.cloud.apihub.v1.Version.compliance] + *
  • [accreditation][google.cloud.apihub.v1.Version.accreditation] + *
  • [attributes][google.cloud.apihub.v1.Version.attributes] + *
+ *

The [update_mask][google.cloud.apihub.v1.UpdateVersionRequest.update_mask] should be used to specify the fields being updated.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateVersion(UpdateVersionRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • updateVersion(Version version, FieldMask updateMask) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateVersionCallable() + *

+ *

DeleteVersion

Delete an API version. Version can only be deleted if all underlying specs, operations, definitions and linked deployments are deleted.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteVersion(DeleteVersionRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteVersion(VersionName name) + *

  • deleteVersion(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteVersionCallable() + *

+ *

CreateSpec

Add a spec to an API version in the API hub. Multiple specs can be added to an API version. Note, while adding a spec, at least one of `contents` or `source_uri` must be provided. If `contents` is provided, then `spec_type` must also be provided. + *

On adding a spec with contents to the version, the operations present in it will be added to the version.Note that the file contents in the spec should be of the same type as defined in the `projects/{project}/locations/{location}/attributes/system-spec-type` attribute associated with spec resource. Note that specs of various types can be uploaded, however parsing of details is supported for OpenAPI spec currently. + *

In order to access the information parsed from the spec, use the [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method. In order to access the raw contents for a particular spec, use the [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method. In order to access the operations parsed from the spec, use the [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] method.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createSpec(CreateSpecRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • createSpec(VersionName parent, Spec spec, String specId) + *

  • createSpec(String parent, Spec spec, String specId) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createSpecCallable() + *

+ *

GetSpec

Get details about the information parsed from a spec. Note that this method does not return the raw spec contents. Use [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method to retrieve the same.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getSpec(GetSpecRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getSpec(SpecName name) + *

  • getSpec(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getSpecCallable() + *

+ *

GetSpecContents

Get spec contents.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getSpecContents(GetSpecContentsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getSpecContents(SpecName name) + *

  • getSpecContents(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getSpecContentsCallable() + *

+ *

ListSpecs

List specs corresponding to a particular API resource.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listSpecs(ListSpecsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listSpecs(VersionName parent) + *

  • listSpecs(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listSpecsPagedCallable() + *

  • listSpecsCallable() + *

+ *

UpdateSpec

Update spec. The following fields in the [spec][google.cloud.apihub.v1.Spec] can be updated: + *

    + *
  • [display_name][google.cloud.apihub.v1.Spec.display_name] + *
  • [source_uri][google.cloud.apihub.v1.Spec.source_uri] + *
  • [lint_response][google.cloud.apihub.v1.Spec.lint_response] + *
  • [attributes][google.cloud.apihub.v1.Spec.attributes] + *
  • [contents][google.cloud.apihub.v1.Spec.contents] + *
  • [spec_type][google.cloud.apihub.v1.Spec.spec_type] + *
+ *

In case of an OAS spec, updating spec contents can lead to: 1. Creation, deletion and update of operations. 2. Creation, deletion and update of definitions. 3. Update of other info parsed out from the new spec. + *

In case of contents or source_uri being present in update mask, spec_type must also be present. Also, spec_type can not be present in update mask if contents or source_uri is not present. + *

The [update_mask][google.cloud.apihub.v1.UpdateSpecRequest.update_mask] should be used to specify the fields being updated.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateSpec(UpdateSpecRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • updateSpec(Spec spec, FieldMask updateMask) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateSpecCallable() + *

+ *

DeleteSpec

Delete a spec. Deleting a spec will also delete the associated operations from the version.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteSpec(DeleteSpecRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteSpec(SpecName name) + *

  • deleteSpec(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteSpecCallable() + *

+ *

GetApiOperation

Get details about a particular operation in API version.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getApiOperation(GetApiOperationRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getApiOperation(ApiOperationName name) + *

  • getApiOperation(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getApiOperationCallable() + *

+ *

ListApiOperations

List operations in an API version.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listApiOperations(ListApiOperationsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listApiOperations(VersionName parent) + *

  • listApiOperations(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listApiOperationsPagedCallable() + *

  • listApiOperationsCallable() + *

+ *

GetDefinition

Get details about a definition in an API version.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getDefinition(GetDefinitionRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getDefinition(DefinitionName name) + *

  • getDefinition(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getDefinitionCallable() + *

+ *

CreateDeployment

Create a deployment resource in the API hub. Once a deployment resource is created, it can be associated with API versions.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createDeployment(CreateDeploymentRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • createDeployment(LocationName parent, Deployment deployment, String deploymentId) + *

  • createDeployment(String parent, Deployment deployment, String deploymentId) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createDeploymentCallable() + *

+ *

GetDeployment

Get details about a deployment and the API versions linked to it.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getDeployment(GetDeploymentRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getDeployment(DeploymentName name) + *

  • getDeployment(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getDeploymentCallable() + *

+ *

ListDeployments

List deployment resources in the API hub.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listDeployments(ListDeploymentsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listDeployments(LocationName parent) + *

  • listDeployments(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listDeploymentsPagedCallable() + *

  • listDeploymentsCallable() + *

+ *

UpdateDeployment

Update a deployment resource in the API hub. The following fields in the [deployment resource][google.cloud.apihub.v1.Deployment] can be updated: + *

    + *
  • [display_name][google.cloud.apihub.v1.Deployment.display_name] + *
  • [description][google.cloud.apihub.v1.Deployment.description] + *
  • [documentation][google.cloud.apihub.v1.Deployment.documentation] + *
  • [deployment_type][google.cloud.apihub.v1.Deployment.deployment_type] + *
  • [resource_uri][google.cloud.apihub.v1.Deployment.resource_uri] + *
  • [endpoints][google.cloud.apihub.v1.Deployment.endpoints] + *
  • [slo][google.cloud.apihub.v1.Deployment.slo] + *
  • [environment][google.cloud.apihub.v1.Deployment.environment] + *
  • [attributes][google.cloud.apihub.v1.Deployment.attributes] + *
+ *

The [update_mask][google.cloud.apihub.v1.UpdateDeploymentRequest.update_mask] should be used to specify the fields being updated.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateDeployment(UpdateDeploymentRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • updateDeployment(Deployment deployment, FieldMask updateMask) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateDeploymentCallable() + *

+ *

DeleteDeployment

Delete a deployment resource in the API hub.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteDeployment(DeleteDeploymentRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteDeployment(DeploymentName name) + *

  • deleteDeployment(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteDeploymentCallable() + *

+ *

CreateAttribute

Create a user defined attribute. + *

Certain pre defined attributes are already created by the API hub. These attributes will have type as `SYSTEM_DEFINED` and can be listed via [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method. Allowed values for the same can be updated via [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] method.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createAttribute(CreateAttributeRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • createAttribute(LocationName parent, Attribute attribute, String attributeId) + *

  • createAttribute(String parent, Attribute attribute, String attributeId) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createAttributeCallable() + *

+ *

GetAttribute

Get details about the attribute.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getAttribute(GetAttributeRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getAttribute(AttributeName name) + *

  • getAttribute(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getAttributeCallable() + *

+ *

UpdateAttribute

Update the attribute. The following fields in the [Attribute resource][google.cloud.apihub.v1.Attribute] can be updated: + *

    + *
  • [display_name][google.cloud.apihub.v1.Attribute.display_name] The display name can be updated for user defined attributes only. + *
  • [description][google.cloud.apihub.v1.Attribute.description] The description can be updated for user defined attributes only. + *
  • [allowed_values][google.cloud.apihub.v1.Attribute.allowed_values] To update the list of allowed values, clients need to use the fetched list of allowed values and add or remove values to or from the same list. The mutable allowed values can be updated for both user defined and System defined attributes. The immutable allowed values cannot be updated or deleted. The updated list of allowed values cannot be empty. If an allowed value that is already used by some resource's attribute is deleted, then the association between the resource and the attribute value will also be deleted. + *
  • [cardinality][google.cloud.apihub.v1.Attribute.cardinality] The cardinality can be updated for user defined attributes only. Cardinality can only be increased during an update. + *
+ *

The [update_mask][google.cloud.apihub.v1.UpdateAttributeRequest.update_mask] should be used to specify the fields being updated.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateAttribute(UpdateAttributeRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • updateAttribute(Attribute attribute, FieldMask updateMask) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateAttributeCallable() + *

+ *

DeleteAttribute

Delete an attribute. + *

Note: System defined attributes cannot be deleted. All associations of the attribute being deleted with any API hub resource will also get deleted.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteAttribute(DeleteAttributeRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteAttribute(AttributeName name) + *

  • deleteAttribute(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteAttributeCallable() + *

+ *

ListAttributes

List all attributes.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listAttributes(ListAttributesRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listAttributes(LocationName parent) + *

  • listAttributes(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listAttributesPagedCallable() + *

  • listAttributesCallable() + *

+ *

SearchResources

Search across API-Hub resources.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • searchResources(SearchResourcesRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • searchResources(LocationName location, String query) + *

  • searchResources(String location, String query) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • searchResourcesPagedCallable() + *

  • searchResourcesCallable() + *

+ *

CreateExternalApi

Create an External API resource in the API hub.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createExternalApi(CreateExternalApiRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • createExternalApi(LocationName parent, ExternalApi externalApi, String externalApiId) + *

  • createExternalApi(String parent, ExternalApi externalApi, String externalApiId) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createExternalApiCallable() + *

+ *

GetExternalApi

Get details about an External API resource in the API hub.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getExternalApi(GetExternalApiRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getExternalApi(ExternalApiName name) + *

  • getExternalApi(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getExternalApiCallable() + *

+ *

UpdateExternalApi

Update an External API resource in the API hub. The following fields can be updated: + *

    + *
  • [display_name][google.cloud.apihub.v1.ExternalApi.display_name] + *
  • [description][google.cloud.apihub.v1.ExternalApi.description] + *
  • [documentation][google.cloud.apihub.v1.ExternalApi.documentation] + *
  • [endpoints][google.cloud.apihub.v1.ExternalApi.endpoints] + *
  • [paths][google.cloud.apihub.v1.ExternalApi.paths] + *
+ *

The [update_mask][google.cloud.apihub.v1.UpdateExternalApiRequest.update_mask] should be used to specify the fields being updated.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateExternalApi(UpdateExternalApiRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • updateExternalApi(ExternalApi externalApi, FieldMask updateMask) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateExternalApiCallable() + *

+ *

DeleteExternalApi

Delete an External API resource in the API hub.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteExternalApi(DeleteExternalApiRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteExternalApi(ExternalApiName name) + *

  • deleteExternalApi(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteExternalApiCallable() + *

+ *

ListExternalApis

List External API resources in the API hub.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listExternalApis(ListExternalApisRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listExternalApis(LocationName parent) + *

  • listExternalApis(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listExternalApisPagedCallable() + *

  • listExternalApisCallable() + *

+ *

ListLocations

Lists information about the supported locations for this service.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listLocations(ListLocationsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listLocationsPagedCallable() + *

  • listLocationsCallable() + *

+ *

GetLocation

Gets information about a location.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getLocation(GetLocationRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getLocationCallable() + *

+ *
+ * + *

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 ApiHubSettings to create(). + * For example: + * + *

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ApiHubSettings apiHubSettings =
+ *     ApiHubSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ApiHubClient apiHubClient = ApiHubClient.create(apiHubSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ApiHubSettings apiHubSettings = ApiHubSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ApiHubClient apiHubClient = ApiHubClient.create(apiHubSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ApiHubSettings apiHubSettings = ApiHubSettings.newHttpJsonBuilder().build();
+ * ApiHubClient apiHubClient = ApiHubClient.create(apiHubSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class ApiHubClient implements BackgroundResource { + private final ApiHubSettings settings; + private final ApiHubStub stub; + + /** Constructs an instance of ApiHubClient with default settings. */ + public static final ApiHubClient create() throws IOException { + return create(ApiHubSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ApiHubClient, 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 ApiHubClient create(ApiHubSettings settings) throws IOException { + return new ApiHubClient(settings); + } + + /** + * Constructs an instance of ApiHubClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(ApiHubSettings). + */ + public static final ApiHubClient create(ApiHubStub stub) { + return new ApiHubClient(stub); + } + + /** + * Constructs an instance of ApiHubClient, 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 ApiHubClient(ApiHubSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ApiHubStubSettings) settings.getStubSettings()).createStub(); + } + + protected ApiHubClient(ApiHubStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ApiHubSettings getSettings() { + return settings; + } + + public ApiHubStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an API resource in the API hub. Once an API resource is created, versions can be added + * to it. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Api api = Api.newBuilder().build();
+   *   String apiId = "apiId93021397";
+   *   Api response = apiHubClient.createApi(parent, api, apiId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource for the API resource. Format: + * `projects/{project}/locations/{location}` + * @param api Required. The API resource to create. + * @param apiId Optional. The ID to use for the API resource, which will become the final + * component of the API's resource name. This field is optional. + *
    + *
  • If provided, the same will be used. The service will throw an error if the specified + * id is already used by another API resource in the API hub. + *
  • If not provided, a system generated id will be used. + *
+ *

This value should be 4-500 characters, and valid characters are /[a-z][A-Z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Api createApi(LocationName parent, Api api, String apiId) { + CreateApiRequest request = + CreateApiRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setApi(api) + .setApiId(apiId) + .build(); + return createApi(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an API resource in the API hub. Once an API resource is created, versions can be added + * to it. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Api api = Api.newBuilder().build();
+   *   String apiId = "apiId93021397";
+   *   Api response = apiHubClient.createApi(parent, api, apiId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource for the API resource. Format: + * `projects/{project}/locations/{location}` + * @param api Required. The API resource to create. + * @param apiId Optional. The ID to use for the API resource, which will become the final + * component of the API's resource name. This field is optional. + *
    + *
  • If provided, the same will be used. The service will throw an error if the specified + * id is already used by another API resource in the API hub. + *
  • If not provided, a system generated id will be used. + *
+ *

This value should be 4-500 characters, and valid characters are /[a-z][A-Z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Api createApi(String parent, Api api, String apiId) { + CreateApiRequest request = + CreateApiRequest.newBuilder().setParent(parent).setApi(api).setApiId(apiId).build(); + return createApi(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an API resource in the API hub. Once an API resource is created, versions can be added + * to it. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   CreateApiRequest request =
+   *       CreateApiRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setApiId("apiId93021397")
+   *           .setApi(Api.newBuilder().build())
+   *           .build();
+   *   Api response = apiHubClient.createApi(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 Api createApi(CreateApiRequest request) { + return createApiCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an API resource in the API hub. Once an API resource is created, versions can be added + * to it. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   CreateApiRequest request =
+   *       CreateApiRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setApiId("apiId93021397")
+   *           .setApi(Api.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = apiHubClient.createApiCallable().futureCall(request);
+   *   // Do something.
+   *   Api response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createApiCallable() { + return stub.createApiCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get API resource details including the API versions contained in it. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ApiName name = ApiName.of("[PROJECT]", "[LOCATION]", "[API]");
+   *   Api response = apiHubClient.getApi(name);
+   * }
+   * }
+ * + * @param name Required. The name of the API resource to retrieve. Format: + * `projects/{project}/locations/{location}/apis/{api}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Api getApi(ApiName name) { + GetApiRequest request = + GetApiRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getApi(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get API resource details including the API versions contained in it. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String name = ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString();
+   *   Api response = apiHubClient.getApi(name);
+   * }
+   * }
+ * + * @param name Required. The name of the API resource to retrieve. Format: + * `projects/{project}/locations/{location}/apis/{api}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Api getApi(String name) { + GetApiRequest request = GetApiRequest.newBuilder().setName(name).build(); + return getApi(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get API resource details including the API versions contained in it. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   GetApiRequest request =
+   *       GetApiRequest.newBuilder()
+   *           .setName(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString())
+   *           .build();
+   *   Api response = apiHubClient.getApi(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 Api getApi(GetApiRequest request) { + return getApiCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get API resource details including the API versions contained in it. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   GetApiRequest request =
+   *       GetApiRequest.newBuilder()
+   *           .setName(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString())
+   *           .build();
+   *   ApiFuture future = apiHubClient.getApiCallable().futureCall(request);
+   *   // Do something.
+   *   Api response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getApiCallable() { + return stub.getApiCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List API resources in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Api element : apiHubClient.listApis(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of API resources. Format: + * `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListApisPagedResponse listApis(LocationName parent) { + ListApisRequest request = + ListApisRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listApis(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List API resources in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Api element : apiHubClient.listApis(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of API resources. Format: + * `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListApisPagedResponse listApis(String parent) { + ListApisRequest request = ListApisRequest.newBuilder().setParent(parent).build(); + return listApis(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List API resources in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ListApisRequest request =
+   *       ListApisRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Api element : apiHubClient.listApis(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 ListApisPagedResponse listApis(ListApisRequest request) { + return listApisPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List API resources in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ListApisRequest request =
+   *       ListApisRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = apiHubClient.listApisPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Api element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listApisPagedCallable() { + return stub.listApisPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List API resources in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ListApisRequest request =
+   *       ListApisRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListApisResponse response = apiHubClient.listApisCallable().call(request);
+   *     for (Api element : response.getApisList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listApisCallable() { + return stub.listApisCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update an API resource in the API hub. The following fields in the [API][] can be updated: + * + *
    + *
  • [display_name][google.cloud.apihub.v1.Api.display_name] + *
  • [description][google.cloud.apihub.v1.Api.description] + *
  • [owner][google.cloud.apihub.v1.Api.owner] + *
  • [documentation][google.cloud.apihub.v1.Api.documentation] + *
  • [target_user][google.cloud.apihub.v1.Api.target_user] + *
  • [team][google.cloud.apihub.v1.Api.team] + *
  • [business_unit][google.cloud.apihub.v1.Api.business_unit] + *
  • [maturity_level][google.cloud.apihub.v1.Api.maturity_level] + *
  • [attributes][google.cloud.apihub.v1.Api.attributes] + *
+ * + *

The [update_mask][google.cloud.apihub.v1.UpdateApiRequest.update_mask] should be used to + * specify the fields being updated. + * + *

Updating the owner field requires complete owner message and updates both owner and email + * fields. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   Api api = Api.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Api response = apiHubClient.updateApi(api, updateMask);
+   * }
+   * }
+ * + * @param api Required. The API resource to update. + *

The API resource's `name` field is used to identify the API resource to update. Format: + * `projects/{project}/locations/{location}/apis/{api}` + * @param updateMask Required. The list of fields to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Api updateApi(Api api, FieldMask updateMask) { + UpdateApiRequest request = + UpdateApiRequest.newBuilder().setApi(api).setUpdateMask(updateMask).build(); + return updateApi(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update an API resource in the API hub. The following fields in the [API][] can be updated: + * + *

    + *
  • [display_name][google.cloud.apihub.v1.Api.display_name] + *
  • [description][google.cloud.apihub.v1.Api.description] + *
  • [owner][google.cloud.apihub.v1.Api.owner] + *
  • [documentation][google.cloud.apihub.v1.Api.documentation] + *
  • [target_user][google.cloud.apihub.v1.Api.target_user] + *
  • [team][google.cloud.apihub.v1.Api.team] + *
  • [business_unit][google.cloud.apihub.v1.Api.business_unit] + *
  • [maturity_level][google.cloud.apihub.v1.Api.maturity_level] + *
  • [attributes][google.cloud.apihub.v1.Api.attributes] + *
+ * + *

The [update_mask][google.cloud.apihub.v1.UpdateApiRequest.update_mask] should be used to + * specify the fields being updated. + * + *

Updating the owner field requires complete owner message and updates both owner and email + * fields. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   UpdateApiRequest request =
+   *       UpdateApiRequest.newBuilder()
+   *           .setApi(Api.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Api response = apiHubClient.updateApi(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 Api updateApi(UpdateApiRequest request) { + return updateApiCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update an API resource in the API hub. The following fields in the [API][] can be updated: + * + *
    + *
  • [display_name][google.cloud.apihub.v1.Api.display_name] + *
  • [description][google.cloud.apihub.v1.Api.description] + *
  • [owner][google.cloud.apihub.v1.Api.owner] + *
  • [documentation][google.cloud.apihub.v1.Api.documentation] + *
  • [target_user][google.cloud.apihub.v1.Api.target_user] + *
  • [team][google.cloud.apihub.v1.Api.team] + *
  • [business_unit][google.cloud.apihub.v1.Api.business_unit] + *
  • [maturity_level][google.cloud.apihub.v1.Api.maturity_level] + *
  • [attributes][google.cloud.apihub.v1.Api.attributes] + *
+ * + *

The [update_mask][google.cloud.apihub.v1.UpdateApiRequest.update_mask] should be used to + * specify the fields being updated. + * + *

Updating the owner field requires complete owner message and updates both owner and email + * fields. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   UpdateApiRequest request =
+   *       UpdateApiRequest.newBuilder()
+   *           .setApi(Api.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = apiHubClient.updateApiCallable().futureCall(request);
+   *   // Do something.
+   *   Api response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateApiCallable() { + return stub.updateApiCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an API resource in the API hub. API can only be deleted if all underlying versions are + * deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ApiName name = ApiName.of("[PROJECT]", "[LOCATION]", "[API]");
+   *   apiHubClient.deleteApi(name);
+   * }
+   * }
+ * + * @param name Required. The name of the API resource to delete. Format: + * `projects/{project}/locations/{location}/apis/{api}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteApi(ApiName name) { + DeleteApiRequest request = + DeleteApiRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteApi(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an API resource in the API hub. API can only be deleted if all underlying versions are + * deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String name = ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString();
+   *   apiHubClient.deleteApi(name);
+   * }
+   * }
+ * + * @param name Required. The name of the API resource to delete. Format: + * `projects/{project}/locations/{location}/apis/{api}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteApi(String name) { + DeleteApiRequest request = DeleteApiRequest.newBuilder().setName(name).build(); + deleteApi(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an API resource in the API hub. API can only be deleted if all underlying versions are + * deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   DeleteApiRequest request =
+   *       DeleteApiRequest.newBuilder()
+   *           .setName(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString())
+   *           .setForce(true)
+   *           .build();
+   *   apiHubClient.deleteApi(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 void deleteApi(DeleteApiRequest request) { + deleteApiCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an API resource in the API hub. API can only be deleted if all underlying versions are + * deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   DeleteApiRequest request =
+   *       DeleteApiRequest.newBuilder()
+   *           .setName(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString())
+   *           .setForce(true)
+   *           .build();
+   *   ApiFuture future = apiHubClient.deleteApiCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteApiCallable() { + return stub.deleteApiCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an API version for an API resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ApiName parent = ApiName.of("[PROJECT]", "[LOCATION]", "[API]");
+   *   Version version = Version.newBuilder().build();
+   *   String versionId = "versionId-1407102957";
+   *   Version response = apiHubClient.createVersion(parent, version, versionId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource for API version. Format: + * `projects/{project}/locations/{location}/apis/{api}` + * @param version Required. The version to create. + * @param versionId Optional. The ID to use for the API version, which will become the final + * component of the version's resource name. This field is optional. + *
    + *
  • If provided, the same will be used. The service will throw an error if the specified + * id is already used by another version in the API resource. + *
  • If not provided, a system generated id will be used. + *
+ *

This value should be 4-500 characters, and valid characters are /[a-z][A-Z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Version createVersion(ApiName parent, Version version, String versionId) { + CreateVersionRequest request = + CreateVersionRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setVersion(version) + .setVersionId(versionId) + .build(); + return createVersion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an API version for an API resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String parent = ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString();
+   *   Version version = Version.newBuilder().build();
+   *   String versionId = "versionId-1407102957";
+   *   Version response = apiHubClient.createVersion(parent, version, versionId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource for API version. Format: + * `projects/{project}/locations/{location}/apis/{api}` + * @param version Required. The version to create. + * @param versionId Optional. The ID to use for the API version, which will become the final + * component of the version's resource name. This field is optional. + *
    + *
  • If provided, the same will be used. The service will throw an error if the specified + * id is already used by another version in the API resource. + *
  • If not provided, a system generated id will be used. + *
+ *

This value should be 4-500 characters, and valid characters are /[a-z][A-Z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Version createVersion(String parent, Version version, String versionId) { + CreateVersionRequest request = + CreateVersionRequest.newBuilder() + .setParent(parent) + .setVersion(version) + .setVersionId(versionId) + .build(); + return createVersion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an API version for an API resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   CreateVersionRequest request =
+   *       CreateVersionRequest.newBuilder()
+   *           .setParent(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString())
+   *           .setVersionId("versionId-1407102957")
+   *           .setVersion(Version.newBuilder().build())
+   *           .build();
+   *   Version response = apiHubClient.createVersion(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 Version createVersion(CreateVersionRequest request) { + return createVersionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an API version for an API resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   CreateVersionRequest request =
+   *       CreateVersionRequest.newBuilder()
+   *           .setParent(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString())
+   *           .setVersionId("versionId-1407102957")
+   *           .setVersion(Version.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = apiHubClient.createVersionCallable().futureCall(request);
+   *   // Do something.
+   *   Version response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createVersionCallable() { + return stub.createVersionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about the API version of an API resource. This will include information about the + * specs and operations present in the API version as well as the deployments linked to it. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]");
+   *   Version response = apiHubClient.getVersion(name);
+   * }
+   * }
+ * + * @param name Required. The name of the API version to retrieve. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Version getVersion(VersionName name) { + GetVersionRequest request = + GetVersionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getVersion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about the API version of an API resource. This will include information about the + * specs and operations present in the API version as well as the deployments linked to it. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String name = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString();
+   *   Version response = apiHubClient.getVersion(name);
+   * }
+   * }
+ * + * @param name Required. The name of the API version to retrieve. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Version getVersion(String name) { + GetVersionRequest request = GetVersionRequest.newBuilder().setName(name).build(); + return getVersion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about the API version of an API resource. This will include information about the + * specs and operations present in the API version as well as the deployments linked to it. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   GetVersionRequest request =
+   *       GetVersionRequest.newBuilder()
+   *           .setName(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString())
+   *           .build();
+   *   Version response = apiHubClient.getVersion(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 Version getVersion(GetVersionRequest request) { + return getVersionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about the API version of an API resource. This will include information about the + * specs and operations present in the API version as well as the deployments linked to it. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   GetVersionRequest request =
+   *       GetVersionRequest.newBuilder()
+   *           .setName(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString())
+   *           .build();
+   *   ApiFuture future = apiHubClient.getVersionCallable().futureCall(request);
+   *   // Do something.
+   *   Version response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getVersionCallable() { + return stub.getVersionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List API versions of an API resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ApiName parent = ApiName.of("[PROJECT]", "[LOCATION]", "[API]");
+   *   for (Version element : apiHubClient.listVersions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent which owns this collection of API versions i.e., the API + * resource Format: `projects/{project}/locations/{location}/apis/{api}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListVersionsPagedResponse listVersions(ApiName parent) { + ListVersionsRequest request = + ListVersionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listVersions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List API versions of an API resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String parent = ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString();
+   *   for (Version element : apiHubClient.listVersions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent which owns this collection of API versions i.e., the API + * resource Format: `projects/{project}/locations/{location}/apis/{api}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListVersionsPagedResponse listVersions(String parent) { + ListVersionsRequest request = ListVersionsRequest.newBuilder().setParent(parent).build(); + return listVersions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List API versions of an API resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ListVersionsRequest request =
+   *       ListVersionsRequest.newBuilder()
+   *           .setParent(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Version element : apiHubClient.listVersions(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 ListVersionsPagedResponse listVersions(ListVersionsRequest request) { + return listVersionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List API versions of an API resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ListVersionsRequest request =
+   *       ListVersionsRequest.newBuilder()
+   *           .setParent(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = apiHubClient.listVersionsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Version element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listVersionsPagedCallable() { + return stub.listVersionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List API versions of an API resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ListVersionsRequest request =
+   *       ListVersionsRequest.newBuilder()
+   *           .setParent(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListVersionsResponse response = apiHubClient.listVersionsCallable().call(request);
+   *     for (Version element : response.getVersionsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listVersionsCallable() { + return stub.listVersionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update API version. The following fields in the [version][google.cloud.apihub.v1.Version] can + * be updated currently: + * + *
    + *
  • [display_name][google.cloud.apihub.v1.Version.display_name] + *
  • [description][google.cloud.apihub.v1.Version.description] + *
  • [documentation][google.cloud.apihub.v1.Version.documentation] + *
  • [deployments][google.cloud.apihub.v1.Version.deployments] + *
  • [lifecycle][google.cloud.apihub.v1.Version.lifecycle] + *
  • [compliance][google.cloud.apihub.v1.Version.compliance] + *
  • [accreditation][google.cloud.apihub.v1.Version.accreditation] + *
  • [attributes][google.cloud.apihub.v1.Version.attributes] + *
+ * + *

The [update_mask][google.cloud.apihub.v1.UpdateVersionRequest.update_mask] should be used to + * specify the fields being updated. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   Version version = Version.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Version response = apiHubClient.updateVersion(version, updateMask);
+   * }
+   * }
+ * + * @param version Required. The API version to update. + *

The version's `name` field is used to identify the API version to update. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param updateMask Required. The list of fields to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Version updateVersion(Version version, FieldMask updateMask) { + UpdateVersionRequest request = + UpdateVersionRequest.newBuilder().setVersion(version).setUpdateMask(updateMask).build(); + return updateVersion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update API version. The following fields in the [version][google.cloud.apihub.v1.Version] can + * be updated currently: + * + *

    + *
  • [display_name][google.cloud.apihub.v1.Version.display_name] + *
  • [description][google.cloud.apihub.v1.Version.description] + *
  • [documentation][google.cloud.apihub.v1.Version.documentation] + *
  • [deployments][google.cloud.apihub.v1.Version.deployments] + *
  • [lifecycle][google.cloud.apihub.v1.Version.lifecycle] + *
  • [compliance][google.cloud.apihub.v1.Version.compliance] + *
  • [accreditation][google.cloud.apihub.v1.Version.accreditation] + *
  • [attributes][google.cloud.apihub.v1.Version.attributes] + *
+ * + *

The [update_mask][google.cloud.apihub.v1.UpdateVersionRequest.update_mask] should be used to + * specify the fields being updated. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   UpdateVersionRequest request =
+   *       UpdateVersionRequest.newBuilder()
+   *           .setVersion(Version.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Version response = apiHubClient.updateVersion(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 Version updateVersion(UpdateVersionRequest request) { + return updateVersionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update API version. The following fields in the [version][google.cloud.apihub.v1.Version] can + * be updated currently: + * + *
    + *
  • [display_name][google.cloud.apihub.v1.Version.display_name] + *
  • [description][google.cloud.apihub.v1.Version.description] + *
  • [documentation][google.cloud.apihub.v1.Version.documentation] + *
  • [deployments][google.cloud.apihub.v1.Version.deployments] + *
  • [lifecycle][google.cloud.apihub.v1.Version.lifecycle] + *
  • [compliance][google.cloud.apihub.v1.Version.compliance] + *
  • [accreditation][google.cloud.apihub.v1.Version.accreditation] + *
  • [attributes][google.cloud.apihub.v1.Version.attributes] + *
+ * + *

The [update_mask][google.cloud.apihub.v1.UpdateVersionRequest.update_mask] should be used to + * specify the fields being updated. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   UpdateVersionRequest request =
+   *       UpdateVersionRequest.newBuilder()
+   *           .setVersion(Version.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = apiHubClient.updateVersionCallable().futureCall(request);
+   *   // Do something.
+   *   Version response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateVersionCallable() { + return stub.updateVersionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an API version. Version can only be deleted if all underlying specs, operations, + * definitions and linked deployments are deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]");
+   *   apiHubClient.deleteVersion(name);
+   * }
+   * }
+ * + * @param name Required. The name of the version to delete. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteVersion(VersionName name) { + DeleteVersionRequest request = + DeleteVersionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteVersion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an API version. Version can only be deleted if all underlying specs, operations, + * definitions and linked deployments are deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String name = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString();
+   *   apiHubClient.deleteVersion(name);
+   * }
+   * }
+ * + * @param name Required. The name of the version to delete. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteVersion(String name) { + DeleteVersionRequest request = DeleteVersionRequest.newBuilder().setName(name).build(); + deleteVersion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an API version. Version can only be deleted if all underlying specs, operations, + * definitions and linked deployments are deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   DeleteVersionRequest request =
+   *       DeleteVersionRequest.newBuilder()
+   *           .setName(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString())
+   *           .setForce(true)
+   *           .build();
+   *   apiHubClient.deleteVersion(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 void deleteVersion(DeleteVersionRequest request) { + deleteVersionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an API version. Version can only be deleted if all underlying specs, operations, + * definitions and linked deployments are deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   DeleteVersionRequest request =
+   *       DeleteVersionRequest.newBuilder()
+   *           .setName(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString())
+   *           .setForce(true)
+   *           .build();
+   *   ApiFuture future = apiHubClient.deleteVersionCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteVersionCallable() { + return stub.deleteVersionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Add a spec to an API version in the API hub. Multiple specs can be added to an API version. + * Note, while adding a spec, at least one of `contents` or `source_uri` must be provided. If + * `contents` is provided, then `spec_type` must also be provided. + * + *

On adding a spec with contents to the version, the operations present in it will be added to + * the version.Note that the file contents in the spec should be of the same type as defined in + * the `projects/{project}/locations/{location}/attributes/system-spec-type` attribute associated + * with spec resource. Note that specs of various types can be uploaded, however parsing of + * details is supported for OpenAPI spec currently. + * + *

In order to access the information parsed from the spec, use the + * [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method. In order to access the raw contents + * for a particular spec, use the [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] + * method. In order to access the operations parsed from the spec, use the + * [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] method. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   VersionName parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]");
+   *   Spec spec = Spec.newBuilder().build();
+   *   String specId = "specId-896074186";
+   *   Spec response = apiHubClient.createSpec(parent, spec, specId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource for Spec. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param spec Required. The spec to create. + * @param specId Optional. The ID to use for the spec, which will become the final component of + * the spec's resource name. This field is optional. + *
    + *
  • If provided, the same will be used. The service will throw an error if the specified + * id is already used by another spec in the API resource. + *
  • If not provided, a system generated id will be used. + *
+ *

This value should be 4-500 characters, and valid characters are /[a-z][A-Z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Spec createSpec(VersionName parent, Spec spec, String specId) { + CreateSpecRequest request = + CreateSpecRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setSpec(spec) + .setSpecId(specId) + .build(); + return createSpec(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Add a spec to an API version in the API hub. Multiple specs can be added to an API version. + * Note, while adding a spec, at least one of `contents` or `source_uri` must be provided. If + * `contents` is provided, then `spec_type` must also be provided. + * + *

On adding a spec with contents to the version, the operations present in it will be added to + * the version.Note that the file contents in the spec should be of the same type as defined in + * the `projects/{project}/locations/{location}/attributes/system-spec-type` attribute associated + * with spec resource. Note that specs of various types can be uploaded, however parsing of + * details is supported for OpenAPI spec currently. + * + *

In order to access the information parsed from the spec, use the + * [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method. In order to access the raw contents + * for a particular spec, use the [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] + * method. In order to access the operations parsed from the spec, use the + * [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] method. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString();
+   *   Spec spec = Spec.newBuilder().build();
+   *   String specId = "specId-896074186";
+   *   Spec response = apiHubClient.createSpec(parent, spec, specId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource for Spec. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param spec Required. The spec to create. + * @param specId Optional. The ID to use for the spec, which will become the final component of + * the spec's resource name. This field is optional. + *
    + *
  • If provided, the same will be used. The service will throw an error if the specified + * id is already used by another spec in the API resource. + *
  • If not provided, a system generated id will be used. + *
+ *

This value should be 4-500 characters, and valid characters are /[a-z][A-Z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Spec createSpec(String parent, Spec spec, String specId) { + CreateSpecRequest request = + CreateSpecRequest.newBuilder().setParent(parent).setSpec(spec).setSpecId(specId).build(); + return createSpec(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Add a spec to an API version in the API hub. Multiple specs can be added to an API version. + * Note, while adding a spec, at least one of `contents` or `source_uri` must be provided. If + * `contents` is provided, then `spec_type` must also be provided. + * + *

On adding a spec with contents to the version, the operations present in it will be added to + * the version.Note that the file contents in the spec should be of the same type as defined in + * the `projects/{project}/locations/{location}/attributes/system-spec-type` attribute associated + * with spec resource. Note that specs of various types can be uploaded, however parsing of + * details is supported for OpenAPI spec currently. + * + *

In order to access the information parsed from the spec, use the + * [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method. In order to access the raw contents + * for a particular spec, use the [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] + * method. In order to access the operations parsed from the spec, use the + * [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] method. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   CreateSpecRequest request =
+   *       CreateSpecRequest.newBuilder()
+   *           .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString())
+   *           .setSpecId("specId-896074186")
+   *           .setSpec(Spec.newBuilder().build())
+   *           .build();
+   *   Spec response = apiHubClient.createSpec(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 Spec createSpec(CreateSpecRequest request) { + return createSpecCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Add a spec to an API version in the API hub. Multiple specs can be added to an API version. + * Note, while adding a spec, at least one of `contents` or `source_uri` must be provided. If + * `contents` is provided, then `spec_type` must also be provided. + * + *

On adding a spec with contents to the version, the operations present in it will be added to + * the version.Note that the file contents in the spec should be of the same type as defined in + * the `projects/{project}/locations/{location}/attributes/system-spec-type` attribute associated + * with spec resource. Note that specs of various types can be uploaded, however parsing of + * details is supported for OpenAPI spec currently. + * + *

In order to access the information parsed from the spec, use the + * [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method. In order to access the raw contents + * for a particular spec, use the [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] + * method. In order to access the operations parsed from the spec, use the + * [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] method. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   CreateSpecRequest request =
+   *       CreateSpecRequest.newBuilder()
+   *           .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString())
+   *           .setSpecId("specId-896074186")
+   *           .setSpec(Spec.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = apiHubClient.createSpecCallable().futureCall(request);
+   *   // Do something.
+   *   Spec response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createSpecCallable() { + return stub.createSpecCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about the information parsed from a spec. Note that this method does not return the + * raw spec contents. Use [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method + * to retrieve the same. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   SpecName name = SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]");
+   *   Spec response = apiHubClient.getSpec(name);
+   * }
+   * }
+ * + * @param name Required. The name of the spec to retrieve. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Spec getSpec(SpecName name) { + GetSpecRequest request = + GetSpecRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getSpec(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about the information parsed from a spec. Note that this method does not return the + * raw spec contents. Use [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method + * to retrieve the same. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String name =
+   *       SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString();
+   *   Spec response = apiHubClient.getSpec(name);
+   * }
+   * }
+ * + * @param name Required. The name of the spec to retrieve. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Spec getSpec(String name) { + GetSpecRequest request = GetSpecRequest.newBuilder().setName(name).build(); + return getSpec(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about the information parsed from a spec. Note that this method does not return the + * raw spec contents. Use [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method + * to retrieve the same. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   GetSpecRequest request =
+   *       GetSpecRequest.newBuilder()
+   *           .setName(
+   *               SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString())
+   *           .build();
+   *   Spec response = apiHubClient.getSpec(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 Spec getSpec(GetSpecRequest request) { + return getSpecCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about the information parsed from a spec. Note that this method does not return the + * raw spec contents. Use [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method + * to retrieve the same. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   GetSpecRequest request =
+   *       GetSpecRequest.newBuilder()
+   *           .setName(
+   *               SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString())
+   *           .build();
+   *   ApiFuture future = apiHubClient.getSpecCallable().futureCall(request);
+   *   // Do something.
+   *   Spec response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getSpecCallable() { + return stub.getSpecCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get spec contents. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   SpecName name = SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]");
+   *   SpecContents response = apiHubClient.getSpecContents(name);
+   * }
+   * }
+ * + * @param name Required. The name of the spec whose contents need to be retrieved. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SpecContents getSpecContents(SpecName name) { + GetSpecContentsRequest request = + GetSpecContentsRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getSpecContents(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get spec contents. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String name =
+   *       SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString();
+   *   SpecContents response = apiHubClient.getSpecContents(name);
+   * }
+   * }
+ * + * @param name Required. The name of the spec whose contents need to be retrieved. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SpecContents getSpecContents(String name) { + GetSpecContentsRequest request = GetSpecContentsRequest.newBuilder().setName(name).build(); + return getSpecContents(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get spec contents. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   GetSpecContentsRequest request =
+   *       GetSpecContentsRequest.newBuilder()
+   *           .setName(
+   *               SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString())
+   *           .build();
+   *   SpecContents response = apiHubClient.getSpecContents(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 SpecContents getSpecContents(GetSpecContentsRequest request) { + return getSpecContentsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get spec contents. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   GetSpecContentsRequest request =
+   *       GetSpecContentsRequest.newBuilder()
+   *           .setName(
+   *               SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString())
+   *           .build();
+   *   ApiFuture future = apiHubClient.getSpecContentsCallable().futureCall(request);
+   *   // Do something.
+   *   SpecContents response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getSpecContentsCallable() { + return stub.getSpecContentsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List specs corresponding to a particular API resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   VersionName parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]");
+   *   for (Spec element : apiHubClient.listSpecs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of specs. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSpecsPagedResponse listSpecs(VersionName parent) { + ListSpecsRequest request = + ListSpecsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listSpecs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List specs corresponding to a particular API resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString();
+   *   for (Spec element : apiHubClient.listSpecs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of specs. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSpecsPagedResponse listSpecs(String parent) { + ListSpecsRequest request = ListSpecsRequest.newBuilder().setParent(parent).build(); + return listSpecs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List specs corresponding to a particular API resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ListSpecsRequest request =
+   *       ListSpecsRequest.newBuilder()
+   *           .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Spec element : apiHubClient.listSpecs(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 ListSpecsPagedResponse listSpecs(ListSpecsRequest request) { + return listSpecsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List specs corresponding to a particular API resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ListSpecsRequest request =
+   *       ListSpecsRequest.newBuilder()
+   *           .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = apiHubClient.listSpecsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Spec element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listSpecsPagedCallable() { + return stub.listSpecsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List specs corresponding to a particular API resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ListSpecsRequest request =
+   *       ListSpecsRequest.newBuilder()
+   *           .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListSpecsResponse response = apiHubClient.listSpecsCallable().call(request);
+   *     for (Spec element : response.getSpecsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listSpecsCallable() { + return stub.listSpecsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update spec. The following fields in the [spec][google.cloud.apihub.v1.Spec] can be updated: + * + *
    + *
  • [display_name][google.cloud.apihub.v1.Spec.display_name] + *
  • [source_uri][google.cloud.apihub.v1.Spec.source_uri] + *
  • [lint_response][google.cloud.apihub.v1.Spec.lint_response] + *
  • [attributes][google.cloud.apihub.v1.Spec.attributes] + *
  • [contents][google.cloud.apihub.v1.Spec.contents] + *
  • [spec_type][google.cloud.apihub.v1.Spec.spec_type] + *
+ * + *

In case of an OAS spec, updating spec contents can lead to: 1. Creation, deletion and update + * of operations. 2. Creation, deletion and update of definitions. 3. Update of other info parsed + * out from the new spec. + * + *

In case of contents or source_uri being present in update mask, spec_type must also be + * present. Also, spec_type can not be present in update mask if contents or source_uri is not + * present. + * + *

The [update_mask][google.cloud.apihub.v1.UpdateSpecRequest.update_mask] should be used to + * specify the fields being updated. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   Spec spec = Spec.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Spec response = apiHubClient.updateSpec(spec, updateMask);
+   * }
+   * }
+ * + * @param spec Required. The spec to update. + *

The spec's `name` field is used to identify the spec to update. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @param updateMask Required. The list of fields to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Spec updateSpec(Spec spec, FieldMask updateMask) { + UpdateSpecRequest request = + UpdateSpecRequest.newBuilder().setSpec(spec).setUpdateMask(updateMask).build(); + return updateSpec(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update spec. The following fields in the [spec][google.cloud.apihub.v1.Spec] can be updated: + * + *

    + *
  • [display_name][google.cloud.apihub.v1.Spec.display_name] + *
  • [source_uri][google.cloud.apihub.v1.Spec.source_uri] + *
  • [lint_response][google.cloud.apihub.v1.Spec.lint_response] + *
  • [attributes][google.cloud.apihub.v1.Spec.attributes] + *
  • [contents][google.cloud.apihub.v1.Spec.contents] + *
  • [spec_type][google.cloud.apihub.v1.Spec.spec_type] + *
+ * + *

In case of an OAS spec, updating spec contents can lead to: 1. Creation, deletion and update + * of operations. 2. Creation, deletion and update of definitions. 3. Update of other info parsed + * out from the new spec. + * + *

In case of contents or source_uri being present in update mask, spec_type must also be + * present. Also, spec_type can not be present in update mask if contents or source_uri is not + * present. + * + *

The [update_mask][google.cloud.apihub.v1.UpdateSpecRequest.update_mask] should be used to + * specify the fields being updated. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   UpdateSpecRequest request =
+   *       UpdateSpecRequest.newBuilder()
+   *           .setSpec(Spec.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Spec response = apiHubClient.updateSpec(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 Spec updateSpec(UpdateSpecRequest request) { + return updateSpecCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update spec. The following fields in the [spec][google.cloud.apihub.v1.Spec] can be updated: + * + *
    + *
  • [display_name][google.cloud.apihub.v1.Spec.display_name] + *
  • [source_uri][google.cloud.apihub.v1.Spec.source_uri] + *
  • [lint_response][google.cloud.apihub.v1.Spec.lint_response] + *
  • [attributes][google.cloud.apihub.v1.Spec.attributes] + *
  • [contents][google.cloud.apihub.v1.Spec.contents] + *
  • [spec_type][google.cloud.apihub.v1.Spec.spec_type] + *
+ * + *

In case of an OAS spec, updating spec contents can lead to: 1. Creation, deletion and update + * of operations. 2. Creation, deletion and update of definitions. 3. Update of other info parsed + * out from the new spec. + * + *

In case of contents or source_uri being present in update mask, spec_type must also be + * present. Also, spec_type can not be present in update mask if contents or source_uri is not + * present. + * + *

The [update_mask][google.cloud.apihub.v1.UpdateSpecRequest.update_mask] should be used to + * specify the fields being updated. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   UpdateSpecRequest request =
+   *       UpdateSpecRequest.newBuilder()
+   *           .setSpec(Spec.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = apiHubClient.updateSpecCallable().futureCall(request);
+   *   // Do something.
+   *   Spec response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateSpecCallable() { + return stub.updateSpecCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a spec. Deleting a spec will also delete the associated operations from the version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   SpecName name = SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]");
+   *   apiHubClient.deleteSpec(name);
+   * }
+   * }
+ * + * @param name Required. The name of the spec to delete. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteSpec(SpecName name) { + DeleteSpecRequest request = + DeleteSpecRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteSpec(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a spec. Deleting a spec will also delete the associated operations from the version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String name =
+   *       SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString();
+   *   apiHubClient.deleteSpec(name);
+   * }
+   * }
+ * + * @param name Required. The name of the spec to delete. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteSpec(String name) { + DeleteSpecRequest request = DeleteSpecRequest.newBuilder().setName(name).build(); + deleteSpec(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a spec. Deleting a spec will also delete the associated operations from the version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   DeleteSpecRequest request =
+   *       DeleteSpecRequest.newBuilder()
+   *           .setName(
+   *               SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString())
+   *           .build();
+   *   apiHubClient.deleteSpec(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 void deleteSpec(DeleteSpecRequest request) { + deleteSpecCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a spec. Deleting a spec will also delete the associated operations from the version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   DeleteSpecRequest request =
+   *       DeleteSpecRequest.newBuilder()
+   *           .setName(
+   *               SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString())
+   *           .build();
+   *   ApiFuture future = apiHubClient.deleteSpecCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteSpecCallable() { + return stub.deleteSpecCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about a particular operation in API version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ApiOperationName name =
+   *       ApiOperationName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[OPERATION]");
+   *   ApiOperation response = apiHubClient.getApiOperation(name);
+   * }
+   * }
+ * + * @param name Required. The name of the operation to retrieve. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ApiOperation getApiOperation(ApiOperationName name) { + GetApiOperationRequest request = + GetApiOperationRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getApiOperation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about a particular operation in API version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String name =
+   *       ApiOperationName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[OPERATION]")
+   *           .toString();
+   *   ApiOperation response = apiHubClient.getApiOperation(name);
+   * }
+   * }
+ * + * @param name Required. The name of the operation to retrieve. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ApiOperation getApiOperation(String name) { + GetApiOperationRequest request = GetApiOperationRequest.newBuilder().setName(name).build(); + return getApiOperation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about a particular operation in API version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   GetApiOperationRequest request =
+   *       GetApiOperationRequest.newBuilder()
+   *           .setName(
+   *               ApiOperationName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[OPERATION]")
+   *                   .toString())
+   *           .build();
+   *   ApiOperation response = apiHubClient.getApiOperation(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 ApiOperation getApiOperation(GetApiOperationRequest request) { + return getApiOperationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about a particular operation in API version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   GetApiOperationRequest request =
+   *       GetApiOperationRequest.newBuilder()
+   *           .setName(
+   *               ApiOperationName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[OPERATION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future = apiHubClient.getApiOperationCallable().futureCall(request);
+   *   // Do something.
+   *   ApiOperation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getApiOperationCallable() { + return stub.getApiOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List operations in an API version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   VersionName parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]");
+   *   for (ApiOperation element : apiHubClient.listApiOperations(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent which owns this collection of operations i.e., the API + * version. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListApiOperationsPagedResponse listApiOperations(VersionName parent) { + ListApiOperationsRequest request = + ListApiOperationsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listApiOperations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List operations in an API version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString();
+   *   for (ApiOperation element : apiHubClient.listApiOperations(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent which owns this collection of operations i.e., the API + * version. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListApiOperationsPagedResponse listApiOperations(String parent) { + ListApiOperationsRequest request = + ListApiOperationsRequest.newBuilder().setParent(parent).build(); + return listApiOperations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List operations in an API version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ListApiOperationsRequest request =
+   *       ListApiOperationsRequest.newBuilder()
+   *           .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (ApiOperation element : apiHubClient.listApiOperations(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 ListApiOperationsPagedResponse listApiOperations(ListApiOperationsRequest request) { + return listApiOperationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List operations in an API version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ListApiOperationsRequest request =
+   *       ListApiOperationsRequest.newBuilder()
+   *           .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       apiHubClient.listApiOperationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (ApiOperation element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listApiOperationsPagedCallable() { + return stub.listApiOperationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List operations in an API version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ListApiOperationsRequest request =
+   *       ListApiOperationsRequest.newBuilder()
+   *           .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListApiOperationsResponse response = apiHubClient.listApiOperationsCallable().call(request);
+   *     for (ApiOperation element : response.getApiOperationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listApiOperationsCallable() { + return stub.listApiOperationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about a definition in an API version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   DefinitionName name =
+   *       DefinitionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[DEFINITION]");
+   *   Definition response = apiHubClient.getDefinition(name);
+   * }
+   * }
+ * + * @param name Required. The name of the definition to retrieve. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Definition getDefinition(DefinitionName name) { + GetDefinitionRequest request = + GetDefinitionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getDefinition(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about a definition in an API version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String name =
+   *       DefinitionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[DEFINITION]")
+   *           .toString();
+   *   Definition response = apiHubClient.getDefinition(name);
+   * }
+   * }
+ * + * @param name Required. The name of the definition to retrieve. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Definition getDefinition(String name) { + GetDefinitionRequest request = GetDefinitionRequest.newBuilder().setName(name).build(); + return getDefinition(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about a definition in an API version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   GetDefinitionRequest request =
+   *       GetDefinitionRequest.newBuilder()
+   *           .setName(
+   *               DefinitionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[DEFINITION]")
+   *                   .toString())
+   *           .build();
+   *   Definition response = apiHubClient.getDefinition(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 Definition getDefinition(GetDefinitionRequest request) { + return getDefinitionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about a definition in an API version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   GetDefinitionRequest request =
+   *       GetDefinitionRequest.newBuilder()
+   *           .setName(
+   *               DefinitionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[DEFINITION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future = apiHubClient.getDefinitionCallable().futureCall(request);
+   *   // Do something.
+   *   Definition response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getDefinitionCallable() { + return stub.getDefinitionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a deployment resource in the API hub. Once a deployment resource is created, it can be + * associated with API versions. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Deployment deployment = Deployment.newBuilder().build();
+   *   String deploymentId = "deploymentId-136894784";
+   *   Deployment response = apiHubClient.createDeployment(parent, deployment, deploymentId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource for the deployment resource. Format: + * `projects/{project}/locations/{location}` + * @param deployment Required. The deployment resource to create. + * @param deploymentId Optional. The ID to use for the deployment resource, which will become the + * final component of the deployment's resource name. This field is optional. + *
    + *
  • If provided, the same will be used. The service will throw an error if the specified + * id is already used by another deployment resource in the API hub. + *
  • If not provided, a system generated id will be used. + *
+ *

This value should be 4-500 characters, and valid characters are /[a-z][A-Z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Deployment createDeployment( + LocationName parent, Deployment deployment, String deploymentId) { + CreateDeploymentRequest request = + CreateDeploymentRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setDeployment(deployment) + .setDeploymentId(deploymentId) + .build(); + return createDeployment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a deployment resource in the API hub. Once a deployment resource is created, it can be + * associated with API versions. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Deployment deployment = Deployment.newBuilder().build();
+   *   String deploymentId = "deploymentId-136894784";
+   *   Deployment response = apiHubClient.createDeployment(parent, deployment, deploymentId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource for the deployment resource. Format: + * `projects/{project}/locations/{location}` + * @param deployment Required. The deployment resource to create. + * @param deploymentId Optional. The ID to use for the deployment resource, which will become the + * final component of the deployment's resource name. This field is optional. + *
    + *
  • If provided, the same will be used. The service will throw an error if the specified + * id is already used by another deployment resource in the API hub. + *
  • If not provided, a system generated id will be used. + *
+ *

This value should be 4-500 characters, and valid characters are /[a-z][A-Z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Deployment createDeployment( + String parent, Deployment deployment, String deploymentId) { + CreateDeploymentRequest request = + CreateDeploymentRequest.newBuilder() + .setParent(parent) + .setDeployment(deployment) + .setDeploymentId(deploymentId) + .build(); + return createDeployment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a deployment resource in the API hub. Once a deployment resource is created, it can be + * associated with API versions. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   CreateDeploymentRequest request =
+   *       CreateDeploymentRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setDeploymentId("deploymentId-136894784")
+   *           .setDeployment(Deployment.newBuilder().build())
+   *           .build();
+   *   Deployment response = apiHubClient.createDeployment(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 Deployment createDeployment(CreateDeploymentRequest request) { + return createDeploymentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a deployment resource in the API hub. Once a deployment resource is created, it can be + * associated with API versions. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   CreateDeploymentRequest request =
+   *       CreateDeploymentRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setDeploymentId("deploymentId-136894784")
+   *           .setDeployment(Deployment.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = apiHubClient.createDeploymentCallable().futureCall(request);
+   *   // Do something.
+   *   Deployment response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createDeploymentCallable() { + return stub.createDeploymentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about a deployment and the API versions linked to it. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
+   *   Deployment response = apiHubClient.getDeployment(name);
+   * }
+   * }
+ * + * @param name Required. The name of the deployment resource to retrieve. Format: + * `projects/{project}/locations/{location}/deployments/{deployment}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Deployment getDeployment(DeploymentName name) { + GetDeploymentRequest request = + GetDeploymentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getDeployment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about a deployment and the API versions linked to it. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
+   *   Deployment response = apiHubClient.getDeployment(name);
+   * }
+   * }
+ * + * @param name Required. The name of the deployment resource to retrieve. Format: + * `projects/{project}/locations/{location}/deployments/{deployment}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Deployment getDeployment(String name) { + GetDeploymentRequest request = GetDeploymentRequest.newBuilder().setName(name).build(); + return getDeployment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about a deployment and the API versions linked to it. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   GetDeploymentRequest request =
+   *       GetDeploymentRequest.newBuilder()
+   *           .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+   *           .build();
+   *   Deployment response = apiHubClient.getDeployment(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 Deployment getDeployment(GetDeploymentRequest request) { + return getDeploymentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about a deployment and the API versions linked to it. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   GetDeploymentRequest request =
+   *       GetDeploymentRequest.newBuilder()
+   *           .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+   *           .build();
+   *   ApiFuture future = apiHubClient.getDeploymentCallable().futureCall(request);
+   *   // Do something.
+   *   Deployment response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getDeploymentCallable() { + return stub.getDeploymentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List deployment resources in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Deployment element : apiHubClient.listDeployments(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of deployment resources. Format: + * `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDeploymentsPagedResponse listDeployments(LocationName parent) { + ListDeploymentsRequest request = + ListDeploymentsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listDeployments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List deployment resources in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Deployment element : apiHubClient.listDeployments(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of deployment resources. Format: + * `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDeploymentsPagedResponse listDeployments(String parent) { + ListDeploymentsRequest request = ListDeploymentsRequest.newBuilder().setParent(parent).build(); + return listDeployments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List deployment resources in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ListDeploymentsRequest request =
+   *       ListDeploymentsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Deployment element : apiHubClient.listDeployments(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 ListDeploymentsPagedResponse listDeployments(ListDeploymentsRequest request) { + return listDeploymentsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List deployment resources in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ListDeploymentsRequest request =
+   *       ListDeploymentsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       apiHubClient.listDeploymentsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Deployment element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listDeploymentsPagedCallable() { + return stub.listDeploymentsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List deployment resources in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ListDeploymentsRequest request =
+   *       ListDeploymentsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListDeploymentsResponse response = apiHubClient.listDeploymentsCallable().call(request);
+   *     for (Deployment element : response.getDeploymentsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listDeploymentsCallable() { + return stub.listDeploymentsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a deployment resource in the API hub. The following fields in the [deployment + * resource][google.cloud.apihub.v1.Deployment] can be updated: + * + *
    + *
  • [display_name][google.cloud.apihub.v1.Deployment.display_name] + *
  • [description][google.cloud.apihub.v1.Deployment.description] + *
  • [documentation][google.cloud.apihub.v1.Deployment.documentation] + *
  • [deployment_type][google.cloud.apihub.v1.Deployment.deployment_type] + *
  • [resource_uri][google.cloud.apihub.v1.Deployment.resource_uri] + *
  • [endpoints][google.cloud.apihub.v1.Deployment.endpoints] + *
  • [slo][google.cloud.apihub.v1.Deployment.slo] + *
  • [environment][google.cloud.apihub.v1.Deployment.environment] + *
  • [attributes][google.cloud.apihub.v1.Deployment.attributes] + *
+ * + *

The [update_mask][google.cloud.apihub.v1.UpdateDeploymentRequest.update_mask] should be used + * to specify the fields being updated. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   Deployment deployment = Deployment.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Deployment response = apiHubClient.updateDeployment(deployment, updateMask);
+   * }
+   * }
+ * + * @param deployment Required. The deployment resource to update. + *

The deployment resource's `name` field is used to identify the deployment resource to + * update. Format: `projects/{project}/locations/{location}/deployments/{deployment}` + * @param updateMask Required. The list of fields to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Deployment updateDeployment(Deployment deployment, FieldMask updateMask) { + UpdateDeploymentRequest request = + UpdateDeploymentRequest.newBuilder() + .setDeployment(deployment) + .setUpdateMask(updateMask) + .build(); + return updateDeployment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a deployment resource in the API hub. The following fields in the [deployment + * resource][google.cloud.apihub.v1.Deployment] can be updated: + * + *

    + *
  • [display_name][google.cloud.apihub.v1.Deployment.display_name] + *
  • [description][google.cloud.apihub.v1.Deployment.description] + *
  • [documentation][google.cloud.apihub.v1.Deployment.documentation] + *
  • [deployment_type][google.cloud.apihub.v1.Deployment.deployment_type] + *
  • [resource_uri][google.cloud.apihub.v1.Deployment.resource_uri] + *
  • [endpoints][google.cloud.apihub.v1.Deployment.endpoints] + *
  • [slo][google.cloud.apihub.v1.Deployment.slo] + *
  • [environment][google.cloud.apihub.v1.Deployment.environment] + *
  • [attributes][google.cloud.apihub.v1.Deployment.attributes] + *
+ * + *

The [update_mask][google.cloud.apihub.v1.UpdateDeploymentRequest.update_mask] should be used + * to specify the fields being updated. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   UpdateDeploymentRequest request =
+   *       UpdateDeploymentRequest.newBuilder()
+   *           .setDeployment(Deployment.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Deployment response = apiHubClient.updateDeployment(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 Deployment updateDeployment(UpdateDeploymentRequest request) { + return updateDeploymentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a deployment resource in the API hub. The following fields in the [deployment + * resource][google.cloud.apihub.v1.Deployment] can be updated: + * + *
    + *
  • [display_name][google.cloud.apihub.v1.Deployment.display_name] + *
  • [description][google.cloud.apihub.v1.Deployment.description] + *
  • [documentation][google.cloud.apihub.v1.Deployment.documentation] + *
  • [deployment_type][google.cloud.apihub.v1.Deployment.deployment_type] + *
  • [resource_uri][google.cloud.apihub.v1.Deployment.resource_uri] + *
  • [endpoints][google.cloud.apihub.v1.Deployment.endpoints] + *
  • [slo][google.cloud.apihub.v1.Deployment.slo] + *
  • [environment][google.cloud.apihub.v1.Deployment.environment] + *
  • [attributes][google.cloud.apihub.v1.Deployment.attributes] + *
+ * + *

The [update_mask][google.cloud.apihub.v1.UpdateDeploymentRequest.update_mask] should be used + * to specify the fields being updated. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   UpdateDeploymentRequest request =
+   *       UpdateDeploymentRequest.newBuilder()
+   *           .setDeployment(Deployment.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = apiHubClient.updateDeploymentCallable().futureCall(request);
+   *   // Do something.
+   *   Deployment response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateDeploymentCallable() { + return stub.updateDeploymentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a deployment resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
+   *   apiHubClient.deleteDeployment(name);
+   * }
+   * }
+ * + * @param name Required. The name of the deployment resource to delete. Format: + * `projects/{project}/locations/{location}/deployments/{deployment}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteDeployment(DeploymentName name) { + DeleteDeploymentRequest request = + DeleteDeploymentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteDeployment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a deployment resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
+   *   apiHubClient.deleteDeployment(name);
+   * }
+   * }
+ * + * @param name Required. The name of the deployment resource to delete. Format: + * `projects/{project}/locations/{location}/deployments/{deployment}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteDeployment(String name) { + DeleteDeploymentRequest request = DeleteDeploymentRequest.newBuilder().setName(name).build(); + deleteDeployment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a deployment resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   DeleteDeploymentRequest request =
+   *       DeleteDeploymentRequest.newBuilder()
+   *           .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+   *           .build();
+   *   apiHubClient.deleteDeployment(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 void deleteDeployment(DeleteDeploymentRequest request) { + deleteDeploymentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a deployment resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   DeleteDeploymentRequest request =
+   *       DeleteDeploymentRequest.newBuilder()
+   *           .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+   *           .build();
+   *   ApiFuture future = apiHubClient.deleteDeploymentCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteDeploymentCallable() { + return stub.deleteDeploymentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a user defined attribute. + * + *

Certain pre defined attributes are already created by the API hub. These attributes will + * have type as `SYSTEM_DEFINED` and can be listed via + * [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method. Allowed values for the + * same can be updated via [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] + * method. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Attribute attribute = Attribute.newBuilder().build();
+   *   String attributeId = "attributeId-309887785";
+   *   Attribute response = apiHubClient.createAttribute(parent, attribute, attributeId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource for Attribute. Format: + * `projects/{project}/locations/{location}` + * @param attribute Required. The attribute to create. + * @param attributeId Optional. The ID to use for the attribute, which will become the final + * component of the attribute's resource name. This field is optional. + *
    + *
  • If provided, the same will be used. The service will throw an error if the specified + * id is already used by another attribute resource in the API hub. + *
  • If not provided, a system generated id will be used. + *
+ *

This value should be 4-500 characters, and valid characters are /[a-z][A-Z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Attribute createAttribute( + LocationName parent, Attribute attribute, String attributeId) { + CreateAttributeRequest request = + CreateAttributeRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setAttribute(attribute) + .setAttributeId(attributeId) + .build(); + return createAttribute(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a user defined attribute. + * + *

Certain pre defined attributes are already created by the API hub. These attributes will + * have type as `SYSTEM_DEFINED` and can be listed via + * [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method. Allowed values for the + * same can be updated via [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] + * method. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Attribute attribute = Attribute.newBuilder().build();
+   *   String attributeId = "attributeId-309887785";
+   *   Attribute response = apiHubClient.createAttribute(parent, attribute, attributeId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource for Attribute. Format: + * `projects/{project}/locations/{location}` + * @param attribute Required. The attribute to create. + * @param attributeId Optional. The ID to use for the attribute, which will become the final + * component of the attribute's resource name. This field is optional. + *
    + *
  • If provided, the same will be used. The service will throw an error if the specified + * id is already used by another attribute resource in the API hub. + *
  • If not provided, a system generated id will be used. + *
+ *

This value should be 4-500 characters, and valid characters are /[a-z][A-Z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Attribute createAttribute(String parent, Attribute attribute, String attributeId) { + CreateAttributeRequest request = + CreateAttributeRequest.newBuilder() + .setParent(parent) + .setAttribute(attribute) + .setAttributeId(attributeId) + .build(); + return createAttribute(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a user defined attribute. + * + *

Certain pre defined attributes are already created by the API hub. These attributes will + * have type as `SYSTEM_DEFINED` and can be listed via + * [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method. Allowed values for the + * same can be updated via [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] + * method. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   CreateAttributeRequest request =
+   *       CreateAttributeRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setAttributeId("attributeId-309887785")
+   *           .setAttribute(Attribute.newBuilder().build())
+   *           .build();
+   *   Attribute response = apiHubClient.createAttribute(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 Attribute createAttribute(CreateAttributeRequest request) { + return createAttributeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a user defined attribute. + * + *

Certain pre defined attributes are already created by the API hub. These attributes will + * have type as `SYSTEM_DEFINED` and can be listed via + * [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method. Allowed values for the + * same can be updated via [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] + * method. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   CreateAttributeRequest request =
+   *       CreateAttributeRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setAttributeId("attributeId-309887785")
+   *           .setAttribute(Attribute.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = apiHubClient.createAttributeCallable().futureCall(request);
+   *   // Do something.
+   *   Attribute response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createAttributeCallable() { + return stub.createAttributeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about the attribute. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   AttributeName name = AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]");
+   *   Attribute response = apiHubClient.getAttribute(name);
+   * }
+   * }
+ * + * @param name Required. The name of the attribute to retrieve. Format: + * `projects/{project}/locations/{location}/attributes/{attribute}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Attribute getAttribute(AttributeName name) { + GetAttributeRequest request = + GetAttributeRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getAttribute(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about the attribute. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String name = AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString();
+   *   Attribute response = apiHubClient.getAttribute(name);
+   * }
+   * }
+ * + * @param name Required. The name of the attribute to retrieve. Format: + * `projects/{project}/locations/{location}/attributes/{attribute}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Attribute getAttribute(String name) { + GetAttributeRequest request = GetAttributeRequest.newBuilder().setName(name).build(); + return getAttribute(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about the attribute. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   GetAttributeRequest request =
+   *       GetAttributeRequest.newBuilder()
+   *           .setName(AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString())
+   *           .build();
+   *   Attribute response = apiHubClient.getAttribute(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 Attribute getAttribute(GetAttributeRequest request) { + return getAttributeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about the attribute. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   GetAttributeRequest request =
+   *       GetAttributeRequest.newBuilder()
+   *           .setName(AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString())
+   *           .build();
+   *   ApiFuture future = apiHubClient.getAttributeCallable().futureCall(request);
+   *   // Do something.
+   *   Attribute response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getAttributeCallable() { + return stub.getAttributeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update the attribute. The following fields in the [Attribute + * resource][google.cloud.apihub.v1.Attribute] can be updated: + * + *
    + *
  • [display_name][google.cloud.apihub.v1.Attribute.display_name] The display name can be + * updated for user defined attributes only. + *
  • [description][google.cloud.apihub.v1.Attribute.description] The description can be + * updated for user defined attributes only. + *
  • [allowed_values][google.cloud.apihub.v1.Attribute.allowed_values] To update the list of + * allowed values, clients need to use the fetched list of allowed values and add or remove + * values to or from the same list. The mutable allowed values can be updated for both user + * defined and System defined attributes. The immutable allowed values cannot be updated or + * deleted. The updated list of allowed values cannot be empty. If an allowed value that is + * already used by some resource's attribute is deleted, then the association between the + * resource and the attribute value will also be deleted. + *
  • [cardinality][google.cloud.apihub.v1.Attribute.cardinality] The cardinality can be + * updated for user defined attributes only. Cardinality can only be increased during an + * update. + *
+ * + *

The [update_mask][google.cloud.apihub.v1.UpdateAttributeRequest.update_mask] should be used + * to specify the fields being updated. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   Attribute attribute = Attribute.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Attribute response = apiHubClient.updateAttribute(attribute, updateMask);
+   * }
+   * }
+ * + * @param attribute Required. The attribute to update. + *

The attribute's `name` field is used to identify the attribute to update. Format: + * `projects/{project}/locations/{location}/attributes/{attribute}` + * @param updateMask Required. The list of fields to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Attribute updateAttribute(Attribute attribute, FieldMask updateMask) { + UpdateAttributeRequest request = + UpdateAttributeRequest.newBuilder() + .setAttribute(attribute) + .setUpdateMask(updateMask) + .build(); + return updateAttribute(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update the attribute. The following fields in the [Attribute + * resource][google.cloud.apihub.v1.Attribute] can be updated: + * + *

    + *
  • [display_name][google.cloud.apihub.v1.Attribute.display_name] The display name can be + * updated for user defined attributes only. + *
  • [description][google.cloud.apihub.v1.Attribute.description] The description can be + * updated for user defined attributes only. + *
  • [allowed_values][google.cloud.apihub.v1.Attribute.allowed_values] To update the list of + * allowed values, clients need to use the fetched list of allowed values and add or remove + * values to or from the same list. The mutable allowed values can be updated for both user + * defined and System defined attributes. The immutable allowed values cannot be updated or + * deleted. The updated list of allowed values cannot be empty. If an allowed value that is + * already used by some resource's attribute is deleted, then the association between the + * resource and the attribute value will also be deleted. + *
  • [cardinality][google.cloud.apihub.v1.Attribute.cardinality] The cardinality can be + * updated for user defined attributes only. Cardinality can only be increased during an + * update. + *
+ * + *

The [update_mask][google.cloud.apihub.v1.UpdateAttributeRequest.update_mask] should be used + * to specify the fields being updated. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   UpdateAttributeRequest request =
+   *       UpdateAttributeRequest.newBuilder()
+   *           .setAttribute(Attribute.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Attribute response = apiHubClient.updateAttribute(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 Attribute updateAttribute(UpdateAttributeRequest request) { + return updateAttributeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update the attribute. The following fields in the [Attribute + * resource][google.cloud.apihub.v1.Attribute] can be updated: + * + *
    + *
  • [display_name][google.cloud.apihub.v1.Attribute.display_name] The display name can be + * updated for user defined attributes only. + *
  • [description][google.cloud.apihub.v1.Attribute.description] The description can be + * updated for user defined attributes only. + *
  • [allowed_values][google.cloud.apihub.v1.Attribute.allowed_values] To update the list of + * allowed values, clients need to use the fetched list of allowed values and add or remove + * values to or from the same list. The mutable allowed values can be updated for both user + * defined and System defined attributes. The immutable allowed values cannot be updated or + * deleted. The updated list of allowed values cannot be empty. If an allowed value that is + * already used by some resource's attribute is deleted, then the association between the + * resource and the attribute value will also be deleted. + *
  • [cardinality][google.cloud.apihub.v1.Attribute.cardinality] The cardinality can be + * updated for user defined attributes only. Cardinality can only be increased during an + * update. + *
+ * + *

The [update_mask][google.cloud.apihub.v1.UpdateAttributeRequest.update_mask] should be used + * to specify the fields being updated. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   UpdateAttributeRequest request =
+   *       UpdateAttributeRequest.newBuilder()
+   *           .setAttribute(Attribute.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = apiHubClient.updateAttributeCallable().futureCall(request);
+   *   // Do something.
+   *   Attribute response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateAttributeCallable() { + return stub.updateAttributeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an attribute. + * + *

Note: System defined attributes cannot be deleted. All associations of the attribute being + * deleted with any API hub resource will also get deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   AttributeName name = AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]");
+   *   apiHubClient.deleteAttribute(name);
+   * }
+   * }
+ * + * @param name Required. The name of the attribute to delete. Format: + * `projects/{project}/locations/{location}/attributes/{attribute}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAttribute(AttributeName name) { + DeleteAttributeRequest request = + DeleteAttributeRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteAttribute(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an attribute. + * + *

Note: System defined attributes cannot be deleted. All associations of the attribute being + * deleted with any API hub resource will also get deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String name = AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString();
+   *   apiHubClient.deleteAttribute(name);
+   * }
+   * }
+ * + * @param name Required. The name of the attribute to delete. Format: + * `projects/{project}/locations/{location}/attributes/{attribute}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAttribute(String name) { + DeleteAttributeRequest request = DeleteAttributeRequest.newBuilder().setName(name).build(); + deleteAttribute(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an attribute. + * + *

Note: System defined attributes cannot be deleted. All associations of the attribute being + * deleted with any API hub resource will also get deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   DeleteAttributeRequest request =
+   *       DeleteAttributeRequest.newBuilder()
+   *           .setName(AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString())
+   *           .build();
+   *   apiHubClient.deleteAttribute(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 void deleteAttribute(DeleteAttributeRequest request) { + deleteAttributeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an attribute. + * + *

Note: System defined attributes cannot be deleted. All associations of the attribute being + * deleted with any API hub resource will also get deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   DeleteAttributeRequest request =
+   *       DeleteAttributeRequest.newBuilder()
+   *           .setName(AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString())
+   *           .build();
+   *   ApiFuture future = apiHubClient.deleteAttributeCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteAttributeCallable() { + return stub.deleteAttributeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List all attributes. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Attribute element : apiHubClient.listAttributes(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource for Attribute. Format: + * `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAttributesPagedResponse listAttributes(LocationName parent) { + ListAttributesRequest request = + ListAttributesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listAttributes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List all attributes. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Attribute element : apiHubClient.listAttributes(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource for Attribute. Format: + * `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAttributesPagedResponse listAttributes(String parent) { + ListAttributesRequest request = ListAttributesRequest.newBuilder().setParent(parent).build(); + return listAttributes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List all attributes. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ListAttributesRequest request =
+   *       ListAttributesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Attribute element : apiHubClient.listAttributes(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 ListAttributesPagedResponse listAttributes(ListAttributesRequest request) { + return listAttributesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List all attributes. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ListAttributesRequest request =
+   *       ListAttributesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = apiHubClient.listAttributesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Attribute element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listAttributesPagedCallable() { + return stub.listAttributesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List all attributes. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ListAttributesRequest request =
+   *       ListAttributesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListAttributesResponse response = apiHubClient.listAttributesCallable().call(request);
+   *     for (Attribute element : response.getAttributesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listAttributesCallable() { + return stub.listAttributesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Search across API-Hub resources. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   LocationName location = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   String query = "query107944136";
+   *   for (SearchResult element : apiHubClient.searchResources(location, query).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param location Required. The resource name of the location which will be of the type + * `projects/{project_id}/locations/{location_id}`. This field is used to identify the + * instance of API-Hub in which resources should be searched. + * @param query Required. The free text search query. This query can contain keywords which could + * be related to any detail of the API-Hub resources such display names, descriptions, + * attributes etc. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SearchResourcesPagedResponse searchResources(LocationName location, String query) { + SearchResourcesRequest request = + SearchResourcesRequest.newBuilder() + .setLocation(location == null ? null : location.toString()) + .setQuery(query) + .build(); + return searchResources(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Search across API-Hub resources. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String location = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   String query = "query107944136";
+   *   for (SearchResult element : apiHubClient.searchResources(location, query).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param location Required. The resource name of the location which will be of the type + * `projects/{project_id}/locations/{location_id}`. This field is used to identify the + * instance of API-Hub in which resources should be searched. + * @param query Required. The free text search query. This query can contain keywords which could + * be related to any detail of the API-Hub resources such display names, descriptions, + * attributes etc. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SearchResourcesPagedResponse searchResources(String location, String query) { + SearchResourcesRequest request = + SearchResourcesRequest.newBuilder().setLocation(location).setQuery(query).build(); + return searchResources(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Search across API-Hub resources. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   SearchResourcesRequest request =
+   *       SearchResourcesRequest.newBuilder()
+   *           .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setQuery("query107944136")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (SearchResult element : apiHubClient.searchResources(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 SearchResourcesPagedResponse searchResources(SearchResourcesRequest request) { + return searchResourcesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Search across API-Hub resources. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   SearchResourcesRequest request =
+   *       SearchResourcesRequest.newBuilder()
+   *           .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setQuery("query107944136")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       apiHubClient.searchResourcesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (SearchResult element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + searchResourcesPagedCallable() { + return stub.searchResourcesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Search across API-Hub resources. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   SearchResourcesRequest request =
+   *       SearchResourcesRequest.newBuilder()
+   *           .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setQuery("query107944136")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     SearchResourcesResponse response = apiHubClient.searchResourcesCallable().call(request);
+   *     for (SearchResult element : response.getSearchResultsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + searchResourcesCallable() { + return stub.searchResourcesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an External API resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ExternalApi externalApi = ExternalApi.newBuilder().build();
+   *   String externalApiId = "externalApiId-31672374";
+   *   ExternalApi response = apiHubClient.createExternalApi(parent, externalApi, externalApiId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource for the External API resource. Format: + * `projects/{project}/locations/{location}` + * @param externalApi Required. The External API resource to create. + * @param externalApiId Optional. The ID to use for the External API resource, which will become + * the final component of the External API's resource name. This field is optional. + *
    + *
  • If provided, the same will be used. The service will throw an error if the specified + * id is already used by another External API resource in the API hub. + *
  • If not provided, a system generated id will be used. + *
+ *

This value should be 4-500 characters, and valid characters are /[a-z][A-Z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ExternalApi createExternalApi( + LocationName parent, ExternalApi externalApi, String externalApiId) { + CreateExternalApiRequest request = + CreateExternalApiRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setExternalApi(externalApi) + .setExternalApiId(externalApiId) + .build(); + return createExternalApi(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an External API resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   ExternalApi externalApi = ExternalApi.newBuilder().build();
+   *   String externalApiId = "externalApiId-31672374";
+   *   ExternalApi response = apiHubClient.createExternalApi(parent, externalApi, externalApiId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource for the External API resource. Format: + * `projects/{project}/locations/{location}` + * @param externalApi Required. The External API resource to create. + * @param externalApiId Optional. The ID to use for the External API resource, which will become + * the final component of the External API's resource name. This field is optional. + *
    + *
  • If provided, the same will be used. The service will throw an error if the specified + * id is already used by another External API resource in the API hub. + *
  • If not provided, a system generated id will be used. + *
+ *

This value should be 4-500 characters, and valid characters are /[a-z][A-Z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ExternalApi createExternalApi( + String parent, ExternalApi externalApi, String externalApiId) { + CreateExternalApiRequest request = + CreateExternalApiRequest.newBuilder() + .setParent(parent) + .setExternalApi(externalApi) + .setExternalApiId(externalApiId) + .build(); + return createExternalApi(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an External API resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   CreateExternalApiRequest request =
+   *       CreateExternalApiRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setExternalApiId("externalApiId-31672374")
+   *           .setExternalApi(ExternalApi.newBuilder().build())
+   *           .build();
+   *   ExternalApi response = apiHubClient.createExternalApi(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 ExternalApi createExternalApi(CreateExternalApiRequest request) { + return createExternalApiCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an External API resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   CreateExternalApiRequest request =
+   *       CreateExternalApiRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setExternalApiId("externalApiId-31672374")
+   *           .setExternalApi(ExternalApi.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = apiHubClient.createExternalApiCallable().futureCall(request);
+   *   // Do something.
+   *   ExternalApi response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createExternalApiCallable() { + return stub.createExternalApiCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about an External API resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ExternalApiName name = ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]");
+   *   ExternalApi response = apiHubClient.getExternalApi(name);
+   * }
+   * }
+ * + * @param name Required. The name of the External API resource to retrieve. Format: + * `projects/{project}/locations/{location}/externalApis/{externalApi}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ExternalApi getExternalApi(ExternalApiName name) { + GetExternalApiRequest request = + GetExternalApiRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getExternalApi(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about an External API resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String name = ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString();
+   *   ExternalApi response = apiHubClient.getExternalApi(name);
+   * }
+   * }
+ * + * @param name Required. The name of the External API resource to retrieve. Format: + * `projects/{project}/locations/{location}/externalApis/{externalApi}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ExternalApi getExternalApi(String name) { + GetExternalApiRequest request = GetExternalApiRequest.newBuilder().setName(name).build(); + return getExternalApi(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about an External API resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   GetExternalApiRequest request =
+   *       GetExternalApiRequest.newBuilder()
+   *           .setName(ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString())
+   *           .build();
+   *   ExternalApi response = apiHubClient.getExternalApi(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 ExternalApi getExternalApi(GetExternalApiRequest request) { + return getExternalApiCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about an External API resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   GetExternalApiRequest request =
+   *       GetExternalApiRequest.newBuilder()
+   *           .setName(ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString())
+   *           .build();
+   *   ApiFuture future = apiHubClient.getExternalApiCallable().futureCall(request);
+   *   // Do something.
+   *   ExternalApi response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getExternalApiCallable() { + return stub.getExternalApiCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update an External API resource in the API hub. The following fields can be updated: + * + *
    + *
  • [display_name][google.cloud.apihub.v1.ExternalApi.display_name] + *
  • [description][google.cloud.apihub.v1.ExternalApi.description] + *
  • [documentation][google.cloud.apihub.v1.ExternalApi.documentation] + *
  • [endpoints][google.cloud.apihub.v1.ExternalApi.endpoints] + *
  • [paths][google.cloud.apihub.v1.ExternalApi.paths] + *
+ * + *

The [update_mask][google.cloud.apihub.v1.UpdateExternalApiRequest.update_mask] should be + * used to specify the fields being updated. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ExternalApi externalApi = ExternalApi.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   ExternalApi response = apiHubClient.updateExternalApi(externalApi, updateMask);
+   * }
+   * }
+ * + * @param externalApi Required. The External API resource to update. + *

The External API resource's `name` field is used to identify the External API resource + * to update. Format: `projects/{project}/locations/{location}/externalApis/{externalApi}` + * @param updateMask Required. The list of fields to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ExternalApi updateExternalApi(ExternalApi externalApi, FieldMask updateMask) { + UpdateExternalApiRequest request = + UpdateExternalApiRequest.newBuilder() + .setExternalApi(externalApi) + .setUpdateMask(updateMask) + .build(); + return updateExternalApi(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update an External API resource in the API hub. The following fields can be updated: + * + *

    + *
  • [display_name][google.cloud.apihub.v1.ExternalApi.display_name] + *
  • [description][google.cloud.apihub.v1.ExternalApi.description] + *
  • [documentation][google.cloud.apihub.v1.ExternalApi.documentation] + *
  • [endpoints][google.cloud.apihub.v1.ExternalApi.endpoints] + *
  • [paths][google.cloud.apihub.v1.ExternalApi.paths] + *
+ * + *

The [update_mask][google.cloud.apihub.v1.UpdateExternalApiRequest.update_mask] should be + * used to specify the fields being updated. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   UpdateExternalApiRequest request =
+   *       UpdateExternalApiRequest.newBuilder()
+   *           .setExternalApi(ExternalApi.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ExternalApi response = apiHubClient.updateExternalApi(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 ExternalApi updateExternalApi(UpdateExternalApiRequest request) { + return updateExternalApiCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update an External API resource in the API hub. The following fields can be updated: + * + *
    + *
  • [display_name][google.cloud.apihub.v1.ExternalApi.display_name] + *
  • [description][google.cloud.apihub.v1.ExternalApi.description] + *
  • [documentation][google.cloud.apihub.v1.ExternalApi.documentation] + *
  • [endpoints][google.cloud.apihub.v1.ExternalApi.endpoints] + *
  • [paths][google.cloud.apihub.v1.ExternalApi.paths] + *
+ * + *

The [update_mask][google.cloud.apihub.v1.UpdateExternalApiRequest.update_mask] should be + * used to specify the fields being updated. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   UpdateExternalApiRequest request =
+   *       UpdateExternalApiRequest.newBuilder()
+   *           .setExternalApi(ExternalApi.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = apiHubClient.updateExternalApiCallable().futureCall(request);
+   *   // Do something.
+   *   ExternalApi response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateExternalApiCallable() { + return stub.updateExternalApiCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an External API resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ExternalApiName name = ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]");
+   *   apiHubClient.deleteExternalApi(name);
+   * }
+   * }
+ * + * @param name Required. The name of the External API resource to delete. Format: + * `projects/{project}/locations/{location}/externalApis/{externalApi}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteExternalApi(ExternalApiName name) { + DeleteExternalApiRequest request = + DeleteExternalApiRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteExternalApi(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an External API resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String name = ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString();
+   *   apiHubClient.deleteExternalApi(name);
+   * }
+   * }
+ * + * @param name Required. The name of the External API resource to delete. Format: + * `projects/{project}/locations/{location}/externalApis/{externalApi}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteExternalApi(String name) { + DeleteExternalApiRequest request = DeleteExternalApiRequest.newBuilder().setName(name).build(); + deleteExternalApi(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an External API resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   DeleteExternalApiRequest request =
+   *       DeleteExternalApiRequest.newBuilder()
+   *           .setName(ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString())
+   *           .build();
+   *   apiHubClient.deleteExternalApi(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 void deleteExternalApi(DeleteExternalApiRequest request) { + deleteExternalApiCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an External API resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   DeleteExternalApiRequest request =
+   *       DeleteExternalApiRequest.newBuilder()
+   *           .setName(ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString())
+   *           .build();
+   *   ApiFuture future = apiHubClient.deleteExternalApiCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteExternalApiCallable() { + return stub.deleteExternalApiCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List External API resources in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (ExternalApi element : apiHubClient.listExternalApis(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of External API resources. + * Format: `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListExternalApisPagedResponse listExternalApis(LocationName parent) { + ListExternalApisRequest request = + ListExternalApisRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listExternalApis(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List External API resources in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (ExternalApi element : apiHubClient.listExternalApis(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of External API resources. + * Format: `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListExternalApisPagedResponse listExternalApis(String parent) { + ListExternalApisRequest request = + ListExternalApisRequest.newBuilder().setParent(parent).build(); + return listExternalApis(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List External API resources in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ListExternalApisRequest request =
+   *       ListExternalApisRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (ExternalApi element : apiHubClient.listExternalApis(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 ListExternalApisPagedResponse listExternalApis(ListExternalApisRequest request) { + return listExternalApisPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List External API resources in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ListExternalApisRequest request =
+   *       ListExternalApisRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       apiHubClient.listExternalApisPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (ExternalApi element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listExternalApisPagedCallable() { + return stub.listExternalApisPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List External API resources in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ListExternalApisRequest request =
+   *       ListExternalApisRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListExternalApisResponse response = apiHubClient.listExternalApisCallable().call(request);
+   *     for (ExternalApi element : response.getExternalApisList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listExternalApisCallable() { + return stub.listExternalApisCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : apiHubClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = apiHubClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response = apiHubClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = apiHubClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = apiHubClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + @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 ListApisPagedResponse + extends AbstractPagedListResponse< + ListApisRequest, ListApisResponse, Api, ListApisPage, ListApisFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListApisPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListApisPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListApisPagedResponse(ListApisPage page) { + super(page, ListApisFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListApisPage + extends AbstractPage { + + private ListApisPage( + PageContext context, ListApisResponse response) { + super(context, response); + } + + private static ListApisPage createEmptyPage() { + return new ListApisPage(null, null); + } + + @Override + protected ListApisPage createPage( + PageContext context, ListApisResponse response) { + return new ListApisPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListApisFixedSizeCollection + extends AbstractFixedSizeCollection< + ListApisRequest, ListApisResponse, Api, ListApisPage, ListApisFixedSizeCollection> { + + private ListApisFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListApisFixedSizeCollection createEmptyCollection() { + return new ListApisFixedSizeCollection(null, 0); + } + + @Override + protected ListApisFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListApisFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListVersionsPagedResponse + extends AbstractPagedListResponse< + ListVersionsRequest, + ListVersionsResponse, + Version, + ListVersionsPage, + ListVersionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListVersionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListVersionsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListVersionsPagedResponse(ListVersionsPage page) { + super(page, ListVersionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListVersionsPage + extends AbstractPage { + + private ListVersionsPage( + PageContext context, + ListVersionsResponse response) { + super(context, response); + } + + private static ListVersionsPage createEmptyPage() { + return new ListVersionsPage(null, null); + } + + @Override + protected ListVersionsPage createPage( + PageContext context, + ListVersionsResponse response) { + return new ListVersionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListVersionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListVersionsRequest, + ListVersionsResponse, + Version, + ListVersionsPage, + ListVersionsFixedSizeCollection> { + + private ListVersionsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListVersionsFixedSizeCollection createEmptyCollection() { + return new ListVersionsFixedSizeCollection(null, 0); + } + + @Override + protected ListVersionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListVersionsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListSpecsPagedResponse + extends AbstractPagedListResponse< + ListSpecsRequest, ListSpecsResponse, Spec, ListSpecsPage, ListSpecsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSpecsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListSpecsPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListSpecsPagedResponse(ListSpecsPage page) { + super(page, ListSpecsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListSpecsPage + extends AbstractPage { + + private ListSpecsPage( + PageContext context, + ListSpecsResponse response) { + super(context, response); + } + + private static ListSpecsPage createEmptyPage() { + return new ListSpecsPage(null, null); + } + + @Override + protected ListSpecsPage createPage( + PageContext context, + ListSpecsResponse response) { + return new ListSpecsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListSpecsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSpecsRequest, ListSpecsResponse, Spec, ListSpecsPage, ListSpecsFixedSizeCollection> { + + private ListSpecsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSpecsFixedSizeCollection createEmptyCollection() { + return new ListSpecsFixedSizeCollection(null, 0); + } + + @Override + protected ListSpecsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSpecsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListApiOperationsPagedResponse + extends AbstractPagedListResponse< + ListApiOperationsRequest, + ListApiOperationsResponse, + ApiOperation, + ListApiOperationsPage, + ListApiOperationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListApiOperationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListApiOperationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListApiOperationsPagedResponse(ListApiOperationsPage page) { + super(page, ListApiOperationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListApiOperationsPage + extends AbstractPage< + ListApiOperationsRequest, + ListApiOperationsResponse, + ApiOperation, + ListApiOperationsPage> { + + private ListApiOperationsPage( + PageContext context, + ListApiOperationsResponse response) { + super(context, response); + } + + private static ListApiOperationsPage createEmptyPage() { + return new ListApiOperationsPage(null, null); + } + + @Override + protected ListApiOperationsPage createPage( + PageContext context, + ListApiOperationsResponse response) { + return new ListApiOperationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListApiOperationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListApiOperationsRequest, + ListApiOperationsResponse, + ApiOperation, + ListApiOperationsPage, + ListApiOperationsFixedSizeCollection> { + + private ListApiOperationsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListApiOperationsFixedSizeCollection createEmptyCollection() { + return new ListApiOperationsFixedSizeCollection(null, 0); + } + + @Override + protected ListApiOperationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListApiOperationsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListDeploymentsPagedResponse + extends AbstractPagedListResponse< + ListDeploymentsRequest, + ListDeploymentsResponse, + Deployment, + ListDeploymentsPage, + ListDeploymentsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListDeploymentsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListDeploymentsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListDeploymentsPagedResponse(ListDeploymentsPage page) { + super(page, ListDeploymentsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListDeploymentsPage + extends AbstractPage< + ListDeploymentsRequest, ListDeploymentsResponse, Deployment, ListDeploymentsPage> { + + private ListDeploymentsPage( + PageContext context, + ListDeploymentsResponse response) { + super(context, response); + } + + private static ListDeploymentsPage createEmptyPage() { + return new ListDeploymentsPage(null, null); + } + + @Override + protected ListDeploymentsPage createPage( + PageContext context, + ListDeploymentsResponse response) { + return new ListDeploymentsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListDeploymentsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListDeploymentsRequest, + ListDeploymentsResponse, + Deployment, + ListDeploymentsPage, + ListDeploymentsFixedSizeCollection> { + + private ListDeploymentsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListDeploymentsFixedSizeCollection createEmptyCollection() { + return new ListDeploymentsFixedSizeCollection(null, 0); + } + + @Override + protected ListDeploymentsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListDeploymentsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListAttributesPagedResponse + extends AbstractPagedListResponse< + ListAttributesRequest, + ListAttributesResponse, + Attribute, + ListAttributesPage, + ListAttributesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListAttributesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListAttributesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListAttributesPagedResponse(ListAttributesPage page) { + super(page, ListAttributesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListAttributesPage + extends AbstractPage< + ListAttributesRequest, ListAttributesResponse, Attribute, ListAttributesPage> { + + private ListAttributesPage( + PageContext context, + ListAttributesResponse response) { + super(context, response); + } + + private static ListAttributesPage createEmptyPage() { + return new ListAttributesPage(null, null); + } + + @Override + protected ListAttributesPage createPage( + PageContext context, + ListAttributesResponse response) { + return new ListAttributesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListAttributesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListAttributesRequest, + ListAttributesResponse, + Attribute, + ListAttributesPage, + ListAttributesFixedSizeCollection> { + + private ListAttributesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListAttributesFixedSizeCollection createEmptyCollection() { + return new ListAttributesFixedSizeCollection(null, 0); + } + + @Override + protected ListAttributesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListAttributesFixedSizeCollection(pages, collectionSize); + } + } + + public static class SearchResourcesPagedResponse + extends AbstractPagedListResponse< + SearchResourcesRequest, + SearchResourcesResponse, + SearchResult, + SearchResourcesPage, + SearchResourcesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + SearchResourcesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new SearchResourcesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private SearchResourcesPagedResponse(SearchResourcesPage page) { + super(page, SearchResourcesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class SearchResourcesPage + extends AbstractPage< + SearchResourcesRequest, SearchResourcesResponse, SearchResult, SearchResourcesPage> { + + private SearchResourcesPage( + PageContext context, + SearchResourcesResponse response) { + super(context, response); + } + + private static SearchResourcesPage createEmptyPage() { + return new SearchResourcesPage(null, null); + } + + @Override + protected SearchResourcesPage createPage( + PageContext context, + SearchResourcesResponse response) { + return new SearchResourcesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class SearchResourcesFixedSizeCollection + extends AbstractFixedSizeCollection< + SearchResourcesRequest, + SearchResourcesResponse, + SearchResult, + SearchResourcesPage, + SearchResourcesFixedSizeCollection> { + + private SearchResourcesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static SearchResourcesFixedSizeCollection createEmptyCollection() { + return new SearchResourcesFixedSizeCollection(null, 0); + } + + @Override + protected SearchResourcesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new SearchResourcesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListExternalApisPagedResponse + extends AbstractPagedListResponse< + ListExternalApisRequest, + ListExternalApisResponse, + ExternalApi, + ListExternalApisPage, + ListExternalApisFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListExternalApisPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListExternalApisPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListExternalApisPagedResponse(ListExternalApisPage page) { + super(page, ListExternalApisFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListExternalApisPage + extends AbstractPage< + ListExternalApisRequest, ListExternalApisResponse, ExternalApi, ListExternalApisPage> { + + private ListExternalApisPage( + PageContext context, + ListExternalApisResponse response) { + super(context, response); + } + + private static ListExternalApisPage createEmptyPage() { + return new ListExternalApisPage(null, null); + } + + @Override + protected ListExternalApisPage createPage( + PageContext context, + ListExternalApisResponse response) { + return new ListExternalApisPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListExternalApisFixedSizeCollection + extends AbstractFixedSizeCollection< + ListExternalApisRequest, + ListExternalApisResponse, + ExternalApi, + ListExternalApisPage, + ListExternalApisFixedSizeCollection> { + + private ListExternalApisFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListExternalApisFixedSizeCollection createEmptyCollection() { + return new ListExternalApisFixedSizeCollection(null, 0); + } + + @Override + protected ListExternalApisFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListExternalApisFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ApiHubDependenciesClient.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ApiHubDependenciesClient.java new file mode 100644 index 000000000000..3ac78aec4cb4 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ApiHubDependenciesClient.java @@ -0,0 +1,1308 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +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.cloud.apihub.v1.stub.ApiHubDependenciesStub; +import com.google.cloud.apihub.v1.stub.ApiHubDependenciesStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +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: This service provides methods for various operations related to a + * [Dependency][google.cloud.apihub.v1.Dependency] in the API hub. + * + *

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
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   Dependency dependency = Dependency.newBuilder().build();
+ *   String dependencyId = "dependencyId503788998";
+ *   Dependency response =
+ *       apiHubDependenciesClient.createDependency(parent, dependency, dependencyId);
+ * }
+ * }
+ * + *

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

CreateDependency

Create a dependency between two entities in the API hub.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createDependency(CreateDependencyRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • createDependency(LocationName parent, Dependency dependency, String dependencyId) + *

  • createDependency(String parent, Dependency dependency, String dependencyId) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createDependencyCallable() + *

+ *

GetDependency

Get details about a dependency resource in the API hub.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getDependency(GetDependencyRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getDependency(DependencyName name) + *

  • getDependency(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getDependencyCallable() + *

+ *

UpdateDependency

Update a dependency based on the [update_mask][google.cloud.apihub.v1.UpdateDependencyRequest.update_mask] provided in the request. + *

The following fields in the [dependency][google.cloud.apihub.v1.Dependency] can be updated: + *

    + *
  • [description][google.cloud.apihub.v1.Dependency.description] + *
+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateDependency(UpdateDependencyRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • updateDependency(Dependency dependency, FieldMask updateMask) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateDependencyCallable() + *

+ *

DeleteDependency

Delete the dependency resource.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteDependency(DeleteDependencyRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteDependency(DependencyName name) + *

  • deleteDependency(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteDependencyCallable() + *

+ *

ListDependencies

List dependencies based on the provided filter and pagination parameters.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listDependencies(ListDependenciesRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listDependencies(LocationName parent) + *

  • listDependencies(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listDependenciesPagedCallable() + *

  • listDependenciesCallable() + *

+ *

ListLocations

Lists information about the supported locations for this service.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listLocations(ListLocationsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listLocationsPagedCallable() + *

  • listLocationsCallable() + *

+ *

GetLocation

Gets information about a location.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getLocation(GetLocationRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getLocationCallable() + *

+ *
+ * + *

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 ApiHubDependenciesSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ApiHubDependenciesSettings apiHubDependenciesSettings =
+ *     ApiHubDependenciesSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ApiHubDependenciesClient apiHubDependenciesClient =
+ *     ApiHubDependenciesClient.create(apiHubDependenciesSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ApiHubDependenciesSettings apiHubDependenciesSettings =
+ *     ApiHubDependenciesSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ApiHubDependenciesClient apiHubDependenciesClient =
+ *     ApiHubDependenciesClient.create(apiHubDependenciesSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ApiHubDependenciesSettings apiHubDependenciesSettings =
+ *     ApiHubDependenciesSettings.newHttpJsonBuilder().build();
+ * ApiHubDependenciesClient apiHubDependenciesClient =
+ *     ApiHubDependenciesClient.create(apiHubDependenciesSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class ApiHubDependenciesClient implements BackgroundResource { + private final ApiHubDependenciesSettings settings; + private final ApiHubDependenciesStub stub; + + /** Constructs an instance of ApiHubDependenciesClient with default settings. */ + public static final ApiHubDependenciesClient create() throws IOException { + return create(ApiHubDependenciesSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ApiHubDependenciesClient, 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 ApiHubDependenciesClient create(ApiHubDependenciesSettings settings) + throws IOException { + return new ApiHubDependenciesClient(settings); + } + + /** + * Constructs an instance of ApiHubDependenciesClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(ApiHubDependenciesSettings). + */ + public static final ApiHubDependenciesClient create(ApiHubDependenciesStub stub) { + return new ApiHubDependenciesClient(stub); + } + + /** + * Constructs an instance of ApiHubDependenciesClient, 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 ApiHubDependenciesClient(ApiHubDependenciesSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ApiHubDependenciesStubSettings) settings.getStubSettings()).createStub(); + } + + protected ApiHubDependenciesClient(ApiHubDependenciesStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ApiHubDependenciesSettings getSettings() { + return settings; + } + + public ApiHubDependenciesStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a dependency between two entities in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Dependency dependency = Dependency.newBuilder().build();
+   *   String dependencyId = "dependencyId503788998";
+   *   Dependency response =
+   *       apiHubDependenciesClient.createDependency(parent, dependency, dependencyId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource for the dependency resource. Format: + * `projects/{project}/locations/{location}` + * @param dependency Required. The dependency resource to create. + * @param dependencyId Optional. The ID to use for the dependency resource, which will become the + * final component of the dependency's resource name. This field is optional. + *
    + *
  • If provided, the same will be used. The service will throw an error if duplicate id + * is provided by the client. + *
  • If not provided, a system generated id will be used. + *
+ *

This value should be 4-500 characters, and valid characters are `[a-z][A-Z][0-9]-_`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Dependency createDependency( + LocationName parent, Dependency dependency, String dependencyId) { + CreateDependencyRequest request = + CreateDependencyRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setDependency(dependency) + .setDependencyId(dependencyId) + .build(); + return createDependency(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a dependency between two entities in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Dependency dependency = Dependency.newBuilder().build();
+   *   String dependencyId = "dependencyId503788998";
+   *   Dependency response =
+   *       apiHubDependenciesClient.createDependency(parent, dependency, dependencyId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource for the dependency resource. Format: + * `projects/{project}/locations/{location}` + * @param dependency Required. The dependency resource to create. + * @param dependencyId Optional. The ID to use for the dependency resource, which will become the + * final component of the dependency's resource name. This field is optional. + *
    + *
  • If provided, the same will be used. The service will throw an error if duplicate id + * is provided by the client. + *
  • If not provided, a system generated id will be used. + *
+ *

This value should be 4-500 characters, and valid characters are `[a-z][A-Z][0-9]-_`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Dependency createDependency( + String parent, Dependency dependency, String dependencyId) { + CreateDependencyRequest request = + CreateDependencyRequest.newBuilder() + .setParent(parent) + .setDependency(dependency) + .setDependencyId(dependencyId) + .build(); + return createDependency(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a dependency between two entities in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
+   *   CreateDependencyRequest request =
+   *       CreateDependencyRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setDependencyId("dependencyId503788998")
+   *           .setDependency(Dependency.newBuilder().build())
+   *           .build();
+   *   Dependency response = apiHubDependenciesClient.createDependency(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 Dependency createDependency(CreateDependencyRequest request) { + return createDependencyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a dependency between two entities in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
+   *   CreateDependencyRequest request =
+   *       CreateDependencyRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setDependencyId("dependencyId503788998")
+   *           .setDependency(Dependency.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       apiHubDependenciesClient.createDependencyCallable().futureCall(request);
+   *   // Do something.
+   *   Dependency response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createDependencyCallable() { + return stub.createDependencyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about a dependency resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
+   *   DependencyName name = DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]");
+   *   Dependency response = apiHubDependenciesClient.getDependency(name);
+   * }
+   * }
+ * + * @param name Required. The name of the dependency resource to retrieve. Format: + * `projects/{project}/locations/{location}/dependencies/{dependency}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Dependency getDependency(DependencyName name) { + GetDependencyRequest request = + GetDependencyRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getDependency(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about a dependency resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
+   *   String name = DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString();
+   *   Dependency response = apiHubDependenciesClient.getDependency(name);
+   * }
+   * }
+ * + * @param name Required. The name of the dependency resource to retrieve. Format: + * `projects/{project}/locations/{location}/dependencies/{dependency}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Dependency getDependency(String name) { + GetDependencyRequest request = GetDependencyRequest.newBuilder().setName(name).build(); + return getDependency(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about a dependency resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
+   *   GetDependencyRequest request =
+   *       GetDependencyRequest.newBuilder()
+   *           .setName(DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString())
+   *           .build();
+   *   Dependency response = apiHubDependenciesClient.getDependency(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 Dependency getDependency(GetDependencyRequest request) { + return getDependencyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about a dependency resource in the API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
+   *   GetDependencyRequest request =
+   *       GetDependencyRequest.newBuilder()
+   *           .setName(DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       apiHubDependenciesClient.getDependencyCallable().futureCall(request);
+   *   // Do something.
+   *   Dependency response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getDependencyCallable() { + return stub.getDependencyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a dependency based on the + * [update_mask][google.cloud.apihub.v1.UpdateDependencyRequest.update_mask] provided in the + * request. + * + *

The following fields in the [dependency][google.cloud.apihub.v1.Dependency] can be updated: + * + *

    + *
  • [description][google.cloud.apihub.v1.Dependency.description] + *
+ * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
+   *   Dependency dependency = Dependency.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Dependency response = apiHubDependenciesClient.updateDependency(dependency, updateMask);
+   * }
+   * }
+ * + * @param dependency Required. The dependency resource to update. + *

The dependency's `name` field is used to identify the dependency to update. Format: + * `projects/{project}/locations/{location}/dependencies/{dependency}` + * @param updateMask Required. The list of fields to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Dependency updateDependency(Dependency dependency, FieldMask updateMask) { + UpdateDependencyRequest request = + UpdateDependencyRequest.newBuilder() + .setDependency(dependency) + .setUpdateMask(updateMask) + .build(); + return updateDependency(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a dependency based on the + * [update_mask][google.cloud.apihub.v1.UpdateDependencyRequest.update_mask] provided in the + * request. + * + *

The following fields in the [dependency][google.cloud.apihub.v1.Dependency] can be updated: + * + *

    + *
  • [description][google.cloud.apihub.v1.Dependency.description] + *
+ * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
+   *   UpdateDependencyRequest request =
+   *       UpdateDependencyRequest.newBuilder()
+   *           .setDependency(Dependency.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Dependency response = apiHubDependenciesClient.updateDependency(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 Dependency updateDependency(UpdateDependencyRequest request) { + return updateDependencyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a dependency based on the + * [update_mask][google.cloud.apihub.v1.UpdateDependencyRequest.update_mask] provided in the + * request. + * + *

The following fields in the [dependency][google.cloud.apihub.v1.Dependency] can be updated: + * + *

    + *
  • [description][google.cloud.apihub.v1.Dependency.description] + *
+ * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
+   *   UpdateDependencyRequest request =
+   *       UpdateDependencyRequest.newBuilder()
+   *           .setDependency(Dependency.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       apiHubDependenciesClient.updateDependencyCallable().futureCall(request);
+   *   // Do something.
+   *   Dependency response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateDependencyCallable() { + return stub.updateDependencyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete the dependency resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
+   *   DependencyName name = DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]");
+   *   apiHubDependenciesClient.deleteDependency(name);
+   * }
+   * }
+ * + * @param name Required. The name of the dependency resource to delete. Format: + * `projects/{project}/locations/{location}/dependencies/{dependency}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteDependency(DependencyName name) { + DeleteDependencyRequest request = + DeleteDependencyRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteDependency(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete the dependency resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
+   *   String name = DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString();
+   *   apiHubDependenciesClient.deleteDependency(name);
+   * }
+   * }
+ * + * @param name Required. The name of the dependency resource to delete. Format: + * `projects/{project}/locations/{location}/dependencies/{dependency}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteDependency(String name) { + DeleteDependencyRequest request = DeleteDependencyRequest.newBuilder().setName(name).build(); + deleteDependency(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete the dependency resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
+   *   DeleteDependencyRequest request =
+   *       DeleteDependencyRequest.newBuilder()
+   *           .setName(DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString())
+   *           .build();
+   *   apiHubDependenciesClient.deleteDependency(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 void deleteDependency(DeleteDependencyRequest request) { + deleteDependencyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete the dependency resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
+   *   DeleteDependencyRequest request =
+   *       DeleteDependencyRequest.newBuilder()
+   *           .setName(DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       apiHubDependenciesClient.deleteDependencyCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteDependencyCallable() { + return stub.deleteDependencyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List dependencies based on the provided filter and pagination parameters. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Dependency element : apiHubDependenciesClient.listDependencies(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent which owns this collection of dependency resources. Format: + * `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDependenciesPagedResponse listDependencies(LocationName parent) { + ListDependenciesRequest request = + ListDependenciesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listDependencies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List dependencies based on the provided filter and pagination parameters. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Dependency element : apiHubDependenciesClient.listDependencies(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent which owns this collection of dependency resources. Format: + * `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDependenciesPagedResponse listDependencies(String parent) { + ListDependenciesRequest request = + ListDependenciesRequest.newBuilder().setParent(parent).build(); + return listDependencies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List dependencies based on the provided filter and pagination parameters. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
+   *   ListDependenciesRequest request =
+   *       ListDependenciesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Dependency element : apiHubDependenciesClient.listDependencies(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 ListDependenciesPagedResponse listDependencies(ListDependenciesRequest request) { + return listDependenciesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List dependencies based on the provided filter and pagination parameters. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
+   *   ListDependenciesRequest request =
+   *       ListDependenciesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       apiHubDependenciesClient.listDependenciesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Dependency element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listDependenciesPagedCallable() { + return stub.listDependenciesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List dependencies based on the provided filter and pagination parameters. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
+   *   ListDependenciesRequest request =
+   *       ListDependenciesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListDependenciesResponse response =
+   *         apiHubDependenciesClient.listDependenciesCallable().call(request);
+   *     for (Dependency element : response.getDependenciesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listDependenciesCallable() { + return stub.listDependenciesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : apiHubDependenciesClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       apiHubDependenciesClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response =
+   *         apiHubDependenciesClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = apiHubDependenciesClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future =
+   *       apiHubDependenciesClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + @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 ListDependenciesPagedResponse + extends AbstractPagedListResponse< + ListDependenciesRequest, + ListDependenciesResponse, + Dependency, + ListDependenciesPage, + ListDependenciesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListDependenciesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListDependenciesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListDependenciesPagedResponse(ListDependenciesPage page) { + super(page, ListDependenciesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListDependenciesPage + extends AbstractPage< + ListDependenciesRequest, ListDependenciesResponse, Dependency, ListDependenciesPage> { + + private ListDependenciesPage( + PageContext context, + ListDependenciesResponse response) { + super(context, response); + } + + private static ListDependenciesPage createEmptyPage() { + return new ListDependenciesPage(null, null); + } + + @Override + protected ListDependenciesPage createPage( + PageContext context, + ListDependenciesResponse response) { + return new ListDependenciesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListDependenciesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListDependenciesRequest, + ListDependenciesResponse, + Dependency, + ListDependenciesPage, + ListDependenciesFixedSizeCollection> { + + private ListDependenciesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListDependenciesFixedSizeCollection createEmptyCollection() { + return new ListDependenciesFixedSizeCollection(null, 0); + } + + @Override + protected ListDependenciesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListDependenciesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ApiHubDependenciesSettings.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ApiHubDependenciesSettings.java new file mode 100644 index 000000000000..525b2b347e82 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ApiHubDependenciesSettings.java @@ -0,0 +1,281 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import static com.google.cloud.apihub.v1.ApiHubDependenciesClient.ListDependenciesPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubDependenciesClient.ListLocationsPagedResponse; + +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.httpjson.InstantiatingHttpJsonChannelProvider; +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.apihub.v1.stub.ApiHubDependenciesStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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 ApiHubDependenciesClient}. + * + *

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

    + *
  • The default service address (apihub.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 createDependency to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ApiHubDependenciesSettings.Builder apiHubDependenciesSettingsBuilder =
+ *     ApiHubDependenciesSettings.newBuilder();
+ * apiHubDependenciesSettingsBuilder
+ *     .createDependencySettings()
+ *     .setRetrySettings(
+ *         apiHubDependenciesSettingsBuilder
+ *             .createDependencySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ApiHubDependenciesSettings apiHubDependenciesSettings =
+ *     apiHubDependenciesSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class ApiHubDependenciesSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createDependency. */ + public UnaryCallSettings createDependencySettings() { + return ((ApiHubDependenciesStubSettings) getStubSettings()).createDependencySettings(); + } + + /** Returns the object with the settings used for calls to getDependency. */ + public UnaryCallSettings getDependencySettings() { + return ((ApiHubDependenciesStubSettings) getStubSettings()).getDependencySettings(); + } + + /** Returns the object with the settings used for calls to updateDependency. */ + public UnaryCallSettings updateDependencySettings() { + return ((ApiHubDependenciesStubSettings) getStubSettings()).updateDependencySettings(); + } + + /** Returns the object with the settings used for calls to deleteDependency. */ + public UnaryCallSettings deleteDependencySettings() { + return ((ApiHubDependenciesStubSettings) getStubSettings()).deleteDependencySettings(); + } + + /** Returns the object with the settings used for calls to listDependencies. */ + public PagedCallSettings< + ListDependenciesRequest, ListDependenciesResponse, ListDependenciesPagedResponse> + listDependenciesSettings() { + return ((ApiHubDependenciesStubSettings) getStubSettings()).listDependenciesSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((ApiHubDependenciesStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((ApiHubDependenciesStubSettings) getStubSettings()).getLocationSettings(); + } + + public static final ApiHubDependenciesSettings create(ApiHubDependenciesStubSettings stub) + throws IOException { + return new ApiHubDependenciesSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ApiHubDependenciesStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ApiHubDependenciesStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ApiHubDependenciesStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ApiHubDependenciesStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ApiHubDependenciesStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return ApiHubDependenciesStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ApiHubDependenciesStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiHubDependenciesStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 ApiHubDependenciesSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ApiHubDependenciesSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(ApiHubDependenciesStubSettings.newBuilder(clientContext)); + } + + protected Builder(ApiHubDependenciesSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ApiHubDependenciesStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(ApiHubDependenciesStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(ApiHubDependenciesStubSettings.newHttpJsonBuilder()); + } + + public ApiHubDependenciesStubSettings.Builder getStubSettingsBuilder() { + return ((ApiHubDependenciesStubSettings.Builder) getStubSettings()); + } + + /** + * 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) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createDependency. */ + public UnaryCallSettings.Builder + createDependencySettings() { + return getStubSettingsBuilder().createDependencySettings(); + } + + /** Returns the builder for the settings used for calls to getDependency. */ + public UnaryCallSettings.Builder getDependencySettings() { + return getStubSettingsBuilder().getDependencySettings(); + } + + /** Returns the builder for the settings used for calls to updateDependency. */ + public UnaryCallSettings.Builder + updateDependencySettings() { + return getStubSettingsBuilder().updateDependencySettings(); + } + + /** Returns the builder for the settings used for calls to deleteDependency. */ + public UnaryCallSettings.Builder deleteDependencySettings() { + return getStubSettingsBuilder().deleteDependencySettings(); + } + + /** Returns the builder for the settings used for calls to listDependencies. */ + public PagedCallSettings.Builder< + ListDependenciesRequest, ListDependenciesResponse, ListDependenciesPagedResponse> + listDependenciesSettings() { + return getStubSettingsBuilder().listDependenciesSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + @Override + public ApiHubDependenciesSettings build() throws IOException { + return new ApiHubDependenciesSettings(this); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ApiHubPluginClient.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ApiHubPluginClient.java new file mode 100644 index 000000000000..a1d9e6953f86 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ApiHubPluginClient.java @@ -0,0 +1,847 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +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.cloud.apihub.v1.stub.ApiHubPluginStub; +import com.google.cloud.apihub.v1.stub.ApiHubPluginStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: This service is used for managing plugins inside the API Hub. + * + *

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
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+ *   PluginName name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]");
+ *   Plugin response = apiHubPluginClient.getPlugin(name);
+ * }
+ * }
+ * + *

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

GetPlugin

Get details about an API Hub plugin.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getPlugin(GetPluginRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getPlugin(PluginName name) + *

  • getPlugin(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getPluginCallable() + *

+ *

EnablePlugin

Enables a plugin. The `state` of the plugin after enabling is `ENABLED`

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • enablePlugin(EnablePluginRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • enablePlugin(PluginName name) + *

  • enablePlugin(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • enablePluginCallable() + *

+ *

DisablePlugin

Disables a plugin. The `state` of the plugin after disabling is `DISABLED`

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • disablePlugin(DisablePluginRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • disablePlugin(PluginName name) + *

  • disablePlugin(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • disablePluginCallable() + *

+ *

ListLocations

Lists information about the supported locations for this service.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listLocations(ListLocationsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listLocationsPagedCallable() + *

  • listLocationsCallable() + *

+ *

GetLocation

Gets information about a location.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getLocation(GetLocationRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getLocationCallable() + *

+ *
+ * + *

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 ApiHubPluginSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ApiHubPluginSettings apiHubPluginSettings =
+ *     ApiHubPluginSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create(apiHubPluginSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ApiHubPluginSettings apiHubPluginSettings =
+ *     ApiHubPluginSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create(apiHubPluginSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ApiHubPluginSettings apiHubPluginSettings = ApiHubPluginSettings.newHttpJsonBuilder().build();
+ * ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create(apiHubPluginSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class ApiHubPluginClient implements BackgroundResource { + private final ApiHubPluginSettings settings; + private final ApiHubPluginStub stub; + + /** Constructs an instance of ApiHubPluginClient with default settings. */ + public static final ApiHubPluginClient create() throws IOException { + return create(ApiHubPluginSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ApiHubPluginClient, 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 ApiHubPluginClient create(ApiHubPluginSettings settings) throws IOException { + return new ApiHubPluginClient(settings); + } + + /** + * Constructs an instance of ApiHubPluginClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(ApiHubPluginSettings). + */ + public static final ApiHubPluginClient create(ApiHubPluginStub stub) { + return new ApiHubPluginClient(stub); + } + + /** + * Constructs an instance of ApiHubPluginClient, 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 ApiHubPluginClient(ApiHubPluginSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ApiHubPluginStubSettings) settings.getStubSettings()).createStub(); + } + + protected ApiHubPluginClient(ApiHubPluginStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ApiHubPluginSettings getSettings() { + return settings; + } + + public ApiHubPluginStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about an API Hub plugin. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+   *   PluginName name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]");
+   *   Plugin response = apiHubPluginClient.getPlugin(name);
+   * }
+   * }
+ * + * @param name Required. The name of the plugin to retrieve. Format: + * `projects/{project}/locations/{location}/plugins/{plugin}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Plugin getPlugin(PluginName name) { + GetPluginRequest request = + GetPluginRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getPlugin(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about an API Hub plugin. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+   *   String name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString();
+   *   Plugin response = apiHubPluginClient.getPlugin(name);
+   * }
+   * }
+ * + * @param name Required. The name of the plugin to retrieve. Format: + * `projects/{project}/locations/{location}/plugins/{plugin}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Plugin getPlugin(String name) { + GetPluginRequest request = GetPluginRequest.newBuilder().setName(name).build(); + return getPlugin(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about an API Hub plugin. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+   *   GetPluginRequest request =
+   *       GetPluginRequest.newBuilder()
+   *           .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString())
+   *           .build();
+   *   Plugin response = apiHubPluginClient.getPlugin(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 Plugin getPlugin(GetPluginRequest request) { + return getPluginCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about an API Hub plugin. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+   *   GetPluginRequest request =
+   *       GetPluginRequest.newBuilder()
+   *           .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString())
+   *           .build();
+   *   ApiFuture future = apiHubPluginClient.getPluginCallable().futureCall(request);
+   *   // Do something.
+   *   Plugin response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getPluginCallable() { + return stub.getPluginCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Enables a plugin. The `state` of the plugin after enabling is `ENABLED` + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+   *   PluginName name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]");
+   *   Plugin response = apiHubPluginClient.enablePlugin(name);
+   * }
+   * }
+ * + * @param name Required. The name of the plugin to enable. Format: + * `projects/{project}/locations/{location}/plugins/{plugin}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Plugin enablePlugin(PluginName name) { + EnablePluginRequest request = + EnablePluginRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return enablePlugin(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Enables a plugin. The `state` of the plugin after enabling is `ENABLED` + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+   *   String name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString();
+   *   Plugin response = apiHubPluginClient.enablePlugin(name);
+   * }
+   * }
+ * + * @param name Required. The name of the plugin to enable. Format: + * `projects/{project}/locations/{location}/plugins/{plugin}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Plugin enablePlugin(String name) { + EnablePluginRequest request = EnablePluginRequest.newBuilder().setName(name).build(); + return enablePlugin(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Enables a plugin. The `state` of the plugin after enabling is `ENABLED` + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+   *   EnablePluginRequest request =
+   *       EnablePluginRequest.newBuilder()
+   *           .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString())
+   *           .build();
+   *   Plugin response = apiHubPluginClient.enablePlugin(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 Plugin enablePlugin(EnablePluginRequest request) { + return enablePluginCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Enables a plugin. The `state` of the plugin after enabling is `ENABLED` + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+   *   EnablePluginRequest request =
+   *       EnablePluginRequest.newBuilder()
+   *           .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString())
+   *           .build();
+   *   ApiFuture future = apiHubPluginClient.enablePluginCallable().futureCall(request);
+   *   // Do something.
+   *   Plugin response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable enablePluginCallable() { + return stub.enablePluginCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Disables a plugin. The `state` of the plugin after disabling is `DISABLED` + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+   *   PluginName name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]");
+   *   Plugin response = apiHubPluginClient.disablePlugin(name);
+   * }
+   * }
+ * + * @param name Required. The name of the plugin to disable. Format: + * `projects/{project}/locations/{location}/plugins/{plugin}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Plugin disablePlugin(PluginName name) { + DisablePluginRequest request = + DisablePluginRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return disablePlugin(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Disables a plugin. The `state` of the plugin after disabling is `DISABLED` + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+   *   String name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString();
+   *   Plugin response = apiHubPluginClient.disablePlugin(name);
+   * }
+   * }
+ * + * @param name Required. The name of the plugin to disable. Format: + * `projects/{project}/locations/{location}/plugins/{plugin}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Plugin disablePlugin(String name) { + DisablePluginRequest request = DisablePluginRequest.newBuilder().setName(name).build(); + return disablePlugin(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Disables a plugin. The `state` of the plugin after disabling is `DISABLED` + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+   *   DisablePluginRequest request =
+   *       DisablePluginRequest.newBuilder()
+   *           .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString())
+   *           .build();
+   *   Plugin response = apiHubPluginClient.disablePlugin(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 Plugin disablePlugin(DisablePluginRequest request) { + return disablePluginCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Disables a plugin. The `state` of the plugin after disabling is `DISABLED` + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+   *   DisablePluginRequest request =
+   *       DisablePluginRequest.newBuilder()
+   *           .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString())
+   *           .build();
+   *   ApiFuture future = apiHubPluginClient.disablePluginCallable().futureCall(request);
+   *   // Do something.
+   *   Plugin response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable disablePluginCallable() { + return stub.disablePluginCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : apiHubPluginClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       apiHubPluginClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response = apiHubPluginClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = apiHubPluginClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = apiHubPluginClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + @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 ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ApiHubPluginSettings.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ApiHubPluginSettings.java new file mode 100644 index 000000000000..cba538e4a944 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ApiHubPluginSettings.java @@ -0,0 +1,251 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import static com.google.cloud.apihub.v1.ApiHubPluginClient.ListLocationsPagedResponse; + +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.httpjson.InstantiatingHttpJsonChannelProvider; +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.apihub.v1.stub.ApiHubPluginStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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 ApiHubPluginClient}. + * + *

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

    + *
  • The default service address (apihub.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 getPlugin to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ApiHubPluginSettings.Builder apiHubPluginSettingsBuilder = ApiHubPluginSettings.newBuilder();
+ * apiHubPluginSettingsBuilder
+ *     .getPluginSettings()
+ *     .setRetrySettings(
+ *         apiHubPluginSettingsBuilder
+ *             .getPluginSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ApiHubPluginSettings apiHubPluginSettings = apiHubPluginSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class ApiHubPluginSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to getPlugin. */ + public UnaryCallSettings getPluginSettings() { + return ((ApiHubPluginStubSettings) getStubSettings()).getPluginSettings(); + } + + /** Returns the object with the settings used for calls to enablePlugin. */ + public UnaryCallSettings enablePluginSettings() { + return ((ApiHubPluginStubSettings) getStubSettings()).enablePluginSettings(); + } + + /** Returns the object with the settings used for calls to disablePlugin. */ + public UnaryCallSettings disablePluginSettings() { + return ((ApiHubPluginStubSettings) getStubSettings()).disablePluginSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((ApiHubPluginStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((ApiHubPluginStubSettings) getStubSettings()).getLocationSettings(); + } + + public static final ApiHubPluginSettings create(ApiHubPluginStubSettings stub) + throws IOException { + return new ApiHubPluginSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ApiHubPluginStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ApiHubPluginStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ApiHubPluginStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ApiHubPluginStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ApiHubPluginStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return ApiHubPluginStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ApiHubPluginStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiHubPluginStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 ApiHubPluginSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ApiHubPluginSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(ApiHubPluginStubSettings.newBuilder(clientContext)); + } + + protected Builder(ApiHubPluginSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ApiHubPluginStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(ApiHubPluginStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(ApiHubPluginStubSettings.newHttpJsonBuilder()); + } + + public ApiHubPluginStubSettings.Builder getStubSettingsBuilder() { + return ((ApiHubPluginStubSettings.Builder) getStubSettings()); + } + + /** + * 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) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to getPlugin. */ + public UnaryCallSettings.Builder getPluginSettings() { + return getStubSettingsBuilder().getPluginSettings(); + } + + /** Returns the builder for the settings used for calls to enablePlugin. */ + public UnaryCallSettings.Builder enablePluginSettings() { + return getStubSettingsBuilder().enablePluginSettings(); + } + + /** Returns the builder for the settings used for calls to disablePlugin. */ + public UnaryCallSettings.Builder disablePluginSettings() { + return getStubSettingsBuilder().disablePluginSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + @Override + public ApiHubPluginSettings build() throws IOException { + return new ApiHubPluginSettings(this); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ApiHubSettings.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ApiHubSettings.java new file mode 100644 index 000000000000..ccd7612346e8 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ApiHubSettings.java @@ -0,0 +1,612 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import static com.google.cloud.apihub.v1.ApiHubClient.ListApiOperationsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListApisPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListAttributesPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListDeploymentsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListExternalApisPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListLocationsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListSpecsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListVersionsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.SearchResourcesPagedResponse; + +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.httpjson.InstantiatingHttpJsonChannelProvider; +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.apihub.v1.stub.ApiHubStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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 ApiHubClient}. + * + *

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

    + *
  • The default service address (apihub.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 createApi to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ApiHubSettings.Builder apiHubSettingsBuilder = ApiHubSettings.newBuilder();
+ * apiHubSettingsBuilder
+ *     .createApiSettings()
+ *     .setRetrySettings(
+ *         apiHubSettingsBuilder
+ *             .createApiSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ApiHubSettings apiHubSettings = apiHubSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class ApiHubSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createApi. */ + public UnaryCallSettings createApiSettings() { + return ((ApiHubStubSettings) getStubSettings()).createApiSettings(); + } + + /** Returns the object with the settings used for calls to getApi. */ + public UnaryCallSettings getApiSettings() { + return ((ApiHubStubSettings) getStubSettings()).getApiSettings(); + } + + /** Returns the object with the settings used for calls to listApis. */ + public PagedCallSettings + listApisSettings() { + return ((ApiHubStubSettings) getStubSettings()).listApisSettings(); + } + + /** Returns the object with the settings used for calls to updateApi. */ + public UnaryCallSettings updateApiSettings() { + return ((ApiHubStubSettings) getStubSettings()).updateApiSettings(); + } + + /** Returns the object with the settings used for calls to deleteApi. */ + public UnaryCallSettings deleteApiSettings() { + return ((ApiHubStubSettings) getStubSettings()).deleteApiSettings(); + } + + /** Returns the object with the settings used for calls to createVersion. */ + public UnaryCallSettings createVersionSettings() { + return ((ApiHubStubSettings) getStubSettings()).createVersionSettings(); + } + + /** Returns the object with the settings used for calls to getVersion. */ + public UnaryCallSettings getVersionSettings() { + return ((ApiHubStubSettings) getStubSettings()).getVersionSettings(); + } + + /** Returns the object with the settings used for calls to listVersions. */ + public PagedCallSettings + listVersionsSettings() { + return ((ApiHubStubSettings) getStubSettings()).listVersionsSettings(); + } + + /** Returns the object with the settings used for calls to updateVersion. */ + public UnaryCallSettings updateVersionSettings() { + return ((ApiHubStubSettings) getStubSettings()).updateVersionSettings(); + } + + /** Returns the object with the settings used for calls to deleteVersion. */ + public UnaryCallSettings deleteVersionSettings() { + return ((ApiHubStubSettings) getStubSettings()).deleteVersionSettings(); + } + + /** Returns the object with the settings used for calls to createSpec. */ + public UnaryCallSettings createSpecSettings() { + return ((ApiHubStubSettings) getStubSettings()).createSpecSettings(); + } + + /** Returns the object with the settings used for calls to getSpec. */ + public UnaryCallSettings getSpecSettings() { + return ((ApiHubStubSettings) getStubSettings()).getSpecSettings(); + } + + /** Returns the object with the settings used for calls to getSpecContents. */ + public UnaryCallSettings getSpecContentsSettings() { + return ((ApiHubStubSettings) getStubSettings()).getSpecContentsSettings(); + } + + /** Returns the object with the settings used for calls to listSpecs. */ + public PagedCallSettings + listSpecsSettings() { + return ((ApiHubStubSettings) getStubSettings()).listSpecsSettings(); + } + + /** Returns the object with the settings used for calls to updateSpec. */ + public UnaryCallSettings updateSpecSettings() { + return ((ApiHubStubSettings) getStubSettings()).updateSpecSettings(); + } + + /** Returns the object with the settings used for calls to deleteSpec. */ + public UnaryCallSettings deleteSpecSettings() { + return ((ApiHubStubSettings) getStubSettings()).deleteSpecSettings(); + } + + /** Returns the object with the settings used for calls to getApi. */ + public UnaryCallSettings getApiOperationSettings() { + return ((ApiHubStubSettings) getStubSettings()).getApiOperationSettings(); + } + + /** Returns the object with the settings used for calls to listApiOperations. */ + public PagedCallSettings< + ListApiOperationsRequest, ListApiOperationsResponse, ListApiOperationsPagedResponse> + listApiOperationsSettings() { + return ((ApiHubStubSettings) getStubSettings()).listApiOperationsSettings(); + } + + /** Returns the object with the settings used for calls to getDefinition. */ + public UnaryCallSettings getDefinitionSettings() { + return ((ApiHubStubSettings) getStubSettings()).getDefinitionSettings(); + } + + /** Returns the object with the settings used for calls to createDeployment. */ + public UnaryCallSettings createDeploymentSettings() { + return ((ApiHubStubSettings) getStubSettings()).createDeploymentSettings(); + } + + /** Returns the object with the settings used for calls to getDeployment. */ + public UnaryCallSettings getDeploymentSettings() { + return ((ApiHubStubSettings) getStubSettings()).getDeploymentSettings(); + } + + /** Returns the object with the settings used for calls to listDeployments. */ + public PagedCallSettings< + ListDeploymentsRequest, ListDeploymentsResponse, ListDeploymentsPagedResponse> + listDeploymentsSettings() { + return ((ApiHubStubSettings) getStubSettings()).listDeploymentsSettings(); + } + + /** Returns the object with the settings used for calls to updateDeployment. */ + public UnaryCallSettings updateDeploymentSettings() { + return ((ApiHubStubSettings) getStubSettings()).updateDeploymentSettings(); + } + + /** Returns the object with the settings used for calls to deleteDeployment. */ + public UnaryCallSettings deleteDeploymentSettings() { + return ((ApiHubStubSettings) getStubSettings()).deleteDeploymentSettings(); + } + + /** Returns the object with the settings used for calls to createAttribute. */ + public UnaryCallSettings createAttributeSettings() { + return ((ApiHubStubSettings) getStubSettings()).createAttributeSettings(); + } + + /** Returns the object with the settings used for calls to getAttribute. */ + public UnaryCallSettings getAttributeSettings() { + return ((ApiHubStubSettings) getStubSettings()).getAttributeSettings(); + } + + /** Returns the object with the settings used for calls to updateAttribute. */ + public UnaryCallSettings updateAttributeSettings() { + return ((ApiHubStubSettings) getStubSettings()).updateAttributeSettings(); + } + + /** Returns the object with the settings used for calls to deleteAttribute. */ + public UnaryCallSettings deleteAttributeSettings() { + return ((ApiHubStubSettings) getStubSettings()).deleteAttributeSettings(); + } + + /** Returns the object with the settings used for calls to listAttributes. */ + public PagedCallSettings< + ListAttributesRequest, ListAttributesResponse, ListAttributesPagedResponse> + listAttributesSettings() { + return ((ApiHubStubSettings) getStubSettings()).listAttributesSettings(); + } + + /** Returns the object with the settings used for calls to searchResources. */ + public PagedCallSettings< + SearchResourcesRequest, SearchResourcesResponse, SearchResourcesPagedResponse> + searchResourcesSettings() { + return ((ApiHubStubSettings) getStubSettings()).searchResourcesSettings(); + } + + /** Returns the object with the settings used for calls to createExternalApi. */ + public UnaryCallSettings createExternalApiSettings() { + return ((ApiHubStubSettings) getStubSettings()).createExternalApiSettings(); + } + + /** Returns the object with the settings used for calls to getExternalApi. */ + public UnaryCallSettings getExternalApiSettings() { + return ((ApiHubStubSettings) getStubSettings()).getExternalApiSettings(); + } + + /** Returns the object with the settings used for calls to updateExternalApi. */ + public UnaryCallSettings updateExternalApiSettings() { + return ((ApiHubStubSettings) getStubSettings()).updateExternalApiSettings(); + } + + /** Returns the object with the settings used for calls to deleteExternalApi. */ + public UnaryCallSettings deleteExternalApiSettings() { + return ((ApiHubStubSettings) getStubSettings()).deleteExternalApiSettings(); + } + + /** Returns the object with the settings used for calls to listExternalApis. */ + public PagedCallSettings< + ListExternalApisRequest, ListExternalApisResponse, ListExternalApisPagedResponse> + listExternalApisSettings() { + return ((ApiHubStubSettings) getStubSettings()).listExternalApisSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((ApiHubStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((ApiHubStubSettings) getStubSettings()).getLocationSettings(); + } + + public static final ApiHubSettings create(ApiHubStubSettings stub) throws IOException { + return new ApiHubSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ApiHubStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ApiHubStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ApiHubStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ApiHubStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ApiHubStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return ApiHubStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ApiHubStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiHubStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 ApiHubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ApiHubSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(ApiHubStubSettings.newBuilder(clientContext)); + } + + protected Builder(ApiHubSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ApiHubStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(ApiHubStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(ApiHubStubSettings.newHttpJsonBuilder()); + } + + public ApiHubStubSettings.Builder getStubSettingsBuilder() { + return ((ApiHubStubSettings.Builder) getStubSettings()); + } + + /** + * 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) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createApi. */ + public UnaryCallSettings.Builder createApiSettings() { + return getStubSettingsBuilder().createApiSettings(); + } + + /** Returns the builder for the settings used for calls to getApi. */ + public UnaryCallSettings.Builder getApiSettings() { + return getStubSettingsBuilder().getApiSettings(); + } + + /** Returns the builder for the settings used for calls to listApis. */ + public PagedCallSettings.Builder + listApisSettings() { + return getStubSettingsBuilder().listApisSettings(); + } + + /** Returns the builder for the settings used for calls to updateApi. */ + public UnaryCallSettings.Builder updateApiSettings() { + return getStubSettingsBuilder().updateApiSettings(); + } + + /** Returns the builder for the settings used for calls to deleteApi. */ + public UnaryCallSettings.Builder deleteApiSettings() { + return getStubSettingsBuilder().deleteApiSettings(); + } + + /** Returns the builder for the settings used for calls to createVersion. */ + public UnaryCallSettings.Builder createVersionSettings() { + return getStubSettingsBuilder().createVersionSettings(); + } + + /** Returns the builder for the settings used for calls to getVersion. */ + public UnaryCallSettings.Builder getVersionSettings() { + return getStubSettingsBuilder().getVersionSettings(); + } + + /** Returns the builder for the settings used for calls to listVersions. */ + public PagedCallSettings.Builder< + ListVersionsRequest, ListVersionsResponse, ListVersionsPagedResponse> + listVersionsSettings() { + return getStubSettingsBuilder().listVersionsSettings(); + } + + /** Returns the builder for the settings used for calls to updateVersion. */ + public UnaryCallSettings.Builder updateVersionSettings() { + return getStubSettingsBuilder().updateVersionSettings(); + } + + /** Returns the builder for the settings used for calls to deleteVersion. */ + public UnaryCallSettings.Builder deleteVersionSettings() { + return getStubSettingsBuilder().deleteVersionSettings(); + } + + /** Returns the builder for the settings used for calls to createSpec. */ + public UnaryCallSettings.Builder createSpecSettings() { + return getStubSettingsBuilder().createSpecSettings(); + } + + /** Returns the builder for the settings used for calls to getSpec. */ + public UnaryCallSettings.Builder getSpecSettings() { + return getStubSettingsBuilder().getSpecSettings(); + } + + /** Returns the builder for the settings used for calls to getSpecContents. */ + public UnaryCallSettings.Builder + getSpecContentsSettings() { + return getStubSettingsBuilder().getSpecContentsSettings(); + } + + /** Returns the builder for the settings used for calls to listSpecs. */ + public PagedCallSettings.Builder + listSpecsSettings() { + return getStubSettingsBuilder().listSpecsSettings(); + } + + /** Returns the builder for the settings used for calls to updateSpec. */ + public UnaryCallSettings.Builder updateSpecSettings() { + return getStubSettingsBuilder().updateSpecSettings(); + } + + /** Returns the builder for the settings used for calls to deleteSpec. */ + public UnaryCallSettings.Builder deleteSpecSettings() { + return getStubSettingsBuilder().deleteSpecSettings(); + } + + /** Returns the builder for the settings used for calls to getApi. */ + public UnaryCallSettings.Builder + getApiOperationSettings() { + return getStubSettingsBuilder().getApiOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listApiOperations. */ + public PagedCallSettings.Builder< + ListApiOperationsRequest, ListApiOperationsResponse, ListApiOperationsPagedResponse> + listApiOperationsSettings() { + return getStubSettingsBuilder().listApiOperationsSettings(); + } + + /** Returns the builder for the settings used for calls to getDefinition. */ + public UnaryCallSettings.Builder getDefinitionSettings() { + return getStubSettingsBuilder().getDefinitionSettings(); + } + + /** Returns the builder for the settings used for calls to createDeployment. */ + public UnaryCallSettings.Builder + createDeploymentSettings() { + return getStubSettingsBuilder().createDeploymentSettings(); + } + + /** Returns the builder for the settings used for calls to getDeployment. */ + public UnaryCallSettings.Builder getDeploymentSettings() { + return getStubSettingsBuilder().getDeploymentSettings(); + } + + /** Returns the builder for the settings used for calls to listDeployments. */ + public PagedCallSettings.Builder< + ListDeploymentsRequest, ListDeploymentsResponse, ListDeploymentsPagedResponse> + listDeploymentsSettings() { + return getStubSettingsBuilder().listDeploymentsSettings(); + } + + /** Returns the builder for the settings used for calls to updateDeployment. */ + public UnaryCallSettings.Builder + updateDeploymentSettings() { + return getStubSettingsBuilder().updateDeploymentSettings(); + } + + /** Returns the builder for the settings used for calls to deleteDeployment. */ + public UnaryCallSettings.Builder deleteDeploymentSettings() { + return getStubSettingsBuilder().deleteDeploymentSettings(); + } + + /** Returns the builder for the settings used for calls to createAttribute. */ + public UnaryCallSettings.Builder createAttributeSettings() { + return getStubSettingsBuilder().createAttributeSettings(); + } + + /** Returns the builder for the settings used for calls to getAttribute. */ + public UnaryCallSettings.Builder getAttributeSettings() { + return getStubSettingsBuilder().getAttributeSettings(); + } + + /** Returns the builder for the settings used for calls to updateAttribute. */ + public UnaryCallSettings.Builder updateAttributeSettings() { + return getStubSettingsBuilder().updateAttributeSettings(); + } + + /** Returns the builder for the settings used for calls to deleteAttribute. */ + public UnaryCallSettings.Builder deleteAttributeSettings() { + return getStubSettingsBuilder().deleteAttributeSettings(); + } + + /** Returns the builder for the settings used for calls to listAttributes. */ + public PagedCallSettings.Builder< + ListAttributesRequest, ListAttributesResponse, ListAttributesPagedResponse> + listAttributesSettings() { + return getStubSettingsBuilder().listAttributesSettings(); + } + + /** Returns the builder for the settings used for calls to searchResources. */ + public PagedCallSettings.Builder< + SearchResourcesRequest, SearchResourcesResponse, SearchResourcesPagedResponse> + searchResourcesSettings() { + return getStubSettingsBuilder().searchResourcesSettings(); + } + + /** Returns the builder for the settings used for calls to createExternalApi. */ + public UnaryCallSettings.Builder + createExternalApiSettings() { + return getStubSettingsBuilder().createExternalApiSettings(); + } + + /** Returns the builder for the settings used for calls to getExternalApi. */ + public UnaryCallSettings.Builder getExternalApiSettings() { + return getStubSettingsBuilder().getExternalApiSettings(); + } + + /** Returns the builder for the settings used for calls to updateExternalApi. */ + public UnaryCallSettings.Builder + updateExternalApiSettings() { + return getStubSettingsBuilder().updateExternalApiSettings(); + } + + /** Returns the builder for the settings used for calls to deleteExternalApi. */ + public UnaryCallSettings.Builder deleteExternalApiSettings() { + return getStubSettingsBuilder().deleteExternalApiSettings(); + } + + /** Returns the builder for the settings used for calls to listExternalApis. */ + public PagedCallSettings.Builder< + ListExternalApisRequest, ListExternalApisResponse, ListExternalApisPagedResponse> + listExternalApisSettings() { + return getStubSettingsBuilder().listExternalApisSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + @Override + public ApiHubSettings build() throws IOException { + return new ApiHubSettings(this); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/HostProjectRegistrationServiceClient.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/HostProjectRegistrationServiceClient.java new file mode 100644 index 000000000000..933595c91d75 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/HostProjectRegistrationServiceClient.java @@ -0,0 +1,1132 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +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.cloud.apihub.v1.stub.HostProjectRegistrationServiceStub; +import com.google.cloud.apihub.v1.stub.HostProjectRegistrationServiceStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: This service is used for managing the host project registrations. + * + *

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
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient =
+ *     HostProjectRegistrationServiceClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   HostProjectRegistration hostProjectRegistration =
+ *       HostProjectRegistration.newBuilder().build();
+ *   String hostProjectRegistrationId = "hostProjectRegistrationId1352651365";
+ *   HostProjectRegistration response =
+ *       hostProjectRegistrationServiceClient.createHostProjectRegistration(
+ *           parent, hostProjectRegistration, hostProjectRegistrationId);
+ * }
+ * }
+ * + *

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

CreateHostProjectRegistration

Create a host project registration. A Google cloud project can be registered as a host project if it is not attached as a runtime project to another host project. A project can be registered as a host project only once. Subsequent register calls for the same project will fail.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createHostProjectRegistration(CreateHostProjectRegistrationRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • createHostProjectRegistration(LocationName parent, HostProjectRegistration hostProjectRegistration, String hostProjectRegistrationId) + *

  • createHostProjectRegistration(String parent, HostProjectRegistration hostProjectRegistration, String hostProjectRegistrationId) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createHostProjectRegistrationCallable() + *

+ *

GetHostProjectRegistration

Get a host project registration.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getHostProjectRegistration(GetHostProjectRegistrationRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getHostProjectRegistration(HostProjectRegistrationName name) + *

  • getHostProjectRegistration(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getHostProjectRegistrationCallable() + *

+ *

ListHostProjectRegistrations

Lists host project registrations.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listHostProjectRegistrations(ListHostProjectRegistrationsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listHostProjectRegistrations(LocationName parent) + *

  • listHostProjectRegistrations(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listHostProjectRegistrationsPagedCallable() + *

  • listHostProjectRegistrationsCallable() + *

+ *

ListLocations

Lists information about the supported locations for this service.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listLocations(ListLocationsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listLocationsPagedCallable() + *

  • listLocationsCallable() + *

+ *

GetLocation

Gets information about a location.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getLocation(GetLocationRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getLocationCallable() + *

+ *
+ * + *

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 + * HostProjectRegistrationServiceSettings to create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * HostProjectRegistrationServiceSettings hostProjectRegistrationServiceSettings =
+ *     HostProjectRegistrationServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient =
+ *     HostProjectRegistrationServiceClient.create(hostProjectRegistrationServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * HostProjectRegistrationServiceSettings hostProjectRegistrationServiceSettings =
+ *     HostProjectRegistrationServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient =
+ *     HostProjectRegistrationServiceClient.create(hostProjectRegistrationServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * HostProjectRegistrationServiceSettings hostProjectRegistrationServiceSettings =
+ *     HostProjectRegistrationServiceSettings.newHttpJsonBuilder().build();
+ * HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient =
+ *     HostProjectRegistrationServiceClient.create(hostProjectRegistrationServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class HostProjectRegistrationServiceClient implements BackgroundResource { + private final HostProjectRegistrationServiceSettings settings; + private final HostProjectRegistrationServiceStub stub; + + /** Constructs an instance of HostProjectRegistrationServiceClient with default settings. */ + public static final HostProjectRegistrationServiceClient create() throws IOException { + return create(HostProjectRegistrationServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of HostProjectRegistrationServiceClient, 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 HostProjectRegistrationServiceClient create( + HostProjectRegistrationServiceSettings settings) throws IOException { + return new HostProjectRegistrationServiceClient(settings); + } + + /** + * Constructs an instance of HostProjectRegistrationServiceClient, using the given stub for making + * calls. This is for advanced usage - prefer using + * create(HostProjectRegistrationServiceSettings). + */ + public static final HostProjectRegistrationServiceClient create( + HostProjectRegistrationServiceStub stub) { + return new HostProjectRegistrationServiceClient(stub); + } + + /** + * Constructs an instance of HostProjectRegistrationServiceClient, 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 HostProjectRegistrationServiceClient(HostProjectRegistrationServiceSettings settings) + throws IOException { + this.settings = settings; + this.stub = + ((HostProjectRegistrationServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected HostProjectRegistrationServiceClient(HostProjectRegistrationServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final HostProjectRegistrationServiceSettings getSettings() { + return settings; + } + + public HostProjectRegistrationServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a host project registration. A Google cloud project can be registered as a host project + * if it is not attached as a runtime project to another host project. A project can be registered + * as a host project only once. Subsequent register calls for the same project will fail. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient =
+   *     HostProjectRegistrationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   HostProjectRegistration hostProjectRegistration =
+   *       HostProjectRegistration.newBuilder().build();
+   *   String hostProjectRegistrationId = "hostProjectRegistrationId1352651365";
+   *   HostProjectRegistration response =
+   *       hostProjectRegistrationServiceClient.createHostProjectRegistration(
+   *           parent, hostProjectRegistration, hostProjectRegistrationId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource for the host project. Format: + * `projects/{project}/locations/{location}` + * @param hostProjectRegistration Required. The host project registration to register. + * @param hostProjectRegistrationId Required. The ID to use for the Host Project Registration, + * which will become the final component of the host project registration's resource name. The + * ID must be the same as the Google cloud project specified in the + * host_project_registration.gcp_project field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final HostProjectRegistration createHostProjectRegistration( + LocationName parent, + HostProjectRegistration hostProjectRegistration, + String hostProjectRegistrationId) { + CreateHostProjectRegistrationRequest request = + CreateHostProjectRegistrationRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setHostProjectRegistration(hostProjectRegistration) + .setHostProjectRegistrationId(hostProjectRegistrationId) + .build(); + return createHostProjectRegistration(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a host project registration. A Google cloud project can be registered as a host project + * if it is not attached as a runtime project to another host project. A project can be registered + * as a host project only once. Subsequent register calls for the same project will fail. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient =
+   *     HostProjectRegistrationServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   HostProjectRegistration hostProjectRegistration =
+   *       HostProjectRegistration.newBuilder().build();
+   *   String hostProjectRegistrationId = "hostProjectRegistrationId1352651365";
+   *   HostProjectRegistration response =
+   *       hostProjectRegistrationServiceClient.createHostProjectRegistration(
+   *           parent, hostProjectRegistration, hostProjectRegistrationId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource for the host project. Format: + * `projects/{project}/locations/{location}` + * @param hostProjectRegistration Required. The host project registration to register. + * @param hostProjectRegistrationId Required. The ID to use for the Host Project Registration, + * which will become the final component of the host project registration's resource name. The + * ID must be the same as the Google cloud project specified in the + * host_project_registration.gcp_project field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final HostProjectRegistration createHostProjectRegistration( + String parent, + HostProjectRegistration hostProjectRegistration, + String hostProjectRegistrationId) { + CreateHostProjectRegistrationRequest request = + CreateHostProjectRegistrationRequest.newBuilder() + .setParent(parent) + .setHostProjectRegistration(hostProjectRegistration) + .setHostProjectRegistrationId(hostProjectRegistrationId) + .build(); + return createHostProjectRegistration(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a host project registration. A Google cloud project can be registered as a host project + * if it is not attached as a runtime project to another host project. A project can be registered + * as a host project only once. Subsequent register calls for the same project will fail. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient =
+   *     HostProjectRegistrationServiceClient.create()) {
+   *   CreateHostProjectRegistrationRequest request =
+   *       CreateHostProjectRegistrationRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setHostProjectRegistrationId("hostProjectRegistrationId1352651365")
+   *           .setHostProjectRegistration(HostProjectRegistration.newBuilder().build())
+   *           .build();
+   *   HostProjectRegistration response =
+   *       hostProjectRegistrationServiceClient.createHostProjectRegistration(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 HostProjectRegistration createHostProjectRegistration( + CreateHostProjectRegistrationRequest request) { + return createHostProjectRegistrationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a host project registration. A Google cloud project can be registered as a host project + * if it is not attached as a runtime project to another host project. A project can be registered + * as a host project only once. Subsequent register calls for the same project will fail. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient =
+   *     HostProjectRegistrationServiceClient.create()) {
+   *   CreateHostProjectRegistrationRequest request =
+   *       CreateHostProjectRegistrationRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setHostProjectRegistrationId("hostProjectRegistrationId1352651365")
+   *           .setHostProjectRegistration(HostProjectRegistration.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       hostProjectRegistrationServiceClient
+   *           .createHostProjectRegistrationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   HostProjectRegistration response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createHostProjectRegistrationCallable() { + return stub.createHostProjectRegistrationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a host project registration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient =
+   *     HostProjectRegistrationServiceClient.create()) {
+   *   HostProjectRegistrationName name =
+   *       HostProjectRegistrationName.of("[PROJECT]", "[LOCATION]", "[HOST_PROJECT_REGISTRATION]");
+   *   HostProjectRegistration response =
+   *       hostProjectRegistrationServiceClient.getHostProjectRegistration(name);
+   * }
+   * }
+ * + * @param name Required. Host project registration resource name. + * projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_id} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final HostProjectRegistration getHostProjectRegistration( + HostProjectRegistrationName name) { + GetHostProjectRegistrationRequest request = + GetHostProjectRegistrationRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getHostProjectRegistration(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a host project registration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient =
+   *     HostProjectRegistrationServiceClient.create()) {
+   *   String name =
+   *       HostProjectRegistrationName.of("[PROJECT]", "[LOCATION]", "[HOST_PROJECT_REGISTRATION]")
+   *           .toString();
+   *   HostProjectRegistration response =
+   *       hostProjectRegistrationServiceClient.getHostProjectRegistration(name);
+   * }
+   * }
+ * + * @param name Required. Host project registration resource name. + * projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_id} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final HostProjectRegistration getHostProjectRegistration(String name) { + GetHostProjectRegistrationRequest request = + GetHostProjectRegistrationRequest.newBuilder().setName(name).build(); + return getHostProjectRegistration(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a host project registration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient =
+   *     HostProjectRegistrationServiceClient.create()) {
+   *   GetHostProjectRegistrationRequest request =
+   *       GetHostProjectRegistrationRequest.newBuilder()
+   *           .setName(
+   *               HostProjectRegistrationName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[HOST_PROJECT_REGISTRATION]")
+   *                   .toString())
+   *           .build();
+   *   HostProjectRegistration response =
+   *       hostProjectRegistrationServiceClient.getHostProjectRegistration(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 HostProjectRegistration getHostProjectRegistration( + GetHostProjectRegistrationRequest request) { + return getHostProjectRegistrationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a host project registration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient =
+   *     HostProjectRegistrationServiceClient.create()) {
+   *   GetHostProjectRegistrationRequest request =
+   *       GetHostProjectRegistrationRequest.newBuilder()
+   *           .setName(
+   *               HostProjectRegistrationName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[HOST_PROJECT_REGISTRATION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       hostProjectRegistrationServiceClient
+   *           .getHostProjectRegistrationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   HostProjectRegistration response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getHostProjectRegistrationCallable() { + return stub.getHostProjectRegistrationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists host project registrations. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient =
+   *     HostProjectRegistrationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (HostProjectRegistration element :
+   *       hostProjectRegistrationServiceClient.listHostProjectRegistrations(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of host projects. Format: + * `projects/*/locations/*` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListHostProjectRegistrationsPagedResponse listHostProjectRegistrations( + LocationName parent) { + ListHostProjectRegistrationsRequest request = + ListHostProjectRegistrationsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listHostProjectRegistrations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists host project registrations. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient =
+   *     HostProjectRegistrationServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (HostProjectRegistration element :
+   *       hostProjectRegistrationServiceClient.listHostProjectRegistrations(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of host projects. Format: + * `projects/*/locations/*` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListHostProjectRegistrationsPagedResponse listHostProjectRegistrations( + String parent) { + ListHostProjectRegistrationsRequest request = + ListHostProjectRegistrationsRequest.newBuilder().setParent(parent).build(); + return listHostProjectRegistrations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists host project registrations. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient =
+   *     HostProjectRegistrationServiceClient.create()) {
+   *   ListHostProjectRegistrationsRequest request =
+   *       ListHostProjectRegistrationsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (HostProjectRegistration element :
+   *       hostProjectRegistrationServiceClient.listHostProjectRegistrations(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 ListHostProjectRegistrationsPagedResponse listHostProjectRegistrations( + ListHostProjectRegistrationsRequest request) { + return listHostProjectRegistrationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists host project registrations. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient =
+   *     HostProjectRegistrationServiceClient.create()) {
+   *   ListHostProjectRegistrationsRequest request =
+   *       ListHostProjectRegistrationsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       hostProjectRegistrationServiceClient
+   *           .listHostProjectRegistrationsPagedCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   for (HostProjectRegistration element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable< + ListHostProjectRegistrationsRequest, ListHostProjectRegistrationsPagedResponse> + listHostProjectRegistrationsPagedCallable() { + return stub.listHostProjectRegistrationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists host project registrations. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient =
+   *     HostProjectRegistrationServiceClient.create()) {
+   *   ListHostProjectRegistrationsRequest request =
+   *       ListHostProjectRegistrationsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListHostProjectRegistrationsResponse response =
+   *         hostProjectRegistrationServiceClient
+   *             .listHostProjectRegistrationsCallable()
+   *             .call(request);
+   *     for (HostProjectRegistration element : response.getHostProjectRegistrationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable< + ListHostProjectRegistrationsRequest, ListHostProjectRegistrationsResponse> + listHostProjectRegistrationsCallable() { + return stub.listHostProjectRegistrationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient =
+   *     HostProjectRegistrationServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element :
+   *       hostProjectRegistrationServiceClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient =
+   *     HostProjectRegistrationServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       hostProjectRegistrationServiceClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient =
+   *     HostProjectRegistrationServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response =
+   *         hostProjectRegistrationServiceClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient =
+   *     HostProjectRegistrationServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = hostProjectRegistrationServiceClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient =
+   *     HostProjectRegistrationServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future =
+   *       hostProjectRegistrationServiceClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + @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 ListHostProjectRegistrationsPagedResponse + extends AbstractPagedListResponse< + ListHostProjectRegistrationsRequest, + ListHostProjectRegistrationsResponse, + HostProjectRegistration, + ListHostProjectRegistrationsPage, + ListHostProjectRegistrationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListHostProjectRegistrationsRequest, + ListHostProjectRegistrationsResponse, + HostProjectRegistration> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListHostProjectRegistrationsPage.createEmptyPage() + .createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListHostProjectRegistrationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListHostProjectRegistrationsPagedResponse(ListHostProjectRegistrationsPage page) { + super(page, ListHostProjectRegistrationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListHostProjectRegistrationsPage + extends AbstractPage< + ListHostProjectRegistrationsRequest, + ListHostProjectRegistrationsResponse, + HostProjectRegistration, + ListHostProjectRegistrationsPage> { + + private ListHostProjectRegistrationsPage( + PageContext< + ListHostProjectRegistrationsRequest, + ListHostProjectRegistrationsResponse, + HostProjectRegistration> + context, + ListHostProjectRegistrationsResponse response) { + super(context, response); + } + + private static ListHostProjectRegistrationsPage createEmptyPage() { + return new ListHostProjectRegistrationsPage(null, null); + } + + @Override + protected ListHostProjectRegistrationsPage createPage( + PageContext< + ListHostProjectRegistrationsRequest, + ListHostProjectRegistrationsResponse, + HostProjectRegistration> + context, + ListHostProjectRegistrationsResponse response) { + return new ListHostProjectRegistrationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListHostProjectRegistrationsRequest, + ListHostProjectRegistrationsResponse, + HostProjectRegistration> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListHostProjectRegistrationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListHostProjectRegistrationsRequest, + ListHostProjectRegistrationsResponse, + HostProjectRegistration, + ListHostProjectRegistrationsPage, + ListHostProjectRegistrationsFixedSizeCollection> { + + private ListHostProjectRegistrationsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListHostProjectRegistrationsFixedSizeCollection createEmptyCollection() { + return new ListHostProjectRegistrationsFixedSizeCollection(null, 0); + } + + @Override + protected ListHostProjectRegistrationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListHostProjectRegistrationsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/HostProjectRegistrationServiceSettings.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/HostProjectRegistrationServiceSettings.java new file mode 100644 index 000000000000..26b700314202 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/HostProjectRegistrationServiceSettings.java @@ -0,0 +1,271 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import static com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient.ListHostProjectRegistrationsPagedResponse; +import static com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient.ListLocationsPagedResponse; + +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.httpjson.InstantiatingHttpJsonChannelProvider; +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.apihub.v1.stub.HostProjectRegistrationServiceStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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 HostProjectRegistrationServiceClient}. + * + *

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

    + *
  • The default service address (apihub.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 createHostProjectRegistration to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * HostProjectRegistrationServiceSettings.Builder hostProjectRegistrationServiceSettingsBuilder =
+ *     HostProjectRegistrationServiceSettings.newBuilder();
+ * hostProjectRegistrationServiceSettingsBuilder
+ *     .createHostProjectRegistrationSettings()
+ *     .setRetrySettings(
+ *         hostProjectRegistrationServiceSettingsBuilder
+ *             .createHostProjectRegistrationSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * HostProjectRegistrationServiceSettings hostProjectRegistrationServiceSettings =
+ *     hostProjectRegistrationServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class HostProjectRegistrationServiceSettings + extends ClientSettings { + + /** Returns the object with the settings used for calls to createHostProjectRegistration. */ + public UnaryCallSettings + createHostProjectRegistrationSettings() { + return ((HostProjectRegistrationServiceStubSettings) getStubSettings()) + .createHostProjectRegistrationSettings(); + } + + /** Returns the object with the settings used for calls to getHostProjectRegistration. */ + public UnaryCallSettings + getHostProjectRegistrationSettings() { + return ((HostProjectRegistrationServiceStubSettings) getStubSettings()) + .getHostProjectRegistrationSettings(); + } + + /** Returns the object with the settings used for calls to listHostProjectRegistrations. */ + public PagedCallSettings< + ListHostProjectRegistrationsRequest, + ListHostProjectRegistrationsResponse, + ListHostProjectRegistrationsPagedResponse> + listHostProjectRegistrationsSettings() { + return ((HostProjectRegistrationServiceStubSettings) getStubSettings()) + .listHostProjectRegistrationsSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((HostProjectRegistrationServiceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((HostProjectRegistrationServiceStubSettings) getStubSettings()).getLocationSettings(); + } + + public static final HostProjectRegistrationServiceSettings create( + HostProjectRegistrationServiceStubSettings stub) throws IOException { + return new HostProjectRegistrationServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return HostProjectRegistrationServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return HostProjectRegistrationServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return HostProjectRegistrationServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return HostProjectRegistrationServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return HostProjectRegistrationServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return HostProjectRegistrationServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return HostProjectRegistrationServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return HostProjectRegistrationServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 HostProjectRegistrationServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for HostProjectRegistrationServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(HostProjectRegistrationServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(HostProjectRegistrationServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(HostProjectRegistrationServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(HostProjectRegistrationServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(HostProjectRegistrationServiceStubSettings.newHttpJsonBuilder()); + } + + public HostProjectRegistrationServiceStubSettings.Builder getStubSettingsBuilder() { + return ((HostProjectRegistrationServiceStubSettings.Builder) getStubSettings()); + } + + /** + * 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) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createHostProjectRegistration. */ + public UnaryCallSettings.Builder + createHostProjectRegistrationSettings() { + return getStubSettingsBuilder().createHostProjectRegistrationSettings(); + } + + /** Returns the builder for the settings used for calls to getHostProjectRegistration. */ + public UnaryCallSettings.Builder + getHostProjectRegistrationSettings() { + return getStubSettingsBuilder().getHostProjectRegistrationSettings(); + } + + /** Returns the builder for the settings used for calls to listHostProjectRegistrations. */ + public PagedCallSettings.Builder< + ListHostProjectRegistrationsRequest, + ListHostProjectRegistrationsResponse, + ListHostProjectRegistrationsPagedResponse> + listHostProjectRegistrationsSettings() { + return getStubSettingsBuilder().listHostProjectRegistrationsSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + @Override + public HostProjectRegistrationServiceSettings build() throws IOException { + return new HostProjectRegistrationServiceSettings(this); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/LintingServiceClient.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/LintingServiceClient.java new file mode 100644 index 000000000000..20c384902aea --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/LintingServiceClient.java @@ -0,0 +1,911 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +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.cloud.apihub.v1.stub.LintingServiceStub; +import com.google.cloud.apihub.v1.stub.LintingServiceStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +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: This service provides all methods related to the 1p Linter. + * + *

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
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) {
+ *   StyleGuideName name = StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]");
+ *   StyleGuide response = lintingServiceClient.getStyleGuide(name);
+ * }
+ * }
+ * + *

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

GetStyleGuide

Get the style guide being used for linting.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getStyleGuide(GetStyleGuideRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getStyleGuide(StyleGuideName name) + *

  • getStyleGuide(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getStyleGuideCallable() + *

+ *

UpdateStyleGuide

Update the styleGuide to be used for liniting in by API hub.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateStyleGuide(UpdateStyleGuideRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • updateStyleGuide(StyleGuide styleGuide, FieldMask updateMask) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateStyleGuideCallable() + *

+ *

GetStyleGuideContents

Get the contents of the style guide.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getStyleGuideContents(GetStyleGuideContentsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getStyleGuideContents(StyleGuideName name) + *

  • getStyleGuideContents(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getStyleGuideContentsCallable() + *

+ *

LintSpec

Lints the requested spec and updates the corresponding API Spec with the lint response. This lint response will be available in all subsequent Get and List Spec calls to Core service.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • lintSpec(LintSpecRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • lintSpecCallable() + *

+ *

ListLocations

Lists information about the supported locations for this service.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listLocations(ListLocationsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listLocationsPagedCallable() + *

  • listLocationsCallable() + *

+ *

GetLocation

Gets information about a location.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getLocation(GetLocationRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getLocationCallable() + *

+ *
+ * + *

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 LintingServiceSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * LintingServiceSettings lintingServiceSettings =
+ *     LintingServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * LintingServiceClient lintingServiceClient = LintingServiceClient.create(lintingServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * LintingServiceSettings lintingServiceSettings =
+ *     LintingServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * LintingServiceClient lintingServiceClient = LintingServiceClient.create(lintingServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * LintingServiceSettings lintingServiceSettings =
+ *     LintingServiceSettings.newHttpJsonBuilder().build();
+ * LintingServiceClient lintingServiceClient = LintingServiceClient.create(lintingServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class LintingServiceClient implements BackgroundResource { + private final LintingServiceSettings settings; + private final LintingServiceStub stub; + + /** Constructs an instance of LintingServiceClient with default settings. */ + public static final LintingServiceClient create() throws IOException { + return create(LintingServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of LintingServiceClient, 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 LintingServiceClient create(LintingServiceSettings settings) + throws IOException { + return new LintingServiceClient(settings); + } + + /** + * Constructs an instance of LintingServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(LintingServiceSettings). + */ + public static final LintingServiceClient create(LintingServiceStub stub) { + return new LintingServiceClient(stub); + } + + /** + * Constructs an instance of LintingServiceClient, 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 LintingServiceClient(LintingServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((LintingServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected LintingServiceClient(LintingServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final LintingServiceSettings getSettings() { + return settings; + } + + public LintingServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get the style guide being used for linting. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) {
+   *   StyleGuideName name = StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]");
+   *   StyleGuide response = lintingServiceClient.getStyleGuide(name);
+   * }
+   * }
+ * + * @param name Required. The name of the spec to retrieve. Format: + * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final StyleGuide getStyleGuide(StyleGuideName name) { + GetStyleGuideRequest request = + GetStyleGuideRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getStyleGuide(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get the style guide being used for linting. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) {
+   *   String name = StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString();
+   *   StyleGuide response = lintingServiceClient.getStyleGuide(name);
+   * }
+   * }
+ * + * @param name Required. The name of the spec to retrieve. Format: + * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final StyleGuide getStyleGuide(String name) { + GetStyleGuideRequest request = GetStyleGuideRequest.newBuilder().setName(name).build(); + return getStyleGuide(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get the style guide being used for linting. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) {
+   *   GetStyleGuideRequest request =
+   *       GetStyleGuideRequest.newBuilder()
+   *           .setName(StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString())
+   *           .build();
+   *   StyleGuide response = lintingServiceClient.getStyleGuide(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 StyleGuide getStyleGuide(GetStyleGuideRequest request) { + return getStyleGuideCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get the style guide being used for linting. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) {
+   *   GetStyleGuideRequest request =
+   *       GetStyleGuideRequest.newBuilder()
+   *           .setName(StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       lintingServiceClient.getStyleGuideCallable().futureCall(request);
+   *   // Do something.
+   *   StyleGuide response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getStyleGuideCallable() { + return stub.getStyleGuideCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update the styleGuide to be used for liniting in by API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) {
+   *   StyleGuide styleGuide = StyleGuide.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   StyleGuide response = lintingServiceClient.updateStyleGuide(styleGuide, updateMask);
+   * }
+   * }
+ * + * @param styleGuide Required. The Style guide resource to update. + * @param updateMask Optional. The list of fields to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final StyleGuide updateStyleGuide(StyleGuide styleGuide, FieldMask updateMask) { + UpdateStyleGuideRequest request = + UpdateStyleGuideRequest.newBuilder() + .setStyleGuide(styleGuide) + .setUpdateMask(updateMask) + .build(); + return updateStyleGuide(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update the styleGuide to be used for liniting in by API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) {
+   *   UpdateStyleGuideRequest request =
+   *       UpdateStyleGuideRequest.newBuilder()
+   *           .setStyleGuide(StyleGuide.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   StyleGuide response = lintingServiceClient.updateStyleGuide(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 StyleGuide updateStyleGuide(UpdateStyleGuideRequest request) { + return updateStyleGuideCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update the styleGuide to be used for liniting in by API hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) {
+   *   UpdateStyleGuideRequest request =
+   *       UpdateStyleGuideRequest.newBuilder()
+   *           .setStyleGuide(StyleGuide.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       lintingServiceClient.updateStyleGuideCallable().futureCall(request);
+   *   // Do something.
+   *   StyleGuide response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateStyleGuideCallable() { + return stub.updateStyleGuideCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get the contents of the style guide. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) {
+   *   StyleGuideName name = StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]");
+   *   StyleGuideContents response = lintingServiceClient.getStyleGuideContents(name);
+   * }
+   * }
+ * + * @param name Required. The name of the StyleGuide whose contents need to be retrieved. There is + * exactly one style guide resource per project per location. The expected format is + * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final StyleGuideContents getStyleGuideContents(StyleGuideName name) { + GetStyleGuideContentsRequest request = + GetStyleGuideContentsRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getStyleGuideContents(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get the contents of the style guide. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) {
+   *   String name = StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString();
+   *   StyleGuideContents response = lintingServiceClient.getStyleGuideContents(name);
+   * }
+   * }
+ * + * @param name Required. The name of the StyleGuide whose contents need to be retrieved. There is + * exactly one style guide resource per project per location. The expected format is + * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final StyleGuideContents getStyleGuideContents(String name) { + GetStyleGuideContentsRequest request = + GetStyleGuideContentsRequest.newBuilder().setName(name).build(); + return getStyleGuideContents(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get the contents of the style guide. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) {
+   *   GetStyleGuideContentsRequest request =
+   *       GetStyleGuideContentsRequest.newBuilder()
+   *           .setName(StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString())
+   *           .build();
+   *   StyleGuideContents response = lintingServiceClient.getStyleGuideContents(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 StyleGuideContents getStyleGuideContents(GetStyleGuideContentsRequest request) { + return getStyleGuideContentsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get the contents of the style guide. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) {
+   *   GetStyleGuideContentsRequest request =
+   *       GetStyleGuideContentsRequest.newBuilder()
+   *           .setName(StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       lintingServiceClient.getStyleGuideContentsCallable().futureCall(request);
+   *   // Do something.
+   *   StyleGuideContents response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getStyleGuideContentsCallable() { + return stub.getStyleGuideContentsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lints the requested spec and updates the corresponding API Spec with the lint response. This + * lint response will be available in all subsequent Get and List Spec calls to Core service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) {
+   *   LintSpecRequest request =
+   *       LintSpecRequest.newBuilder()
+   *           .setName(
+   *               SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString())
+   *           .build();
+   *   lintingServiceClient.lintSpec(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 void lintSpec(LintSpecRequest request) { + lintSpecCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lints the requested spec and updates the corresponding API Spec with the lint response. This + * lint response will be available in all subsequent Get and List Spec calls to Core service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) {
+   *   LintSpecRequest request =
+   *       LintSpecRequest.newBuilder()
+   *           .setName(
+   *               SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString())
+   *           .build();
+   *   ApiFuture future = lintingServiceClient.lintSpecCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable lintSpecCallable() { + return stub.lintSpecCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : lintingServiceClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       lintingServiceClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response = lintingServiceClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = lintingServiceClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = lintingServiceClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + @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 ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/LintingServiceSettings.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/LintingServiceSettings.java new file mode 100644 index 000000000000..7a2a2fe5cb01 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/LintingServiceSettings.java @@ -0,0 +1,266 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import static com.google.cloud.apihub.v1.LintingServiceClient.ListLocationsPagedResponse; + +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.httpjson.InstantiatingHttpJsonChannelProvider; +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.apihub.v1.stub.LintingServiceStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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 LintingServiceClient}. + * + *

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

    + *
  • The default service address (apihub.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 getStyleGuide to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * LintingServiceSettings.Builder lintingServiceSettingsBuilder =
+ *     LintingServiceSettings.newBuilder();
+ * lintingServiceSettingsBuilder
+ *     .getStyleGuideSettings()
+ *     .setRetrySettings(
+ *         lintingServiceSettingsBuilder
+ *             .getStyleGuideSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * LintingServiceSettings lintingServiceSettings = lintingServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class LintingServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to getStyleGuide. */ + public UnaryCallSettings getStyleGuideSettings() { + return ((LintingServiceStubSettings) getStubSettings()).getStyleGuideSettings(); + } + + /** Returns the object with the settings used for calls to updateStyleGuide. */ + public UnaryCallSettings updateStyleGuideSettings() { + return ((LintingServiceStubSettings) getStubSettings()).updateStyleGuideSettings(); + } + + /** Returns the object with the settings used for calls to getStyleGuideContents. */ + public UnaryCallSettings + getStyleGuideContentsSettings() { + return ((LintingServiceStubSettings) getStubSettings()).getStyleGuideContentsSettings(); + } + + /** Returns the object with the settings used for calls to lintSpec. */ + public UnaryCallSettings lintSpecSettings() { + return ((LintingServiceStubSettings) getStubSettings()).lintSpecSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((LintingServiceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((LintingServiceStubSettings) getStubSettings()).getLocationSettings(); + } + + public static final LintingServiceSettings create(LintingServiceStubSettings stub) + throws IOException { + return new LintingServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return LintingServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return LintingServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return LintingServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return LintingServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return LintingServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return LintingServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return LintingServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return LintingServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 LintingServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for LintingServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(LintingServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(LintingServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(LintingServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(LintingServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(LintingServiceStubSettings.newHttpJsonBuilder()); + } + + public LintingServiceStubSettings.Builder getStubSettingsBuilder() { + return ((LintingServiceStubSettings.Builder) getStubSettings()); + } + + /** + * 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) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to getStyleGuide. */ + public UnaryCallSettings.Builder getStyleGuideSettings() { + return getStubSettingsBuilder().getStyleGuideSettings(); + } + + /** Returns the builder for the settings used for calls to updateStyleGuide. */ + public UnaryCallSettings.Builder + updateStyleGuideSettings() { + return getStubSettingsBuilder().updateStyleGuideSettings(); + } + + /** Returns the builder for the settings used for calls to getStyleGuideContents. */ + public UnaryCallSettings.Builder + getStyleGuideContentsSettings() { + return getStubSettingsBuilder().getStyleGuideContentsSettings(); + } + + /** Returns the builder for the settings used for calls to lintSpec. */ + public UnaryCallSettings.Builder lintSpecSettings() { + return getStubSettingsBuilder().lintSpecSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + @Override + public LintingServiceSettings build() throws IOException { + return new LintingServiceSettings(this); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ProvisioningClient.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ProvisioningClient.java new file mode 100644 index 000000000000..ff3912c70140 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ProvisioningClient.java @@ -0,0 +1,968 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +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.httpjson.longrunning.OperationsClient; +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.cloud.apihub.v1.stub.ProvisioningStub; +import com.google.cloud.apihub.v1.stub.ProvisioningStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: This service is used for managing the data plane provisioning of the API + * hub. + * + *

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
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ProvisioningClient provisioningClient = ProvisioningClient.create()) {
+ *   ApiHubInstanceName name =
+ *       ApiHubInstanceName.of("[PROJECT]", "[LOCATION]", "[API_HUB_INSTANCE]");
+ *   ApiHubInstance response = provisioningClient.getApiHubInstance(name);
+ * }
+ * }
+ * + *

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

CreateApiHubInstance

Provisions instance resources for the API Hub.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createApiHubInstanceAsync(CreateApiHubInstanceRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • createApiHubInstanceAsync(LocationName parent, ApiHubInstance apiHubInstance, String apiHubInstanceId) + *

  • createApiHubInstanceAsync(String parent, ApiHubInstance apiHubInstance, String apiHubInstanceId) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createApiHubInstanceOperationCallable() + *

  • createApiHubInstanceCallable() + *

+ *

GetApiHubInstance

Gets details of a single API Hub instance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getApiHubInstance(GetApiHubInstanceRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getApiHubInstance(ApiHubInstanceName name) + *

  • getApiHubInstance(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getApiHubInstanceCallable() + *

+ *

LookupApiHubInstance

Looks up an Api Hub instance in a given GCP project. There will always be only one Api Hub instance for a GCP project across all locations.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • lookupApiHubInstance(LookupApiHubInstanceRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • lookupApiHubInstance(LocationName parent) + *

  • lookupApiHubInstance(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • lookupApiHubInstanceCallable() + *

+ *

ListLocations

Lists information about the supported locations for this service.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listLocations(ListLocationsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listLocationsPagedCallable() + *

  • listLocationsCallable() + *

+ *

GetLocation

Gets information about a location.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getLocation(GetLocationRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getLocationCallable() + *

+ *
+ * + *

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 ProvisioningSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ProvisioningSettings provisioningSettings =
+ *     ProvisioningSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ProvisioningClient provisioningClient = ProvisioningClient.create(provisioningSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ProvisioningSettings provisioningSettings =
+ *     ProvisioningSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ProvisioningClient provisioningClient = ProvisioningClient.create(provisioningSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ProvisioningSettings provisioningSettings = ProvisioningSettings.newHttpJsonBuilder().build();
+ * ProvisioningClient provisioningClient = ProvisioningClient.create(provisioningSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class ProvisioningClient implements BackgroundResource { + private final ProvisioningSettings settings; + private final ProvisioningStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of ProvisioningClient with default settings. */ + public static final ProvisioningClient create() throws IOException { + return create(ProvisioningSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ProvisioningClient, 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 ProvisioningClient create(ProvisioningSettings settings) throws IOException { + return new ProvisioningClient(settings); + } + + /** + * Constructs an instance of ProvisioningClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(ProvisioningSettings). + */ + public static final ProvisioningClient create(ProvisioningStub stub) { + return new ProvisioningClient(stub); + } + + /** + * Constructs an instance of ProvisioningClient, 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 ProvisioningClient(ProvisioningSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ProvisioningStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected ProvisioningClient(ProvisioningStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final ProvisioningSettings getSettings() { + return settings; + } + + public ProvisioningStub 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 com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Provisions instance resources for the API Hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ProvisioningClient provisioningClient = ProvisioningClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ApiHubInstance apiHubInstance = ApiHubInstance.newBuilder().build();
+   *   String apiHubInstanceId = "apiHubInstanceId-1318600853";
+   *   ApiHubInstance response =
+   *       provisioningClient
+   *           .createApiHubInstanceAsync(parent, apiHubInstance, apiHubInstanceId)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. The parent resource for the Api Hub instance resource. Format: + * `projects/{project}/locations/{location}` + * @param apiHubInstance Required. The ApiHub instance. + * @param apiHubInstanceId Optional. Identifier to assign to the Api Hub instance. Must be unique + * within scope of the parent resource. If the field is not provided, system generated id will + * be used. + *

This value should be 4-40 characters, and valid characters are `/[a-z][A-Z][0-9]-_/`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createApiHubInstanceAsync( + LocationName parent, ApiHubInstance apiHubInstance, String apiHubInstanceId) { + CreateApiHubInstanceRequest request = + CreateApiHubInstanceRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setApiHubInstance(apiHubInstance) + .setApiHubInstanceId(apiHubInstanceId) + .build(); + return createApiHubInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Provisions instance resources for the API Hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ProvisioningClient provisioningClient = ProvisioningClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   ApiHubInstance apiHubInstance = ApiHubInstance.newBuilder().build();
+   *   String apiHubInstanceId = "apiHubInstanceId-1318600853";
+   *   ApiHubInstance response =
+   *       provisioningClient
+   *           .createApiHubInstanceAsync(parent, apiHubInstance, apiHubInstanceId)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. The parent resource for the Api Hub instance resource. Format: + * `projects/{project}/locations/{location}` + * @param apiHubInstance Required. The ApiHub instance. + * @param apiHubInstanceId Optional. Identifier to assign to the Api Hub instance. Must be unique + * within scope of the parent resource. If the field is not provided, system generated id will + * be used. + *

This value should be 4-40 characters, and valid characters are `/[a-z][A-Z][0-9]-_/`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createApiHubInstanceAsync( + String parent, ApiHubInstance apiHubInstance, String apiHubInstanceId) { + CreateApiHubInstanceRequest request = + CreateApiHubInstanceRequest.newBuilder() + .setParent(parent) + .setApiHubInstance(apiHubInstance) + .setApiHubInstanceId(apiHubInstanceId) + .build(); + return createApiHubInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Provisions instance resources for the API Hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ProvisioningClient provisioningClient = ProvisioningClient.create()) {
+   *   CreateApiHubInstanceRequest request =
+   *       CreateApiHubInstanceRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setApiHubInstanceId("apiHubInstanceId-1318600853")
+   *           .setApiHubInstance(ApiHubInstance.newBuilder().build())
+   *           .build();
+   *   ApiHubInstance response = provisioningClient.createApiHubInstanceAsync(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 createApiHubInstanceAsync( + CreateApiHubInstanceRequest request) { + return createApiHubInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Provisions instance resources for the API Hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ProvisioningClient provisioningClient = ProvisioningClient.create()) {
+   *   CreateApiHubInstanceRequest request =
+   *       CreateApiHubInstanceRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setApiHubInstanceId("apiHubInstanceId-1318600853")
+   *           .setApiHubInstance(ApiHubInstance.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       provisioningClient.createApiHubInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   ApiHubInstance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createApiHubInstanceOperationCallable() { + return stub.createApiHubInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Provisions instance resources for the API Hub. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ProvisioningClient provisioningClient = ProvisioningClient.create()) {
+   *   CreateApiHubInstanceRequest request =
+   *       CreateApiHubInstanceRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setApiHubInstanceId("apiHubInstanceId-1318600853")
+   *           .setApiHubInstance(ApiHubInstance.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       provisioningClient.createApiHubInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createApiHubInstanceCallable() { + return stub.createApiHubInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single API Hub instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ProvisioningClient provisioningClient = ProvisioningClient.create()) {
+   *   ApiHubInstanceName name =
+   *       ApiHubInstanceName.of("[PROJECT]", "[LOCATION]", "[API_HUB_INSTANCE]");
+   *   ApiHubInstance response = provisioningClient.getApiHubInstance(name);
+   * }
+   * }
+ * + * @param name Required. The name of the Api Hub instance to retrieve. Format: + * `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ApiHubInstance getApiHubInstance(ApiHubInstanceName name) { + GetApiHubInstanceRequest request = + GetApiHubInstanceRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getApiHubInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single API Hub instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ProvisioningClient provisioningClient = ProvisioningClient.create()) {
+   *   String name =
+   *       ApiHubInstanceName.of("[PROJECT]", "[LOCATION]", "[API_HUB_INSTANCE]").toString();
+   *   ApiHubInstance response = provisioningClient.getApiHubInstance(name);
+   * }
+   * }
+ * + * @param name Required. The name of the Api Hub instance to retrieve. Format: + * `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ApiHubInstance getApiHubInstance(String name) { + GetApiHubInstanceRequest request = GetApiHubInstanceRequest.newBuilder().setName(name).build(); + return getApiHubInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single API Hub instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ProvisioningClient provisioningClient = ProvisioningClient.create()) {
+   *   GetApiHubInstanceRequest request =
+   *       GetApiHubInstanceRequest.newBuilder()
+   *           .setName(
+   *               ApiHubInstanceName.of("[PROJECT]", "[LOCATION]", "[API_HUB_INSTANCE]").toString())
+   *           .build();
+   *   ApiHubInstance response = provisioningClient.getApiHubInstance(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 ApiHubInstance getApiHubInstance(GetApiHubInstanceRequest request) { + return getApiHubInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single API Hub instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ProvisioningClient provisioningClient = ProvisioningClient.create()) {
+   *   GetApiHubInstanceRequest request =
+   *       GetApiHubInstanceRequest.newBuilder()
+   *           .setName(
+   *               ApiHubInstanceName.of("[PROJECT]", "[LOCATION]", "[API_HUB_INSTANCE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       provisioningClient.getApiHubInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   ApiHubInstance response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getApiHubInstanceCallable() { + return stub.getApiHubInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Looks up an Api Hub instance in a given GCP project. There will always be only one Api Hub + * instance for a GCP project across all locations. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ProvisioningClient provisioningClient = ProvisioningClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   LookupApiHubInstanceResponse response = provisioningClient.lookupApiHubInstance(parent);
+   * }
+   * }
+ * + * @param parent Required. There will always be only one Api Hub instance for a GCP project across + * all locations. The parent resource for the Api Hub instance resource. Format: + * `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LookupApiHubInstanceResponse lookupApiHubInstance(LocationName parent) { + LookupApiHubInstanceRequest request = + LookupApiHubInstanceRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return lookupApiHubInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Looks up an Api Hub instance in a given GCP project. There will always be only one Api Hub + * instance for a GCP project across all locations. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ProvisioningClient provisioningClient = ProvisioningClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   LookupApiHubInstanceResponse response = provisioningClient.lookupApiHubInstance(parent);
+   * }
+   * }
+ * + * @param parent Required. There will always be only one Api Hub instance for a GCP project across + * all locations. The parent resource for the Api Hub instance resource. Format: + * `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LookupApiHubInstanceResponse lookupApiHubInstance(String parent) { + LookupApiHubInstanceRequest request = + LookupApiHubInstanceRequest.newBuilder().setParent(parent).build(); + return lookupApiHubInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Looks up an Api Hub instance in a given GCP project. There will always be only one Api Hub + * instance for a GCP project across all locations. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ProvisioningClient provisioningClient = ProvisioningClient.create()) {
+   *   LookupApiHubInstanceRequest request =
+   *       LookupApiHubInstanceRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .build();
+   *   LookupApiHubInstanceResponse response = provisioningClient.lookupApiHubInstance(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 LookupApiHubInstanceResponse lookupApiHubInstance( + LookupApiHubInstanceRequest request) { + return lookupApiHubInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Looks up an Api Hub instance in a given GCP project. There will always be only one Api Hub + * instance for a GCP project across all locations. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ProvisioningClient provisioningClient = ProvisioningClient.create()) {
+   *   LookupApiHubInstanceRequest request =
+   *       LookupApiHubInstanceRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       provisioningClient.lookupApiHubInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   LookupApiHubInstanceResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + lookupApiHubInstanceCallable() { + return stub.lookupApiHubInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ProvisioningClient provisioningClient = ProvisioningClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : provisioningClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ProvisioningClient provisioningClient = ProvisioningClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       provisioningClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ProvisioningClient provisioningClient = ProvisioningClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response = provisioningClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ProvisioningClient provisioningClient = ProvisioningClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = provisioningClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ProvisioningClient provisioningClient = ProvisioningClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = provisioningClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + @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 ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ProvisioningSettings.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ProvisioningSettings.java new file mode 100644 index 000000000000..f07e50f99db9 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/ProvisioningSettings.java @@ -0,0 +1,270 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import static com.google.cloud.apihub.v1.ProvisioningClient.ListLocationsPagedResponse; + +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.httpjson.InstantiatingHttpJsonChannelProvider; +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.apihub.v1.stub.ProvisioningStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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 ProvisioningClient}. + * + *

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

    + *
  • The default service address (apihub.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 getApiHubInstance to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ProvisioningSettings.Builder provisioningSettingsBuilder = ProvisioningSettings.newBuilder();
+ * provisioningSettingsBuilder
+ *     .getApiHubInstanceSettings()
+ *     .setRetrySettings(
+ *         provisioningSettingsBuilder
+ *             .getApiHubInstanceSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ProvisioningSettings provisioningSettings = provisioningSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class ProvisioningSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createApiHubInstance. */ + public UnaryCallSettings createApiHubInstanceSettings() { + return ((ProvisioningStubSettings) getStubSettings()).createApiHubInstanceSettings(); + } + + /** Returns the object with the settings used for calls to createApiHubInstance. */ + public OperationCallSettings + createApiHubInstanceOperationSettings() { + return ((ProvisioningStubSettings) getStubSettings()).createApiHubInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to getApiHubInstance. */ + public UnaryCallSettings getApiHubInstanceSettings() { + return ((ProvisioningStubSettings) getStubSettings()).getApiHubInstanceSettings(); + } + + /** Returns the object with the settings used for calls to lookupApiHubInstance. */ + public UnaryCallSettings + lookupApiHubInstanceSettings() { + return ((ProvisioningStubSettings) getStubSettings()).lookupApiHubInstanceSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((ProvisioningStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((ProvisioningStubSettings) getStubSettings()).getLocationSettings(); + } + + public static final ProvisioningSettings create(ProvisioningStubSettings stub) + throws IOException { + return new ProvisioningSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ProvisioningStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ProvisioningStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ProvisioningStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ProvisioningStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ProvisioningStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return ProvisioningStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ProvisioningStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ProvisioningStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 ProvisioningSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ProvisioningSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(ProvisioningStubSettings.newBuilder(clientContext)); + } + + protected Builder(ProvisioningSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ProvisioningStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(ProvisioningStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(ProvisioningStubSettings.newHttpJsonBuilder()); + } + + public ProvisioningStubSettings.Builder getStubSettingsBuilder() { + return ((ProvisioningStubSettings.Builder) getStubSettings()); + } + + /** + * 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) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createApiHubInstance. */ + public UnaryCallSettings.Builder + createApiHubInstanceSettings() { + return getStubSettingsBuilder().createApiHubInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to createApiHubInstance. */ + public OperationCallSettings.Builder< + CreateApiHubInstanceRequest, ApiHubInstance, OperationMetadata> + createApiHubInstanceOperationSettings() { + return getStubSettingsBuilder().createApiHubInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getApiHubInstance. */ + public UnaryCallSettings.Builder + getApiHubInstanceSettings() { + return getStubSettingsBuilder().getApiHubInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to lookupApiHubInstance. */ + public UnaryCallSettings.Builder + lookupApiHubInstanceSettings() { + return getStubSettingsBuilder().lookupApiHubInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + @Override + public ProvisioningSettings build() throws IOException { + return new ProvisioningSettings(this); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentServiceClient.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentServiceClient.java new file mode 100644 index 000000000000..682b87b29bd0 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentServiceClient.java @@ -0,0 +1,1432 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +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.cloud.apihub.v1.stub.RuntimeProjectAttachmentServiceStub; +import com.google.cloud.apihub.v1.stub.RuntimeProjectAttachmentServiceStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +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: This service is used for managing the runtime project attachments. + * + *

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
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+ *     RuntimeProjectAttachmentServiceClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   RuntimeProjectAttachment runtimeProjectAttachment =
+ *       RuntimeProjectAttachment.newBuilder().build();
+ *   String runtimeProjectAttachmentId = "runtimeProjectAttachmentId-753213345";
+ *   RuntimeProjectAttachment response =
+ *       runtimeProjectAttachmentServiceClient.createRuntimeProjectAttachment(
+ *           parent, runtimeProjectAttachment, runtimeProjectAttachmentId);
+ * }
+ * }
+ * + *

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

CreateRuntimeProjectAttachment

Attaches a runtime project to the host project.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createRuntimeProjectAttachment(CreateRuntimeProjectAttachmentRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • createRuntimeProjectAttachment(LocationName parent, RuntimeProjectAttachment runtimeProjectAttachment, String runtimeProjectAttachmentId) + *

  • createRuntimeProjectAttachment(String parent, RuntimeProjectAttachment runtimeProjectAttachment, String runtimeProjectAttachmentId) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createRuntimeProjectAttachmentCallable() + *

+ *

GetRuntimeProjectAttachment

Gets a runtime project attachment.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getRuntimeProjectAttachment(GetRuntimeProjectAttachmentRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getRuntimeProjectAttachment(RuntimeProjectAttachmentName name) + *

  • getRuntimeProjectAttachment(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getRuntimeProjectAttachmentCallable() + *

+ *

ListRuntimeProjectAttachments

List runtime projects attached to the host project.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listRuntimeProjectAttachments(ListRuntimeProjectAttachmentsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listRuntimeProjectAttachments(LocationName parent) + *

  • listRuntimeProjectAttachments(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listRuntimeProjectAttachmentsPagedCallable() + *

  • listRuntimeProjectAttachmentsCallable() + *

+ *

DeleteRuntimeProjectAttachment

Delete a runtime project attachment in the API Hub. This call will detach the runtime project from the host project.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteRuntimeProjectAttachment(DeleteRuntimeProjectAttachmentRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteRuntimeProjectAttachment(RuntimeProjectAttachmentName name) + *

  • deleteRuntimeProjectAttachment(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteRuntimeProjectAttachmentCallable() + *

+ *

LookupRuntimeProjectAttachment

Look up a runtime project attachment. This API can be called in the context of any project.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • lookupRuntimeProjectAttachment(LookupRuntimeProjectAttachmentRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • lookupRuntimeProjectAttachment(LocationName name) + *

  • lookupRuntimeProjectAttachment(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • lookupRuntimeProjectAttachmentCallable() + *

+ *

ListLocations

Lists information about the supported locations for this service.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listLocations(ListLocationsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listLocationsPagedCallable() + *

  • listLocationsCallable() + *

+ *

GetLocation

Gets information about a location.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getLocation(GetLocationRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getLocationCallable() + *

+ *
+ * + *

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 + * RuntimeProjectAttachmentServiceSettings to create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * RuntimeProjectAttachmentServiceSettings runtimeProjectAttachmentServiceSettings =
+ *     RuntimeProjectAttachmentServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+ *     RuntimeProjectAttachmentServiceClient.create(runtimeProjectAttachmentServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * RuntimeProjectAttachmentServiceSettings runtimeProjectAttachmentServiceSettings =
+ *     RuntimeProjectAttachmentServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+ *     RuntimeProjectAttachmentServiceClient.create(runtimeProjectAttachmentServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * RuntimeProjectAttachmentServiceSettings runtimeProjectAttachmentServiceSettings =
+ *     RuntimeProjectAttachmentServiceSettings.newHttpJsonBuilder().build();
+ * RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+ *     RuntimeProjectAttachmentServiceClient.create(runtimeProjectAttachmentServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class RuntimeProjectAttachmentServiceClient implements BackgroundResource { + private final RuntimeProjectAttachmentServiceSettings settings; + private final RuntimeProjectAttachmentServiceStub stub; + + /** Constructs an instance of RuntimeProjectAttachmentServiceClient with default settings. */ + public static final RuntimeProjectAttachmentServiceClient create() throws IOException { + return create(RuntimeProjectAttachmentServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of RuntimeProjectAttachmentServiceClient, 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 RuntimeProjectAttachmentServiceClient create( + RuntimeProjectAttachmentServiceSettings settings) throws IOException { + return new RuntimeProjectAttachmentServiceClient(settings); + } + + /** + * Constructs an instance of RuntimeProjectAttachmentServiceClient, using the given stub for + * making calls. This is for advanced usage - prefer using + * create(RuntimeProjectAttachmentServiceSettings). + */ + public static final RuntimeProjectAttachmentServiceClient create( + RuntimeProjectAttachmentServiceStub stub) { + return new RuntimeProjectAttachmentServiceClient(stub); + } + + /** + * Constructs an instance of RuntimeProjectAttachmentServiceClient, 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 RuntimeProjectAttachmentServiceClient(RuntimeProjectAttachmentServiceSettings settings) + throws IOException { + this.settings = settings; + this.stub = + ((RuntimeProjectAttachmentServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected RuntimeProjectAttachmentServiceClient(RuntimeProjectAttachmentServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final RuntimeProjectAttachmentServiceSettings getSettings() { + return settings; + } + + public RuntimeProjectAttachmentServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Attaches a runtime project to the host project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+   *     RuntimeProjectAttachmentServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   RuntimeProjectAttachment runtimeProjectAttachment =
+   *       RuntimeProjectAttachment.newBuilder().build();
+   *   String runtimeProjectAttachmentId = "runtimeProjectAttachmentId-753213345";
+   *   RuntimeProjectAttachment response =
+   *       runtimeProjectAttachmentServiceClient.createRuntimeProjectAttachment(
+   *           parent, runtimeProjectAttachment, runtimeProjectAttachmentId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource for the Runtime Project Attachment. Format: + * `projects/{project}/locations/{location}` + * @param runtimeProjectAttachment Required. The Runtime Project Attachment to create. + * @param runtimeProjectAttachmentId Required. The ID to use for the Runtime Project Attachment, + * which will become the final component of the Runtime Project Attachment's name. The ID must + * be the same as the project ID of the Google cloud project specified in the + * runtime_project_attachment.runtime_project field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final RuntimeProjectAttachment createRuntimeProjectAttachment( + LocationName parent, + RuntimeProjectAttachment runtimeProjectAttachment, + String runtimeProjectAttachmentId) { + CreateRuntimeProjectAttachmentRequest request = + CreateRuntimeProjectAttachmentRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setRuntimeProjectAttachment(runtimeProjectAttachment) + .setRuntimeProjectAttachmentId(runtimeProjectAttachmentId) + .build(); + return createRuntimeProjectAttachment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Attaches a runtime project to the host project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+   *     RuntimeProjectAttachmentServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   RuntimeProjectAttachment runtimeProjectAttachment =
+   *       RuntimeProjectAttachment.newBuilder().build();
+   *   String runtimeProjectAttachmentId = "runtimeProjectAttachmentId-753213345";
+   *   RuntimeProjectAttachment response =
+   *       runtimeProjectAttachmentServiceClient.createRuntimeProjectAttachment(
+   *           parent, runtimeProjectAttachment, runtimeProjectAttachmentId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource for the Runtime Project Attachment. Format: + * `projects/{project}/locations/{location}` + * @param runtimeProjectAttachment Required. The Runtime Project Attachment to create. + * @param runtimeProjectAttachmentId Required. The ID to use for the Runtime Project Attachment, + * which will become the final component of the Runtime Project Attachment's name. The ID must + * be the same as the project ID of the Google cloud project specified in the + * runtime_project_attachment.runtime_project field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final RuntimeProjectAttachment createRuntimeProjectAttachment( + String parent, + RuntimeProjectAttachment runtimeProjectAttachment, + String runtimeProjectAttachmentId) { + CreateRuntimeProjectAttachmentRequest request = + CreateRuntimeProjectAttachmentRequest.newBuilder() + .setParent(parent) + .setRuntimeProjectAttachment(runtimeProjectAttachment) + .setRuntimeProjectAttachmentId(runtimeProjectAttachmentId) + .build(); + return createRuntimeProjectAttachment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Attaches a runtime project to the host project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+   *     RuntimeProjectAttachmentServiceClient.create()) {
+   *   CreateRuntimeProjectAttachmentRequest request =
+   *       CreateRuntimeProjectAttachmentRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setRuntimeProjectAttachmentId("runtimeProjectAttachmentId-753213345")
+   *           .setRuntimeProjectAttachment(RuntimeProjectAttachment.newBuilder().build())
+   *           .build();
+   *   RuntimeProjectAttachment response =
+   *       runtimeProjectAttachmentServiceClient.createRuntimeProjectAttachment(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 RuntimeProjectAttachment createRuntimeProjectAttachment( + CreateRuntimeProjectAttachmentRequest request) { + return createRuntimeProjectAttachmentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Attaches a runtime project to the host project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+   *     RuntimeProjectAttachmentServiceClient.create()) {
+   *   CreateRuntimeProjectAttachmentRequest request =
+   *       CreateRuntimeProjectAttachmentRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setRuntimeProjectAttachmentId("runtimeProjectAttachmentId-753213345")
+   *           .setRuntimeProjectAttachment(RuntimeProjectAttachment.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       runtimeProjectAttachmentServiceClient
+   *           .createRuntimeProjectAttachmentCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   RuntimeProjectAttachment response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createRuntimeProjectAttachmentCallable() { + return stub.createRuntimeProjectAttachmentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a runtime project attachment. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+   *     RuntimeProjectAttachmentServiceClient.create()) {
+   *   RuntimeProjectAttachmentName name =
+   *       RuntimeProjectAttachmentName.of(
+   *           "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]");
+   *   RuntimeProjectAttachment response =
+   *       runtimeProjectAttachmentServiceClient.getRuntimeProjectAttachment(name);
+   * }
+   * }
+ * + * @param name Required. The name of the API resource to retrieve. Format: + * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final RuntimeProjectAttachment getRuntimeProjectAttachment( + RuntimeProjectAttachmentName name) { + GetRuntimeProjectAttachmentRequest request = + GetRuntimeProjectAttachmentRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getRuntimeProjectAttachment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a runtime project attachment. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+   *     RuntimeProjectAttachmentServiceClient.create()) {
+   *   String name =
+   *       RuntimeProjectAttachmentName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]")
+   *           .toString();
+   *   RuntimeProjectAttachment response =
+   *       runtimeProjectAttachmentServiceClient.getRuntimeProjectAttachment(name);
+   * }
+   * }
+ * + * @param name Required. The name of the API resource to retrieve. Format: + * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final RuntimeProjectAttachment getRuntimeProjectAttachment(String name) { + GetRuntimeProjectAttachmentRequest request = + GetRuntimeProjectAttachmentRequest.newBuilder().setName(name).build(); + return getRuntimeProjectAttachment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a runtime project attachment. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+   *     RuntimeProjectAttachmentServiceClient.create()) {
+   *   GetRuntimeProjectAttachmentRequest request =
+   *       GetRuntimeProjectAttachmentRequest.newBuilder()
+   *           .setName(
+   *               RuntimeProjectAttachmentName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]")
+   *                   .toString())
+   *           .build();
+   *   RuntimeProjectAttachment response =
+   *       runtimeProjectAttachmentServiceClient.getRuntimeProjectAttachment(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 RuntimeProjectAttachment getRuntimeProjectAttachment( + GetRuntimeProjectAttachmentRequest request) { + return getRuntimeProjectAttachmentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a runtime project attachment. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+   *     RuntimeProjectAttachmentServiceClient.create()) {
+   *   GetRuntimeProjectAttachmentRequest request =
+   *       GetRuntimeProjectAttachmentRequest.newBuilder()
+   *           .setName(
+   *               RuntimeProjectAttachmentName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       runtimeProjectAttachmentServiceClient
+   *           .getRuntimeProjectAttachmentCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   RuntimeProjectAttachment response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getRuntimeProjectAttachmentCallable() { + return stub.getRuntimeProjectAttachmentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List runtime projects attached to the host project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+   *     RuntimeProjectAttachmentServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (RuntimeProjectAttachment element :
+   *       runtimeProjectAttachmentServiceClient
+   *           .listRuntimeProjectAttachments(parent)
+   *           .iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of runtime project attachments. + * Format: `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListRuntimeProjectAttachmentsPagedResponse listRuntimeProjectAttachments( + LocationName parent) { + ListRuntimeProjectAttachmentsRequest request = + ListRuntimeProjectAttachmentsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listRuntimeProjectAttachments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List runtime projects attached to the host project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+   *     RuntimeProjectAttachmentServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (RuntimeProjectAttachment element :
+   *       runtimeProjectAttachmentServiceClient
+   *           .listRuntimeProjectAttachments(parent)
+   *           .iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of runtime project attachments. + * Format: `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListRuntimeProjectAttachmentsPagedResponse listRuntimeProjectAttachments( + String parent) { + ListRuntimeProjectAttachmentsRequest request = + ListRuntimeProjectAttachmentsRequest.newBuilder().setParent(parent).build(); + return listRuntimeProjectAttachments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List runtime projects attached to the host project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+   *     RuntimeProjectAttachmentServiceClient.create()) {
+   *   ListRuntimeProjectAttachmentsRequest request =
+   *       ListRuntimeProjectAttachmentsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (RuntimeProjectAttachment element :
+   *       runtimeProjectAttachmentServiceClient
+   *           .listRuntimeProjectAttachments(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 ListRuntimeProjectAttachmentsPagedResponse listRuntimeProjectAttachments( + ListRuntimeProjectAttachmentsRequest request) { + return listRuntimeProjectAttachmentsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List runtime projects attached to the host project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+   *     RuntimeProjectAttachmentServiceClient.create()) {
+   *   ListRuntimeProjectAttachmentsRequest request =
+   *       ListRuntimeProjectAttachmentsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       runtimeProjectAttachmentServiceClient
+   *           .listRuntimeProjectAttachmentsPagedCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   for (RuntimeProjectAttachment element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable< + ListRuntimeProjectAttachmentsRequest, ListRuntimeProjectAttachmentsPagedResponse> + listRuntimeProjectAttachmentsPagedCallable() { + return stub.listRuntimeProjectAttachmentsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List runtime projects attached to the host project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+   *     RuntimeProjectAttachmentServiceClient.create()) {
+   *   ListRuntimeProjectAttachmentsRequest request =
+   *       ListRuntimeProjectAttachmentsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListRuntimeProjectAttachmentsResponse response =
+   *         runtimeProjectAttachmentServiceClient
+   *             .listRuntimeProjectAttachmentsCallable()
+   *             .call(request);
+   *     for (RuntimeProjectAttachment element : response.getRuntimeProjectAttachmentsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable< + ListRuntimeProjectAttachmentsRequest, ListRuntimeProjectAttachmentsResponse> + listRuntimeProjectAttachmentsCallable() { + return stub.listRuntimeProjectAttachmentsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a runtime project attachment in the API Hub. This call will detach the runtime project + * from the host project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+   *     RuntimeProjectAttachmentServiceClient.create()) {
+   *   RuntimeProjectAttachmentName name =
+   *       RuntimeProjectAttachmentName.of(
+   *           "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]");
+   *   runtimeProjectAttachmentServiceClient.deleteRuntimeProjectAttachment(name);
+   * }
+   * }
+ * + * @param name Required. The name of the Runtime Project Attachment to delete. Format: + * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteRuntimeProjectAttachment(RuntimeProjectAttachmentName name) { + DeleteRuntimeProjectAttachmentRequest request = + DeleteRuntimeProjectAttachmentRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteRuntimeProjectAttachment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a runtime project attachment in the API Hub. This call will detach the runtime project + * from the host project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+   *     RuntimeProjectAttachmentServiceClient.create()) {
+   *   String name =
+   *       RuntimeProjectAttachmentName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]")
+   *           .toString();
+   *   runtimeProjectAttachmentServiceClient.deleteRuntimeProjectAttachment(name);
+   * }
+   * }
+ * + * @param name Required. The name of the Runtime Project Attachment to delete. Format: + * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteRuntimeProjectAttachment(String name) { + DeleteRuntimeProjectAttachmentRequest request = + DeleteRuntimeProjectAttachmentRequest.newBuilder().setName(name).build(); + deleteRuntimeProjectAttachment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a runtime project attachment in the API Hub. This call will detach the runtime project + * from the host project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+   *     RuntimeProjectAttachmentServiceClient.create()) {
+   *   DeleteRuntimeProjectAttachmentRequest request =
+   *       DeleteRuntimeProjectAttachmentRequest.newBuilder()
+   *           .setName(
+   *               RuntimeProjectAttachmentName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]")
+   *                   .toString())
+   *           .build();
+   *   runtimeProjectAttachmentServiceClient.deleteRuntimeProjectAttachment(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 void deleteRuntimeProjectAttachment(DeleteRuntimeProjectAttachmentRequest request) { + deleteRuntimeProjectAttachmentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a runtime project attachment in the API Hub. This call will detach the runtime project + * from the host project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+   *     RuntimeProjectAttachmentServiceClient.create()) {
+   *   DeleteRuntimeProjectAttachmentRequest request =
+   *       DeleteRuntimeProjectAttachmentRequest.newBuilder()
+   *           .setName(
+   *               RuntimeProjectAttachmentName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       runtimeProjectAttachmentServiceClient
+   *           .deleteRuntimeProjectAttachmentCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + deleteRuntimeProjectAttachmentCallable() { + return stub.deleteRuntimeProjectAttachmentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Look up a runtime project attachment. This API can be called in the context of any project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+   *     RuntimeProjectAttachmentServiceClient.create()) {
+   *   LocationName name = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   LookupRuntimeProjectAttachmentResponse response =
+   *       runtimeProjectAttachmentServiceClient.lookupRuntimeProjectAttachment(name);
+   * }
+   * }
+ * + * @param name Required. Runtime project ID to look up runtime project attachment for. Lookup + * happens across all regions. Expected format: `projects/{project}/locations/{location}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LookupRuntimeProjectAttachmentResponse lookupRuntimeProjectAttachment( + LocationName name) { + LookupRuntimeProjectAttachmentRequest request = + LookupRuntimeProjectAttachmentRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return lookupRuntimeProjectAttachment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Look up a runtime project attachment. This API can be called in the context of any project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+   *     RuntimeProjectAttachmentServiceClient.create()) {
+   *   String name = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   LookupRuntimeProjectAttachmentResponse response =
+   *       runtimeProjectAttachmentServiceClient.lookupRuntimeProjectAttachment(name);
+   * }
+   * }
+ * + * @param name Required. Runtime project ID to look up runtime project attachment for. Lookup + * happens across all regions. Expected format: `projects/{project}/locations/{location}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LookupRuntimeProjectAttachmentResponse lookupRuntimeProjectAttachment(String name) { + LookupRuntimeProjectAttachmentRequest request = + LookupRuntimeProjectAttachmentRequest.newBuilder().setName(name).build(); + return lookupRuntimeProjectAttachment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Look up a runtime project attachment. This API can be called in the context of any project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+   *     RuntimeProjectAttachmentServiceClient.create()) {
+   *   LookupRuntimeProjectAttachmentRequest request =
+   *       LookupRuntimeProjectAttachmentRequest.newBuilder()
+   *           .setName(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .build();
+   *   LookupRuntimeProjectAttachmentResponse response =
+   *       runtimeProjectAttachmentServiceClient.lookupRuntimeProjectAttachment(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 LookupRuntimeProjectAttachmentResponse lookupRuntimeProjectAttachment( + LookupRuntimeProjectAttachmentRequest request) { + return lookupRuntimeProjectAttachmentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Look up a runtime project attachment. This API can be called in the context of any project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+   *     RuntimeProjectAttachmentServiceClient.create()) {
+   *   LookupRuntimeProjectAttachmentRequest request =
+   *       LookupRuntimeProjectAttachmentRequest.newBuilder()
+   *           .setName(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       runtimeProjectAttachmentServiceClient
+   *           .lookupRuntimeProjectAttachmentCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   LookupRuntimeProjectAttachmentResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable< + LookupRuntimeProjectAttachmentRequest, LookupRuntimeProjectAttachmentResponse> + lookupRuntimeProjectAttachmentCallable() { + return stub.lookupRuntimeProjectAttachmentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+   *     RuntimeProjectAttachmentServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element :
+   *       runtimeProjectAttachmentServiceClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+   *     RuntimeProjectAttachmentServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       runtimeProjectAttachmentServiceClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+   *     RuntimeProjectAttachmentServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response =
+   *         runtimeProjectAttachmentServiceClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+   *     RuntimeProjectAttachmentServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = runtimeProjectAttachmentServiceClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+   *     RuntimeProjectAttachmentServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future =
+   *       runtimeProjectAttachmentServiceClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + @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 ListRuntimeProjectAttachmentsPagedResponse + extends AbstractPagedListResponse< + ListRuntimeProjectAttachmentsRequest, + ListRuntimeProjectAttachmentsResponse, + RuntimeProjectAttachment, + ListRuntimeProjectAttachmentsPage, + ListRuntimeProjectAttachmentsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListRuntimeProjectAttachmentsRequest, + ListRuntimeProjectAttachmentsResponse, + RuntimeProjectAttachment> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListRuntimeProjectAttachmentsPage.createEmptyPage() + .createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListRuntimeProjectAttachmentsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListRuntimeProjectAttachmentsPagedResponse(ListRuntimeProjectAttachmentsPage page) { + super(page, ListRuntimeProjectAttachmentsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListRuntimeProjectAttachmentsPage + extends AbstractPage< + ListRuntimeProjectAttachmentsRequest, + ListRuntimeProjectAttachmentsResponse, + RuntimeProjectAttachment, + ListRuntimeProjectAttachmentsPage> { + + private ListRuntimeProjectAttachmentsPage( + PageContext< + ListRuntimeProjectAttachmentsRequest, + ListRuntimeProjectAttachmentsResponse, + RuntimeProjectAttachment> + context, + ListRuntimeProjectAttachmentsResponse response) { + super(context, response); + } + + private static ListRuntimeProjectAttachmentsPage createEmptyPage() { + return new ListRuntimeProjectAttachmentsPage(null, null); + } + + @Override + protected ListRuntimeProjectAttachmentsPage createPage( + PageContext< + ListRuntimeProjectAttachmentsRequest, + ListRuntimeProjectAttachmentsResponse, + RuntimeProjectAttachment> + context, + ListRuntimeProjectAttachmentsResponse response) { + return new ListRuntimeProjectAttachmentsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListRuntimeProjectAttachmentsRequest, + ListRuntimeProjectAttachmentsResponse, + RuntimeProjectAttachment> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListRuntimeProjectAttachmentsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListRuntimeProjectAttachmentsRequest, + ListRuntimeProjectAttachmentsResponse, + RuntimeProjectAttachment, + ListRuntimeProjectAttachmentsPage, + ListRuntimeProjectAttachmentsFixedSizeCollection> { + + private ListRuntimeProjectAttachmentsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListRuntimeProjectAttachmentsFixedSizeCollection createEmptyCollection() { + return new ListRuntimeProjectAttachmentsFixedSizeCollection(null, 0); + } + + @Override + protected ListRuntimeProjectAttachmentsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListRuntimeProjectAttachmentsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentServiceSettings.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentServiceSettings.java new file mode 100644 index 000000000000..7ca9459b2708 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentServiceSettings.java @@ -0,0 +1,302 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import static com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient.ListRuntimeProjectAttachmentsPagedResponse; + +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.httpjson.InstantiatingHttpJsonChannelProvider; +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.apihub.v1.stub.RuntimeProjectAttachmentServiceStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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 RuntimeProjectAttachmentServiceClient}. + * + *

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

    + *
  • The default service address (apihub.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 createRuntimeProjectAttachment to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * RuntimeProjectAttachmentServiceSettings.Builder runtimeProjectAttachmentServiceSettingsBuilder =
+ *     RuntimeProjectAttachmentServiceSettings.newBuilder();
+ * runtimeProjectAttachmentServiceSettingsBuilder
+ *     .createRuntimeProjectAttachmentSettings()
+ *     .setRetrySettings(
+ *         runtimeProjectAttachmentServiceSettingsBuilder
+ *             .createRuntimeProjectAttachmentSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * RuntimeProjectAttachmentServiceSettings runtimeProjectAttachmentServiceSettings =
+ *     runtimeProjectAttachmentServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class RuntimeProjectAttachmentServiceSettings + extends ClientSettings { + + /** Returns the object with the settings used for calls to createRuntimeProjectAttachment. */ + public UnaryCallSettings + createRuntimeProjectAttachmentSettings() { + return ((RuntimeProjectAttachmentServiceStubSettings) getStubSettings()) + .createRuntimeProjectAttachmentSettings(); + } + + /** Returns the object with the settings used for calls to getRuntimeProjectAttachment. */ + public UnaryCallSettings + getRuntimeProjectAttachmentSettings() { + return ((RuntimeProjectAttachmentServiceStubSettings) getStubSettings()) + .getRuntimeProjectAttachmentSettings(); + } + + /** Returns the object with the settings used for calls to listRuntimeProjectAttachments. */ + public PagedCallSettings< + ListRuntimeProjectAttachmentsRequest, + ListRuntimeProjectAttachmentsResponse, + ListRuntimeProjectAttachmentsPagedResponse> + listRuntimeProjectAttachmentsSettings() { + return ((RuntimeProjectAttachmentServiceStubSettings) getStubSettings()) + .listRuntimeProjectAttachmentsSettings(); + } + + /** Returns the object with the settings used for calls to deleteRuntimeProjectAttachment. */ + public UnaryCallSettings + deleteRuntimeProjectAttachmentSettings() { + return ((RuntimeProjectAttachmentServiceStubSettings) getStubSettings()) + .deleteRuntimeProjectAttachmentSettings(); + } + + /** Returns the object with the settings used for calls to lookupRuntimeProjectAttachment. */ + public UnaryCallSettings< + LookupRuntimeProjectAttachmentRequest, LookupRuntimeProjectAttachmentResponse> + lookupRuntimeProjectAttachmentSettings() { + return ((RuntimeProjectAttachmentServiceStubSettings) getStubSettings()) + .lookupRuntimeProjectAttachmentSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((RuntimeProjectAttachmentServiceStubSettings) getStubSettings()) + .listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((RuntimeProjectAttachmentServiceStubSettings) getStubSettings()).getLocationSettings(); + } + + public static final RuntimeProjectAttachmentServiceSettings create( + RuntimeProjectAttachmentServiceStubSettings stub) throws IOException { + return new RuntimeProjectAttachmentServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return RuntimeProjectAttachmentServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return RuntimeProjectAttachmentServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return RuntimeProjectAttachmentServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return RuntimeProjectAttachmentServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return RuntimeProjectAttachmentServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return RuntimeProjectAttachmentServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return RuntimeProjectAttachmentServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RuntimeProjectAttachmentServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 RuntimeProjectAttachmentServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for RuntimeProjectAttachmentServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(RuntimeProjectAttachmentServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(RuntimeProjectAttachmentServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(RuntimeProjectAttachmentServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(RuntimeProjectAttachmentServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(RuntimeProjectAttachmentServiceStubSettings.newHttpJsonBuilder()); + } + + public RuntimeProjectAttachmentServiceStubSettings.Builder getStubSettingsBuilder() { + return ((RuntimeProjectAttachmentServiceStubSettings.Builder) getStubSettings()); + } + + /** + * 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) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createRuntimeProjectAttachment. */ + public UnaryCallSettings.Builder< + CreateRuntimeProjectAttachmentRequest, RuntimeProjectAttachment> + createRuntimeProjectAttachmentSettings() { + return getStubSettingsBuilder().createRuntimeProjectAttachmentSettings(); + } + + /** Returns the builder for the settings used for calls to getRuntimeProjectAttachment. */ + public UnaryCallSettings.Builder + getRuntimeProjectAttachmentSettings() { + return getStubSettingsBuilder().getRuntimeProjectAttachmentSettings(); + } + + /** Returns the builder for the settings used for calls to listRuntimeProjectAttachments. */ + public PagedCallSettings.Builder< + ListRuntimeProjectAttachmentsRequest, + ListRuntimeProjectAttachmentsResponse, + ListRuntimeProjectAttachmentsPagedResponse> + listRuntimeProjectAttachmentsSettings() { + return getStubSettingsBuilder().listRuntimeProjectAttachmentsSettings(); + } + + /** Returns the builder for the settings used for calls to deleteRuntimeProjectAttachment. */ + public UnaryCallSettings.Builder + deleteRuntimeProjectAttachmentSettings() { + return getStubSettingsBuilder().deleteRuntimeProjectAttachmentSettings(); + } + + /** Returns the builder for the settings used for calls to lookupRuntimeProjectAttachment. */ + public UnaryCallSettings.Builder< + LookupRuntimeProjectAttachmentRequest, LookupRuntimeProjectAttachmentResponse> + lookupRuntimeProjectAttachmentSettings() { + return getStubSettingsBuilder().lookupRuntimeProjectAttachmentSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + @Override + public RuntimeProjectAttachmentServiceSettings build() throws IOException { + return new RuntimeProjectAttachmentServiceSettings(this); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/gapic_metadata.json b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/gapic_metadata.json new file mode 100644 index 000000000000..f19b1ef5e890 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/gapic_metadata.json @@ -0,0 +1,288 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.apihub.v1", + "libraryPackage": "com.google.cloud.apihub.v1", + "services": { + "ApiHub": { + "clients": { + "grpc": { + "libraryClient": "ApiHubClient", + "rpcs": { + "CreateApi": { + "methods": ["createApi", "createApi", "createApi", "createApiCallable"] + }, + "CreateAttribute": { + "methods": ["createAttribute", "createAttribute", "createAttribute", "createAttributeCallable"] + }, + "CreateDeployment": { + "methods": ["createDeployment", "createDeployment", "createDeployment", "createDeploymentCallable"] + }, + "CreateExternalApi": { + "methods": ["createExternalApi", "createExternalApi", "createExternalApi", "createExternalApiCallable"] + }, + "CreateSpec": { + "methods": ["createSpec", "createSpec", "createSpec", "createSpecCallable"] + }, + "CreateVersion": { + "methods": ["createVersion", "createVersion", "createVersion", "createVersionCallable"] + }, + "DeleteApi": { + "methods": ["deleteApi", "deleteApi", "deleteApi", "deleteApiCallable"] + }, + "DeleteAttribute": { + "methods": ["deleteAttribute", "deleteAttribute", "deleteAttribute", "deleteAttributeCallable"] + }, + "DeleteDeployment": { + "methods": ["deleteDeployment", "deleteDeployment", "deleteDeployment", "deleteDeploymentCallable"] + }, + "DeleteExternalApi": { + "methods": ["deleteExternalApi", "deleteExternalApi", "deleteExternalApi", "deleteExternalApiCallable"] + }, + "DeleteSpec": { + "methods": ["deleteSpec", "deleteSpec", "deleteSpec", "deleteSpecCallable"] + }, + "DeleteVersion": { + "methods": ["deleteVersion", "deleteVersion", "deleteVersion", "deleteVersionCallable"] + }, + "GetApi": { + "methods": ["getApi", "getApi", "getApi", "getApiCallable"] + }, + "GetApiOperation": { + "methods": ["getApiOperation", "getApiOperation", "getApiOperation", "getApiOperationCallable"] + }, + "GetAttribute": { + "methods": ["getAttribute", "getAttribute", "getAttribute", "getAttributeCallable"] + }, + "GetDefinition": { + "methods": ["getDefinition", "getDefinition", "getDefinition", "getDefinitionCallable"] + }, + "GetDeployment": { + "methods": ["getDeployment", "getDeployment", "getDeployment", "getDeploymentCallable"] + }, + "GetExternalApi": { + "methods": ["getExternalApi", "getExternalApi", "getExternalApi", "getExternalApiCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetSpec": { + "methods": ["getSpec", "getSpec", "getSpec", "getSpecCallable"] + }, + "GetSpecContents": { + "methods": ["getSpecContents", "getSpecContents", "getSpecContents", "getSpecContentsCallable"] + }, + "GetVersion": { + "methods": ["getVersion", "getVersion", "getVersion", "getVersionCallable"] + }, + "ListApiOperations": { + "methods": ["listApiOperations", "listApiOperations", "listApiOperations", "listApiOperationsPagedCallable", "listApiOperationsCallable"] + }, + "ListApis": { + "methods": ["listApis", "listApis", "listApis", "listApisPagedCallable", "listApisCallable"] + }, + "ListAttributes": { + "methods": ["listAttributes", "listAttributes", "listAttributes", "listAttributesPagedCallable", "listAttributesCallable"] + }, + "ListDeployments": { + "methods": ["listDeployments", "listDeployments", "listDeployments", "listDeploymentsPagedCallable", "listDeploymentsCallable"] + }, + "ListExternalApis": { + "methods": ["listExternalApis", "listExternalApis", "listExternalApis", "listExternalApisPagedCallable", "listExternalApisCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ListSpecs": { + "methods": ["listSpecs", "listSpecs", "listSpecs", "listSpecsPagedCallable", "listSpecsCallable"] + }, + "ListVersions": { + "methods": ["listVersions", "listVersions", "listVersions", "listVersionsPagedCallable", "listVersionsCallable"] + }, + "SearchResources": { + "methods": ["searchResources", "searchResources", "searchResources", "searchResourcesPagedCallable", "searchResourcesCallable"] + }, + "UpdateApi": { + "methods": ["updateApi", "updateApi", "updateApiCallable"] + }, + "UpdateAttribute": { + "methods": ["updateAttribute", "updateAttribute", "updateAttributeCallable"] + }, + "UpdateDeployment": { + "methods": ["updateDeployment", "updateDeployment", "updateDeploymentCallable"] + }, + "UpdateExternalApi": { + "methods": ["updateExternalApi", "updateExternalApi", "updateExternalApiCallable"] + }, + "UpdateSpec": { + "methods": ["updateSpec", "updateSpec", "updateSpecCallable"] + }, + "UpdateVersion": { + "methods": ["updateVersion", "updateVersion", "updateVersionCallable"] + } + } + } + } + }, + "ApiHubDependencies": { + "clients": { + "grpc": { + "libraryClient": "ApiHubDependenciesClient", + "rpcs": { + "CreateDependency": { + "methods": ["createDependency", "createDependency", "createDependency", "createDependencyCallable"] + }, + "DeleteDependency": { + "methods": ["deleteDependency", "deleteDependency", "deleteDependency", "deleteDependencyCallable"] + }, + "GetDependency": { + "methods": ["getDependency", "getDependency", "getDependency", "getDependencyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "ListDependencies": { + "methods": ["listDependencies", "listDependencies", "listDependencies", "listDependenciesPagedCallable", "listDependenciesCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "UpdateDependency": { + "methods": ["updateDependency", "updateDependency", "updateDependencyCallable"] + } + } + } + } + }, + "HostProjectRegistrationService": { + "clients": { + "grpc": { + "libraryClient": "HostProjectRegistrationServiceClient", + "rpcs": { + "CreateHostProjectRegistration": { + "methods": ["createHostProjectRegistration", "createHostProjectRegistration", "createHostProjectRegistration", "createHostProjectRegistrationCallable"] + }, + "GetHostProjectRegistration": { + "methods": ["getHostProjectRegistration", "getHostProjectRegistration", "getHostProjectRegistration", "getHostProjectRegistrationCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "ListHostProjectRegistrations": { + "methods": ["listHostProjectRegistrations", "listHostProjectRegistrations", "listHostProjectRegistrations", "listHostProjectRegistrationsPagedCallable", "listHostProjectRegistrationsCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + } + } + } + } + }, + "LintingService": { + "clients": { + "grpc": { + "libraryClient": "LintingServiceClient", + "rpcs": { + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetStyleGuide": { + "methods": ["getStyleGuide", "getStyleGuide", "getStyleGuide", "getStyleGuideCallable"] + }, + "GetStyleGuideContents": { + "methods": ["getStyleGuideContents", "getStyleGuideContents", "getStyleGuideContents", "getStyleGuideContentsCallable"] + }, + "LintSpec": { + "methods": ["lintSpec", "lintSpecCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "UpdateStyleGuide": { + "methods": ["updateStyleGuide", "updateStyleGuide", "updateStyleGuideCallable"] + } + } + } + } + }, + "ApiHubPlugin": { + "clients": { + "grpc": { + "libraryClient": "ApiHubPluginClient", + "rpcs": { + "DisablePlugin": { + "methods": ["disablePlugin", "disablePlugin", "disablePlugin", "disablePluginCallable"] + }, + "EnablePlugin": { + "methods": ["enablePlugin", "enablePlugin", "enablePlugin", "enablePluginCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetPlugin": { + "methods": ["getPlugin", "getPlugin", "getPlugin", "getPluginCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + } + } + } + } + }, + "Provisioning": { + "clients": { + "grpc": { + "libraryClient": "ProvisioningClient", + "rpcs": { + "CreateApiHubInstance": { + "methods": ["createApiHubInstanceAsync", "createApiHubInstanceAsync", "createApiHubInstanceAsync", "createApiHubInstanceOperationCallable", "createApiHubInstanceCallable"] + }, + "GetApiHubInstance": { + "methods": ["getApiHubInstance", "getApiHubInstance", "getApiHubInstance", "getApiHubInstanceCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "LookupApiHubInstance": { + "methods": ["lookupApiHubInstance", "lookupApiHubInstance", "lookupApiHubInstance", "lookupApiHubInstanceCallable"] + } + } + } + } + }, + "RuntimeProjectAttachmentService": { + "clients": { + "grpc": { + "libraryClient": "RuntimeProjectAttachmentServiceClient", + "rpcs": { + "CreateRuntimeProjectAttachment": { + "methods": ["createRuntimeProjectAttachment", "createRuntimeProjectAttachment", "createRuntimeProjectAttachment", "createRuntimeProjectAttachmentCallable"] + }, + "DeleteRuntimeProjectAttachment": { + "methods": ["deleteRuntimeProjectAttachment", "deleteRuntimeProjectAttachment", "deleteRuntimeProjectAttachment", "deleteRuntimeProjectAttachmentCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetRuntimeProjectAttachment": { + "methods": ["getRuntimeProjectAttachment", "getRuntimeProjectAttachment", "getRuntimeProjectAttachment", "getRuntimeProjectAttachmentCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ListRuntimeProjectAttachments": { + "methods": ["listRuntimeProjectAttachments", "listRuntimeProjectAttachments", "listRuntimeProjectAttachments", "listRuntimeProjectAttachmentsPagedCallable", "listRuntimeProjectAttachmentsCallable"] + }, + "LookupRuntimeProjectAttachment": { + "methods": ["lookupRuntimeProjectAttachment", "lookupRuntimeProjectAttachment", "lookupRuntimeProjectAttachment", "lookupRuntimeProjectAttachmentCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/package-info.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/package-info.java new file mode 100644 index 000000000000..bc03a4abe366 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/package-info.java @@ -0,0 +1,171 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to API hub API + * + *

The interfaces provided are listed below, along with usage samples. + * + *

======================= ApiHubClient ======================= + * + *

Service Description: This service provides all methods related to the API hub. + * + *

Sample for ApiHubClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ApiHubClient apiHubClient = ApiHubClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   Api api = Api.newBuilder().build();
+ *   String apiId = "apiId93021397";
+ *   Api response = apiHubClient.createApi(parent, api, apiId);
+ * }
+ * }
+ * + *

======================= ApiHubDependenciesClient ======================= + * + *

Service Description: This service provides methods for various operations related to a + * [Dependency][google.cloud.apihub.v1.Dependency] in the API hub. + * + *

Sample for ApiHubDependenciesClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   Dependency dependency = Dependency.newBuilder().build();
+ *   String dependencyId = "dependencyId503788998";
+ *   Dependency response =
+ *       apiHubDependenciesClient.createDependency(parent, dependency, dependencyId);
+ * }
+ * }
+ * + *

======================= HostProjectRegistrationServiceClient ======================= + * + *

Service Description: This service is used for managing the host project registrations. + * + *

Sample for HostProjectRegistrationServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient =
+ *     HostProjectRegistrationServiceClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   HostProjectRegistration hostProjectRegistration =
+ *       HostProjectRegistration.newBuilder().build();
+ *   String hostProjectRegistrationId = "hostProjectRegistrationId1352651365";
+ *   HostProjectRegistration response =
+ *       hostProjectRegistrationServiceClient.createHostProjectRegistration(
+ *           parent, hostProjectRegistration, hostProjectRegistrationId);
+ * }
+ * }
+ * + *

======================= LintingServiceClient ======================= + * + *

Service Description: This service provides all methods related to the 1p Linter. + * + *

Sample for LintingServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) {
+ *   StyleGuideName name = StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]");
+ *   StyleGuide response = lintingServiceClient.getStyleGuide(name);
+ * }
+ * }
+ * + *

======================= ApiHubPluginClient ======================= + * + *

Service Description: This service is used for managing plugins inside the API Hub. + * + *

Sample for ApiHubPluginClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+ *   PluginName name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]");
+ *   Plugin response = apiHubPluginClient.getPlugin(name);
+ * }
+ * }
+ * + *

======================= ProvisioningClient ======================= + * + *

Service Description: This service is used for managing the data plane provisioning of the API + * hub. + * + *

Sample for ProvisioningClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ProvisioningClient provisioningClient = ProvisioningClient.create()) {
+ *   ApiHubInstanceName name =
+ *       ApiHubInstanceName.of("[PROJECT]", "[LOCATION]", "[API_HUB_INSTANCE]");
+ *   ApiHubInstance response = provisioningClient.getApiHubInstance(name);
+ * }
+ * }
+ * + *

======================= RuntimeProjectAttachmentServiceClient ======================= + * + *

Service Description: This service is used for managing the runtime project attachments. + * + *

Sample for RuntimeProjectAttachmentServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
+ *     RuntimeProjectAttachmentServiceClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   RuntimeProjectAttachment runtimeProjectAttachment =
+ *       RuntimeProjectAttachment.newBuilder().build();
+ *   String runtimeProjectAttachmentId = "runtimeProjectAttachmentId-753213345";
+ *   RuntimeProjectAttachment response =
+ *       runtimeProjectAttachmentServiceClient.createRuntimeProjectAttachment(
+ *           parent, runtimeProjectAttachment, runtimeProjectAttachmentId);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.apihub.v1; + +import javax.annotation.Generated; diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ApiHubDependenciesStub.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ApiHubDependenciesStub.java new file mode 100644 index 000000000000..2657ca34cabe --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ApiHubDependenciesStub.java @@ -0,0 +1,88 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import static com.google.cloud.apihub.v1.ApiHubDependenciesClient.ListDependenciesPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubDependenciesClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.apihub.v1.CreateDependencyRequest; +import com.google.cloud.apihub.v1.DeleteDependencyRequest; +import com.google.cloud.apihub.v1.Dependency; +import com.google.cloud.apihub.v1.GetDependencyRequest; +import com.google.cloud.apihub.v1.ListDependenciesRequest; +import com.google.cloud.apihub.v1.ListDependenciesResponse; +import com.google.cloud.apihub.v1.UpdateDependencyRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the ApiHubDependencies service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class ApiHubDependenciesStub implements BackgroundResource { + + public UnaryCallable createDependencyCallable() { + throw new UnsupportedOperationException("Not implemented: createDependencyCallable()"); + } + + public UnaryCallable getDependencyCallable() { + throw new UnsupportedOperationException("Not implemented: getDependencyCallable()"); + } + + public UnaryCallable updateDependencyCallable() { + throw new UnsupportedOperationException("Not implemented: updateDependencyCallable()"); + } + + public UnaryCallable deleteDependencyCallable() { + throw new UnsupportedOperationException("Not implemented: deleteDependencyCallable()"); + } + + public UnaryCallable + listDependenciesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listDependenciesPagedCallable()"); + } + + public UnaryCallable + listDependenciesCallable() { + throw new UnsupportedOperationException("Not implemented: listDependenciesCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ApiHubDependenciesStubSettings.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ApiHubDependenciesStubSettings.java new file mode 100644 index 000000000000..4bc5772bb938 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ApiHubDependenciesStubSettings.java @@ -0,0 +1,629 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import static com.google.cloud.apihub.v1.ApiHubDependenciesClient.ListDependenciesPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubDependenciesClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.core.ObsoleteApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.apihub.v1.CreateDependencyRequest; +import com.google.cloud.apihub.v1.DeleteDependencyRequest; +import com.google.cloud.apihub.v1.Dependency; +import com.google.cloud.apihub.v1.GetDependencyRequest; +import com.google.cloud.apihub.v1.ListDependenciesRequest; +import com.google.cloud.apihub.v1.ListDependenciesResponse; +import com.google.cloud.apihub.v1.UpdateDependencyRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.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 ApiHubDependenciesStub}. + * + *

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

    + *
  • The default service address (apihub.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 createDependency to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ApiHubDependenciesStubSettings.Builder apiHubDependenciesSettingsBuilder =
+ *     ApiHubDependenciesStubSettings.newBuilder();
+ * apiHubDependenciesSettingsBuilder
+ *     .createDependencySettings()
+ *     .setRetrySettings(
+ *         apiHubDependenciesSettingsBuilder
+ *             .createDependencySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ApiHubDependenciesStubSettings apiHubDependenciesSettings =
+ *     apiHubDependenciesSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class ApiHubDependenciesStubSettings 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").build(); + + private final UnaryCallSettings createDependencySettings; + private final UnaryCallSettings getDependencySettings; + private final UnaryCallSettings updateDependencySettings; + private final UnaryCallSettings deleteDependencySettings; + private final PagedCallSettings< + ListDependenciesRequest, ListDependenciesResponse, ListDependenciesPagedResponse> + listDependenciesSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + + private static final PagedListDescriptor< + ListDependenciesRequest, ListDependenciesResponse, Dependency> + LIST_DEPENDENCIES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListDependenciesRequest injectToken( + ListDependenciesRequest payload, String token) { + return ListDependenciesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListDependenciesRequest injectPageSize( + ListDependenciesRequest payload, int pageSize) { + return ListDependenciesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListDependenciesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListDependenciesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListDependenciesResponse payload) { + return payload.getDependenciesList() == null + ? ImmutableList.of() + : payload.getDependenciesList(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListDependenciesRequest, ListDependenciesResponse, ListDependenciesPagedResponse> + LIST_DEPENDENCIES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListDependenciesRequest, ListDependenciesResponse, ListDependenciesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListDependenciesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_DEPENDENCIES_PAGE_STR_DESC, request, context); + return ListDependenciesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createDependency. */ + public UnaryCallSettings createDependencySettings() { + return createDependencySettings; + } + + /** Returns the object with the settings used for calls to getDependency. */ + public UnaryCallSettings getDependencySettings() { + return getDependencySettings; + } + + /** Returns the object with the settings used for calls to updateDependency. */ + public UnaryCallSettings updateDependencySettings() { + return updateDependencySettings; + } + + /** Returns the object with the settings used for calls to deleteDependency. */ + public UnaryCallSettings deleteDependencySettings() { + return deleteDependencySettings; + } + + /** Returns the object with the settings used for calls to listDependencies. */ + public PagedCallSettings< + ListDependenciesRequest, ListDependenciesResponse, ListDependenciesPagedResponse> + listDependenciesSettings() { + return listDependenciesSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + public ApiHubDependenciesStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcApiHubDependenciesStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonApiHubDependenciesStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "apihub"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "apihub.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "apihub.mtls.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) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ApiHubDependenciesStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ApiHubDependenciesStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiHubDependenciesStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 ApiHubDependenciesStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createDependencySettings = settingsBuilder.createDependencySettings().build(); + getDependencySettings = settingsBuilder.getDependencySettings().build(); + updateDependencySettings = settingsBuilder.updateDependencySettings().build(); + deleteDependencySettings = settingsBuilder.deleteDependencySettings().build(); + listDependenciesSettings = settingsBuilder.listDependenciesSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + } + + /** Builder for ApiHubDependenciesStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + createDependencySettings; + private final UnaryCallSettings.Builder getDependencySettings; + private final UnaryCallSettings.Builder + updateDependencySettings; + private final UnaryCallSettings.Builder + deleteDependencySettings; + private final PagedCallSettings.Builder< + ListDependenciesRequest, ListDependenciesResponse, ListDependenciesPagedResponse> + listDependenciesSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + 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() + .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() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .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().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); + + createDependencySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getDependencySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateDependencySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteDependencySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listDependenciesSettings = PagedCallSettings.newBuilder(LIST_DEPENDENCIES_PAGE_STR_FACT); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createDependencySettings, + getDependencySettings, + updateDependencySettings, + deleteDependencySettings, + listDependenciesSettings, + listLocationsSettings, + getLocationSettings); + initDefaults(this); + } + + protected Builder(ApiHubDependenciesStubSettings settings) { + super(settings); + + createDependencySettings = settings.createDependencySettings.toBuilder(); + getDependencySettings = settings.getDependencySettings.toBuilder(); + updateDependencySettings = settings.updateDependencySettings.toBuilder(); + deleteDependencySettings = settings.deleteDependencySettings.toBuilder(); + listDependenciesSettings = settings.listDependenciesSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createDependencySettings, + getDependencySettings, + updateDependencySettings, + deleteDependencySettings, + listDependenciesSettings, + listLocationsSettings, + getLocationSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createDependencySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getDependencySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateDependencySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteDependencySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .listDependenciesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + return builder; + } + + /** + * 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) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createDependency. */ + public UnaryCallSettings.Builder + createDependencySettings() { + return createDependencySettings; + } + + /** Returns the builder for the settings used for calls to getDependency. */ + public UnaryCallSettings.Builder getDependencySettings() { + return getDependencySettings; + } + + /** Returns the builder for the settings used for calls to updateDependency. */ + public UnaryCallSettings.Builder + updateDependencySettings() { + return updateDependencySettings; + } + + /** Returns the builder for the settings used for calls to deleteDependency. */ + public UnaryCallSettings.Builder deleteDependencySettings() { + return deleteDependencySettings; + } + + /** Returns the builder for the settings used for calls to listDependencies. */ + public PagedCallSettings.Builder< + ListDependenciesRequest, ListDependenciesResponse, ListDependenciesPagedResponse> + listDependenciesSettings() { + return listDependenciesSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + @Override + public ApiHubDependenciesStubSettings build() throws IOException { + return new ApiHubDependenciesStubSettings(this); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ApiHubPluginStub.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ApiHubPluginStub.java new file mode 100644 index 000000000000..8e11c0f724f1 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ApiHubPluginStub.java @@ -0,0 +1,69 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import static com.google.cloud.apihub.v1.ApiHubPluginClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.apihub.v1.DisablePluginRequest; +import com.google.cloud.apihub.v1.EnablePluginRequest; +import com.google.cloud.apihub.v1.GetPluginRequest; +import com.google.cloud.apihub.v1.Plugin; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the ApiHubPlugin service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class ApiHubPluginStub implements BackgroundResource { + + public UnaryCallable getPluginCallable() { + throw new UnsupportedOperationException("Not implemented: getPluginCallable()"); + } + + public UnaryCallable enablePluginCallable() { + throw new UnsupportedOperationException("Not implemented: enablePluginCallable()"); + } + + public UnaryCallable disablePluginCallable() { + throw new UnsupportedOperationException("Not implemented: disablePluginCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ApiHubPluginStubSettings.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ApiHubPluginStubSettings.java new file mode 100644 index 000000000000..60b5e8011c9f --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ApiHubPluginStubSettings.java @@ -0,0 +1,507 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import static com.google.cloud.apihub.v1.ApiHubPluginClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.core.ObsoleteApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.apihub.v1.DisablePluginRequest; +import com.google.cloud.apihub.v1.EnablePluginRequest; +import com.google.cloud.apihub.v1.GetPluginRequest; +import com.google.cloud.apihub.v1.Plugin; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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 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 ApiHubPluginStub}. + * + *

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

    + *
  • The default service address (apihub.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 getPlugin to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ApiHubPluginStubSettings.Builder apiHubPluginSettingsBuilder =
+ *     ApiHubPluginStubSettings.newBuilder();
+ * apiHubPluginSettingsBuilder
+ *     .getPluginSettings()
+ *     .setRetrySettings(
+ *         apiHubPluginSettingsBuilder
+ *             .getPluginSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ApiHubPluginStubSettings apiHubPluginSettings = apiHubPluginSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class ApiHubPluginStubSettings 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").build(); + + private final UnaryCallSettings getPluginSettings; + private final UnaryCallSettings enablePluginSettings; + private final UnaryCallSettings disablePluginSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to getPlugin. */ + public UnaryCallSettings getPluginSettings() { + return getPluginSettings; + } + + /** Returns the object with the settings used for calls to enablePlugin. */ + public UnaryCallSettings enablePluginSettings() { + return enablePluginSettings; + } + + /** Returns the object with the settings used for calls to disablePlugin. */ + public UnaryCallSettings disablePluginSettings() { + return disablePluginSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + public ApiHubPluginStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcApiHubPluginStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonApiHubPluginStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "apihub"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "apihub.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "apihub.mtls.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) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ApiHubPluginStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ApiHubPluginStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiHubPluginStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 ApiHubPluginStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getPluginSettings = settingsBuilder.getPluginSettings().build(); + enablePluginSettings = settingsBuilder.enablePluginSettings().build(); + disablePluginSettings = settingsBuilder.disablePluginSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + } + + /** Builder for ApiHubPluginStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder getPluginSettings; + private final UnaryCallSettings.Builder enablePluginSettings; + private final UnaryCallSettings.Builder disablePluginSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + 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(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .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); + + getPluginSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + enablePluginSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + disablePluginSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getPluginSettings, + enablePluginSettings, + disablePluginSettings, + listLocationsSettings, + getLocationSettings); + initDefaults(this); + } + + protected Builder(ApiHubPluginStubSettings settings) { + super(settings); + + getPluginSettings = settings.getPluginSettings.toBuilder(); + enablePluginSettings = settings.enablePluginSettings.toBuilder(); + disablePluginSettings = settings.disablePluginSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getPluginSettings, + enablePluginSettings, + disablePluginSettings, + listLocationsSettings, + getLocationSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .getPluginSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .enablePluginSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .disablePluginSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + return builder; + } + + /** + * 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) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to getPlugin. */ + public UnaryCallSettings.Builder getPluginSettings() { + return getPluginSettings; + } + + /** Returns the builder for the settings used for calls to enablePlugin. */ + public UnaryCallSettings.Builder enablePluginSettings() { + return enablePluginSettings; + } + + /** Returns the builder for the settings used for calls to disablePlugin. */ + public UnaryCallSettings.Builder disablePluginSettings() { + return disablePluginSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + @Override + public ApiHubPluginStubSettings build() throws IOException { + return new ApiHubPluginStubSettings(this); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ApiHubStub.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ApiHubStub.java new file mode 100644 index 000000000000..76f77f305838 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ApiHubStub.java @@ -0,0 +1,293 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import static com.google.cloud.apihub.v1.ApiHubClient.ListApiOperationsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListApisPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListAttributesPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListDeploymentsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListExternalApisPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListLocationsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListSpecsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListVersionsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.SearchResourcesPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.apihub.v1.Api; +import com.google.cloud.apihub.v1.ApiOperation; +import com.google.cloud.apihub.v1.Attribute; +import com.google.cloud.apihub.v1.CreateApiRequest; +import com.google.cloud.apihub.v1.CreateAttributeRequest; +import com.google.cloud.apihub.v1.CreateDeploymentRequest; +import com.google.cloud.apihub.v1.CreateExternalApiRequest; +import com.google.cloud.apihub.v1.CreateSpecRequest; +import com.google.cloud.apihub.v1.CreateVersionRequest; +import com.google.cloud.apihub.v1.Definition; +import com.google.cloud.apihub.v1.DeleteApiRequest; +import com.google.cloud.apihub.v1.DeleteAttributeRequest; +import com.google.cloud.apihub.v1.DeleteDeploymentRequest; +import com.google.cloud.apihub.v1.DeleteExternalApiRequest; +import com.google.cloud.apihub.v1.DeleteSpecRequest; +import com.google.cloud.apihub.v1.DeleteVersionRequest; +import com.google.cloud.apihub.v1.Deployment; +import com.google.cloud.apihub.v1.ExternalApi; +import com.google.cloud.apihub.v1.GetApiOperationRequest; +import com.google.cloud.apihub.v1.GetApiRequest; +import com.google.cloud.apihub.v1.GetAttributeRequest; +import com.google.cloud.apihub.v1.GetDefinitionRequest; +import com.google.cloud.apihub.v1.GetDeploymentRequest; +import com.google.cloud.apihub.v1.GetExternalApiRequest; +import com.google.cloud.apihub.v1.GetSpecContentsRequest; +import com.google.cloud.apihub.v1.GetSpecRequest; +import com.google.cloud.apihub.v1.GetVersionRequest; +import com.google.cloud.apihub.v1.ListApiOperationsRequest; +import com.google.cloud.apihub.v1.ListApiOperationsResponse; +import com.google.cloud.apihub.v1.ListApisRequest; +import com.google.cloud.apihub.v1.ListApisResponse; +import com.google.cloud.apihub.v1.ListAttributesRequest; +import com.google.cloud.apihub.v1.ListAttributesResponse; +import com.google.cloud.apihub.v1.ListDeploymentsRequest; +import com.google.cloud.apihub.v1.ListDeploymentsResponse; +import com.google.cloud.apihub.v1.ListExternalApisRequest; +import com.google.cloud.apihub.v1.ListExternalApisResponse; +import com.google.cloud.apihub.v1.ListSpecsRequest; +import com.google.cloud.apihub.v1.ListSpecsResponse; +import com.google.cloud.apihub.v1.ListVersionsRequest; +import com.google.cloud.apihub.v1.ListVersionsResponse; +import com.google.cloud.apihub.v1.SearchResourcesRequest; +import com.google.cloud.apihub.v1.SearchResourcesResponse; +import com.google.cloud.apihub.v1.Spec; +import com.google.cloud.apihub.v1.SpecContents; +import com.google.cloud.apihub.v1.UpdateApiRequest; +import com.google.cloud.apihub.v1.UpdateAttributeRequest; +import com.google.cloud.apihub.v1.UpdateDeploymentRequest; +import com.google.cloud.apihub.v1.UpdateExternalApiRequest; +import com.google.cloud.apihub.v1.UpdateSpecRequest; +import com.google.cloud.apihub.v1.UpdateVersionRequest; +import com.google.cloud.apihub.v1.Version; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the ApiHub service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class ApiHubStub implements BackgroundResource { + + public UnaryCallable createApiCallable() { + throw new UnsupportedOperationException("Not implemented: createApiCallable()"); + } + + public UnaryCallable getApiCallable() { + throw new UnsupportedOperationException("Not implemented: getApiCallable()"); + } + + public UnaryCallable listApisPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listApisPagedCallable()"); + } + + public UnaryCallable listApisCallable() { + throw new UnsupportedOperationException("Not implemented: listApisCallable()"); + } + + public UnaryCallable updateApiCallable() { + throw new UnsupportedOperationException("Not implemented: updateApiCallable()"); + } + + public UnaryCallable deleteApiCallable() { + throw new UnsupportedOperationException("Not implemented: deleteApiCallable()"); + } + + public UnaryCallable createVersionCallable() { + throw new UnsupportedOperationException("Not implemented: createVersionCallable()"); + } + + public UnaryCallable getVersionCallable() { + throw new UnsupportedOperationException("Not implemented: getVersionCallable()"); + } + + public UnaryCallable listVersionsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listVersionsPagedCallable()"); + } + + public UnaryCallable listVersionsCallable() { + throw new UnsupportedOperationException("Not implemented: listVersionsCallable()"); + } + + public UnaryCallable updateVersionCallable() { + throw new UnsupportedOperationException("Not implemented: updateVersionCallable()"); + } + + public UnaryCallable deleteVersionCallable() { + throw new UnsupportedOperationException("Not implemented: deleteVersionCallable()"); + } + + public UnaryCallable createSpecCallable() { + throw new UnsupportedOperationException("Not implemented: createSpecCallable()"); + } + + public UnaryCallable getSpecCallable() { + throw new UnsupportedOperationException("Not implemented: getSpecCallable()"); + } + + public UnaryCallable getSpecContentsCallable() { + throw new UnsupportedOperationException("Not implemented: getSpecContentsCallable()"); + } + + public UnaryCallable listSpecsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listSpecsPagedCallable()"); + } + + public UnaryCallable listSpecsCallable() { + throw new UnsupportedOperationException("Not implemented: listSpecsCallable()"); + } + + public UnaryCallable updateSpecCallable() { + throw new UnsupportedOperationException("Not implemented: updateSpecCallable()"); + } + + public UnaryCallable deleteSpecCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSpecCallable()"); + } + + public UnaryCallable getApiOperationCallable() { + throw new UnsupportedOperationException("Not implemented: getApiOperationCallable()"); + } + + public UnaryCallable + listApiOperationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listApiOperationsPagedCallable()"); + } + + public UnaryCallable + listApiOperationsCallable() { + throw new UnsupportedOperationException("Not implemented: listApiOperationsCallable()"); + } + + public UnaryCallable getDefinitionCallable() { + throw new UnsupportedOperationException("Not implemented: getDefinitionCallable()"); + } + + public UnaryCallable createDeploymentCallable() { + throw new UnsupportedOperationException("Not implemented: createDeploymentCallable()"); + } + + public UnaryCallable getDeploymentCallable() { + throw new UnsupportedOperationException("Not implemented: getDeploymentCallable()"); + } + + public UnaryCallable + listDeploymentsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listDeploymentsPagedCallable()"); + } + + public UnaryCallable listDeploymentsCallable() { + throw new UnsupportedOperationException("Not implemented: listDeploymentsCallable()"); + } + + public UnaryCallable updateDeploymentCallable() { + throw new UnsupportedOperationException("Not implemented: updateDeploymentCallable()"); + } + + public UnaryCallable deleteDeploymentCallable() { + throw new UnsupportedOperationException("Not implemented: deleteDeploymentCallable()"); + } + + public UnaryCallable createAttributeCallable() { + throw new UnsupportedOperationException("Not implemented: createAttributeCallable()"); + } + + public UnaryCallable getAttributeCallable() { + throw new UnsupportedOperationException("Not implemented: getAttributeCallable()"); + } + + public UnaryCallable updateAttributeCallable() { + throw new UnsupportedOperationException("Not implemented: updateAttributeCallable()"); + } + + public UnaryCallable deleteAttributeCallable() { + throw new UnsupportedOperationException("Not implemented: deleteAttributeCallable()"); + } + + public UnaryCallable + listAttributesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listAttributesPagedCallable()"); + } + + public UnaryCallable listAttributesCallable() { + throw new UnsupportedOperationException("Not implemented: listAttributesCallable()"); + } + + public UnaryCallable + searchResourcesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: searchResourcesPagedCallable()"); + } + + public UnaryCallable searchResourcesCallable() { + throw new UnsupportedOperationException("Not implemented: searchResourcesCallable()"); + } + + public UnaryCallable createExternalApiCallable() { + throw new UnsupportedOperationException("Not implemented: createExternalApiCallable()"); + } + + public UnaryCallable getExternalApiCallable() { + throw new UnsupportedOperationException("Not implemented: getExternalApiCallable()"); + } + + public UnaryCallable updateExternalApiCallable() { + throw new UnsupportedOperationException("Not implemented: updateExternalApiCallable()"); + } + + public UnaryCallable deleteExternalApiCallable() { + throw new UnsupportedOperationException("Not implemented: deleteExternalApiCallable()"); + } + + public UnaryCallable + listExternalApisPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listExternalApisPagedCallable()"); + } + + public UnaryCallable + listExternalApisCallable() { + throw new UnsupportedOperationException("Not implemented: listExternalApisCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ApiHubStubSettings.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ApiHubStubSettings.java new file mode 100644 index 000000000000..92573a1acc47 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ApiHubStubSettings.java @@ -0,0 +1,1786 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import static com.google.cloud.apihub.v1.ApiHubClient.ListApiOperationsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListApisPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListAttributesPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListDeploymentsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListExternalApisPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListLocationsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListSpecsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListVersionsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.SearchResourcesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.core.ObsoleteApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.apihub.v1.Api; +import com.google.cloud.apihub.v1.ApiOperation; +import com.google.cloud.apihub.v1.Attribute; +import com.google.cloud.apihub.v1.CreateApiRequest; +import com.google.cloud.apihub.v1.CreateAttributeRequest; +import com.google.cloud.apihub.v1.CreateDeploymentRequest; +import com.google.cloud.apihub.v1.CreateExternalApiRequest; +import com.google.cloud.apihub.v1.CreateSpecRequest; +import com.google.cloud.apihub.v1.CreateVersionRequest; +import com.google.cloud.apihub.v1.Definition; +import com.google.cloud.apihub.v1.DeleteApiRequest; +import com.google.cloud.apihub.v1.DeleteAttributeRequest; +import com.google.cloud.apihub.v1.DeleteDeploymentRequest; +import com.google.cloud.apihub.v1.DeleteExternalApiRequest; +import com.google.cloud.apihub.v1.DeleteSpecRequest; +import com.google.cloud.apihub.v1.DeleteVersionRequest; +import com.google.cloud.apihub.v1.Deployment; +import com.google.cloud.apihub.v1.ExternalApi; +import com.google.cloud.apihub.v1.GetApiOperationRequest; +import com.google.cloud.apihub.v1.GetApiRequest; +import com.google.cloud.apihub.v1.GetAttributeRequest; +import com.google.cloud.apihub.v1.GetDefinitionRequest; +import com.google.cloud.apihub.v1.GetDeploymentRequest; +import com.google.cloud.apihub.v1.GetExternalApiRequest; +import com.google.cloud.apihub.v1.GetSpecContentsRequest; +import com.google.cloud.apihub.v1.GetSpecRequest; +import com.google.cloud.apihub.v1.GetVersionRequest; +import com.google.cloud.apihub.v1.ListApiOperationsRequest; +import com.google.cloud.apihub.v1.ListApiOperationsResponse; +import com.google.cloud.apihub.v1.ListApisRequest; +import com.google.cloud.apihub.v1.ListApisResponse; +import com.google.cloud.apihub.v1.ListAttributesRequest; +import com.google.cloud.apihub.v1.ListAttributesResponse; +import com.google.cloud.apihub.v1.ListDeploymentsRequest; +import com.google.cloud.apihub.v1.ListDeploymentsResponse; +import com.google.cloud.apihub.v1.ListExternalApisRequest; +import com.google.cloud.apihub.v1.ListExternalApisResponse; +import com.google.cloud.apihub.v1.ListSpecsRequest; +import com.google.cloud.apihub.v1.ListSpecsResponse; +import com.google.cloud.apihub.v1.ListVersionsRequest; +import com.google.cloud.apihub.v1.ListVersionsResponse; +import com.google.cloud.apihub.v1.SearchResourcesRequest; +import com.google.cloud.apihub.v1.SearchResourcesResponse; +import com.google.cloud.apihub.v1.SearchResult; +import com.google.cloud.apihub.v1.Spec; +import com.google.cloud.apihub.v1.SpecContents; +import com.google.cloud.apihub.v1.UpdateApiRequest; +import com.google.cloud.apihub.v1.UpdateAttributeRequest; +import com.google.cloud.apihub.v1.UpdateDeploymentRequest; +import com.google.cloud.apihub.v1.UpdateExternalApiRequest; +import com.google.cloud.apihub.v1.UpdateSpecRequest; +import com.google.cloud.apihub.v1.UpdateVersionRequest; +import com.google.cloud.apihub.v1.Version; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.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 ApiHubStub}. + * + *

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

    + *
  • The default service address (apihub.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 createApi to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ApiHubStubSettings.Builder apiHubSettingsBuilder = ApiHubStubSettings.newBuilder();
+ * apiHubSettingsBuilder
+ *     .createApiSettings()
+ *     .setRetrySettings(
+ *         apiHubSettingsBuilder
+ *             .createApiSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ApiHubStubSettings apiHubSettings = apiHubSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class ApiHubStubSettings 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").build(); + + private final UnaryCallSettings createApiSettings; + private final UnaryCallSettings getApiSettings; + private final PagedCallSettings + listApisSettings; + private final UnaryCallSettings updateApiSettings; + private final UnaryCallSettings deleteApiSettings; + private final UnaryCallSettings createVersionSettings; + private final UnaryCallSettings getVersionSettings; + private final PagedCallSettings< + ListVersionsRequest, ListVersionsResponse, ListVersionsPagedResponse> + listVersionsSettings; + private final UnaryCallSettings updateVersionSettings; + private final UnaryCallSettings deleteVersionSettings; + private final UnaryCallSettings createSpecSettings; + private final UnaryCallSettings getSpecSettings; + private final UnaryCallSettings getSpecContentsSettings; + private final PagedCallSettings + listSpecsSettings; + private final UnaryCallSettings updateSpecSettings; + private final UnaryCallSettings deleteSpecSettings; + private final UnaryCallSettings getApiOperationSettings; + private final PagedCallSettings< + ListApiOperationsRequest, ListApiOperationsResponse, ListApiOperationsPagedResponse> + listApiOperationsSettings; + private final UnaryCallSettings getDefinitionSettings; + private final UnaryCallSettings createDeploymentSettings; + private final UnaryCallSettings getDeploymentSettings; + private final PagedCallSettings< + ListDeploymentsRequest, ListDeploymentsResponse, ListDeploymentsPagedResponse> + listDeploymentsSettings; + private final UnaryCallSettings updateDeploymentSettings; + private final UnaryCallSettings deleteDeploymentSettings; + private final UnaryCallSettings createAttributeSettings; + private final UnaryCallSettings getAttributeSettings; + private final UnaryCallSettings updateAttributeSettings; + private final UnaryCallSettings deleteAttributeSettings; + private final PagedCallSettings< + ListAttributesRequest, ListAttributesResponse, ListAttributesPagedResponse> + listAttributesSettings; + private final PagedCallSettings< + SearchResourcesRequest, SearchResourcesResponse, SearchResourcesPagedResponse> + searchResourcesSettings; + private final UnaryCallSettings createExternalApiSettings; + private final UnaryCallSettings getExternalApiSettings; + private final UnaryCallSettings updateExternalApiSettings; + private final UnaryCallSettings deleteExternalApiSettings; + private final PagedCallSettings< + ListExternalApisRequest, ListExternalApisResponse, ListExternalApisPagedResponse> + listExternalApisSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + + private static final PagedListDescriptor + LIST_APIS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListApisRequest injectToken(ListApisRequest payload, String token) { + return ListApisRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListApisRequest injectPageSize(ListApisRequest payload, int pageSize) { + return ListApisRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListApisRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListApisResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListApisResponse payload) { + return payload.getApisList() == null + ? ImmutableList.of() + : payload.getApisList(); + } + }; + + private static final PagedListDescriptor + LIST_VERSIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListVersionsRequest injectToken(ListVersionsRequest payload, String token) { + return ListVersionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListVersionsRequest injectPageSize(ListVersionsRequest payload, int pageSize) { + return ListVersionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListVersionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListVersionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListVersionsResponse payload) { + return payload.getVersionsList() == null + ? ImmutableList.of() + : payload.getVersionsList(); + } + }; + + private static final PagedListDescriptor + LIST_SPECS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSpecsRequest injectToken(ListSpecsRequest payload, String token) { + return ListSpecsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListSpecsRequest injectPageSize(ListSpecsRequest payload, int pageSize) { + return ListSpecsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListSpecsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSpecsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListSpecsResponse payload) { + return payload.getSpecsList() == null + ? ImmutableList.of() + : payload.getSpecsList(); + } + }; + + private static final PagedListDescriptor< + ListApiOperationsRequest, ListApiOperationsResponse, ApiOperation> + LIST_API_OPERATIONS_PAGE_STR_DESC = + new PagedListDescriptor< + ListApiOperationsRequest, ListApiOperationsResponse, ApiOperation>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListApiOperationsRequest injectToken( + ListApiOperationsRequest payload, String token) { + return ListApiOperationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListApiOperationsRequest injectPageSize( + ListApiOperationsRequest payload, int pageSize) { + return ListApiOperationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListApiOperationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListApiOperationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListApiOperationsResponse payload) { + return payload.getApiOperationsList() == null + ? ImmutableList.of() + : payload.getApiOperationsList(); + } + }; + + private static final PagedListDescriptor< + ListDeploymentsRequest, ListDeploymentsResponse, Deployment> + LIST_DEPLOYMENTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListDeploymentsRequest injectToken( + ListDeploymentsRequest payload, String token) { + return ListDeploymentsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListDeploymentsRequest injectPageSize( + ListDeploymentsRequest payload, int pageSize) { + return ListDeploymentsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListDeploymentsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListDeploymentsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListDeploymentsResponse payload) { + return payload.getDeploymentsList() == null + ? ImmutableList.of() + : payload.getDeploymentsList(); + } + }; + + private static final PagedListDescriptor + LIST_ATTRIBUTES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListAttributesRequest injectToken(ListAttributesRequest payload, String token) { + return ListAttributesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListAttributesRequest injectPageSize( + ListAttributesRequest payload, int pageSize) { + return ListAttributesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListAttributesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListAttributesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListAttributesResponse payload) { + return payload.getAttributesList() == null + ? ImmutableList.of() + : payload.getAttributesList(); + } + }; + + private static final PagedListDescriptor< + SearchResourcesRequest, SearchResourcesResponse, SearchResult> + SEARCH_RESOURCES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public SearchResourcesRequest injectToken( + SearchResourcesRequest payload, String token) { + return SearchResourcesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public SearchResourcesRequest injectPageSize( + SearchResourcesRequest payload, int pageSize) { + return SearchResourcesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(SearchResourcesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(SearchResourcesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(SearchResourcesResponse payload) { + return payload.getSearchResultsList() == null + ? ImmutableList.of() + : payload.getSearchResultsList(); + } + }; + + private static final PagedListDescriptor< + ListExternalApisRequest, ListExternalApisResponse, ExternalApi> + LIST_EXTERNAL_APIS_PAGE_STR_DESC = + new PagedListDescriptor< + ListExternalApisRequest, ListExternalApisResponse, ExternalApi>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListExternalApisRequest injectToken( + ListExternalApisRequest payload, String token) { + return ListExternalApisRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListExternalApisRequest injectPageSize( + ListExternalApisRequest payload, int pageSize) { + return ListExternalApisRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListExternalApisRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListExternalApisResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListExternalApisResponse payload) { + return payload.getExternalApisList() == null + ? ImmutableList.of() + : payload.getExternalApisList(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListApisRequest, ListApisResponse, ListApisPagedResponse> + LIST_APIS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListApisRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_APIS_PAGE_STR_DESC, request, context); + return ListApisPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListVersionsRequest, ListVersionsResponse, ListVersionsPagedResponse> + LIST_VERSIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListVersionsRequest, ListVersionsResponse, ListVersionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListVersionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_VERSIONS_PAGE_STR_DESC, request, context); + return ListVersionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListSpecsRequest, ListSpecsResponse, ListSpecsPagedResponse> + LIST_SPECS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSpecsRequest, ListSpecsResponse, ListSpecsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListSpecsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SPECS_PAGE_STR_DESC, request, context); + return ListSpecsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListApiOperationsRequest, ListApiOperationsResponse, ListApiOperationsPagedResponse> + LIST_API_OPERATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListApiOperationsRequest, + ListApiOperationsResponse, + ListApiOperationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListApiOperationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_API_OPERATIONS_PAGE_STR_DESC, request, context); + return ListApiOperationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListDeploymentsRequest, ListDeploymentsResponse, ListDeploymentsPagedResponse> + LIST_DEPLOYMENTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListDeploymentsRequest, ListDeploymentsResponse, ListDeploymentsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListDeploymentsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_DEPLOYMENTS_PAGE_STR_DESC, request, context); + return ListDeploymentsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListAttributesRequest, ListAttributesResponse, ListAttributesPagedResponse> + LIST_ATTRIBUTES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListAttributesRequest, ListAttributesResponse, ListAttributesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListAttributesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_ATTRIBUTES_PAGE_STR_DESC, request, context); + return ListAttributesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + SearchResourcesRequest, SearchResourcesResponse, SearchResourcesPagedResponse> + SEARCH_RESOURCES_PAGE_STR_FACT = + new PagedListResponseFactory< + SearchResourcesRequest, SearchResourcesResponse, SearchResourcesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + SearchResourcesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, SEARCH_RESOURCES_PAGE_STR_DESC, request, context); + return SearchResourcesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListExternalApisRequest, ListExternalApisResponse, ListExternalApisPagedResponse> + LIST_EXTERNAL_APIS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListExternalApisRequest, ListExternalApisResponse, ListExternalApisPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListExternalApisRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_EXTERNAL_APIS_PAGE_STR_DESC, request, context); + return ListExternalApisPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createApi. */ + public UnaryCallSettings createApiSettings() { + return createApiSettings; + } + + /** Returns the object with the settings used for calls to getApi. */ + public UnaryCallSettings getApiSettings() { + return getApiSettings; + } + + /** Returns the object with the settings used for calls to listApis. */ + public PagedCallSettings + listApisSettings() { + return listApisSettings; + } + + /** Returns the object with the settings used for calls to updateApi. */ + public UnaryCallSettings updateApiSettings() { + return updateApiSettings; + } + + /** Returns the object with the settings used for calls to deleteApi. */ + public UnaryCallSettings deleteApiSettings() { + return deleteApiSettings; + } + + /** Returns the object with the settings used for calls to createVersion. */ + public UnaryCallSettings createVersionSettings() { + return createVersionSettings; + } + + /** Returns the object with the settings used for calls to getVersion. */ + public UnaryCallSettings getVersionSettings() { + return getVersionSettings; + } + + /** Returns the object with the settings used for calls to listVersions. */ + public PagedCallSettings + listVersionsSettings() { + return listVersionsSettings; + } + + /** Returns the object with the settings used for calls to updateVersion. */ + public UnaryCallSettings updateVersionSettings() { + return updateVersionSettings; + } + + /** Returns the object with the settings used for calls to deleteVersion. */ + public UnaryCallSettings deleteVersionSettings() { + return deleteVersionSettings; + } + + /** Returns the object with the settings used for calls to createSpec. */ + public UnaryCallSettings createSpecSettings() { + return createSpecSettings; + } + + /** Returns the object with the settings used for calls to getSpec. */ + public UnaryCallSettings getSpecSettings() { + return getSpecSettings; + } + + /** Returns the object with the settings used for calls to getSpecContents. */ + public UnaryCallSettings getSpecContentsSettings() { + return getSpecContentsSettings; + } + + /** Returns the object with the settings used for calls to listSpecs. */ + public PagedCallSettings + listSpecsSettings() { + return listSpecsSettings; + } + + /** Returns the object with the settings used for calls to updateSpec. */ + public UnaryCallSettings updateSpecSettings() { + return updateSpecSettings; + } + + /** Returns the object with the settings used for calls to deleteSpec. */ + public UnaryCallSettings deleteSpecSettings() { + return deleteSpecSettings; + } + + /** Returns the object with the settings used for calls to getApi. */ + public UnaryCallSettings getApiOperationSettings() { + return getApiOperationSettings; + } + + /** Returns the object with the settings used for calls to listApiOperations. */ + public PagedCallSettings< + ListApiOperationsRequest, ListApiOperationsResponse, ListApiOperationsPagedResponse> + listApiOperationsSettings() { + return listApiOperationsSettings; + } + + /** Returns the object with the settings used for calls to getDefinition. */ + public UnaryCallSettings getDefinitionSettings() { + return getDefinitionSettings; + } + + /** Returns the object with the settings used for calls to createDeployment. */ + public UnaryCallSettings createDeploymentSettings() { + return createDeploymentSettings; + } + + /** Returns the object with the settings used for calls to getDeployment. */ + public UnaryCallSettings getDeploymentSettings() { + return getDeploymentSettings; + } + + /** Returns the object with the settings used for calls to listDeployments. */ + public PagedCallSettings< + ListDeploymentsRequest, ListDeploymentsResponse, ListDeploymentsPagedResponse> + listDeploymentsSettings() { + return listDeploymentsSettings; + } + + /** Returns the object with the settings used for calls to updateDeployment. */ + public UnaryCallSettings updateDeploymentSettings() { + return updateDeploymentSettings; + } + + /** Returns the object with the settings used for calls to deleteDeployment. */ + public UnaryCallSettings deleteDeploymentSettings() { + return deleteDeploymentSettings; + } + + /** Returns the object with the settings used for calls to createAttribute. */ + public UnaryCallSettings createAttributeSettings() { + return createAttributeSettings; + } + + /** Returns the object with the settings used for calls to getAttribute. */ + public UnaryCallSettings getAttributeSettings() { + return getAttributeSettings; + } + + /** Returns the object with the settings used for calls to updateAttribute. */ + public UnaryCallSettings updateAttributeSettings() { + return updateAttributeSettings; + } + + /** Returns the object with the settings used for calls to deleteAttribute. */ + public UnaryCallSettings deleteAttributeSettings() { + return deleteAttributeSettings; + } + + /** Returns the object with the settings used for calls to listAttributes. */ + public PagedCallSettings< + ListAttributesRequest, ListAttributesResponse, ListAttributesPagedResponse> + listAttributesSettings() { + return listAttributesSettings; + } + + /** Returns the object with the settings used for calls to searchResources. */ + public PagedCallSettings< + SearchResourcesRequest, SearchResourcesResponse, SearchResourcesPagedResponse> + searchResourcesSettings() { + return searchResourcesSettings; + } + + /** Returns the object with the settings used for calls to createExternalApi. */ + public UnaryCallSettings createExternalApiSettings() { + return createExternalApiSettings; + } + + /** Returns the object with the settings used for calls to getExternalApi. */ + public UnaryCallSettings getExternalApiSettings() { + return getExternalApiSettings; + } + + /** Returns the object with the settings used for calls to updateExternalApi. */ + public UnaryCallSettings updateExternalApiSettings() { + return updateExternalApiSettings; + } + + /** Returns the object with the settings used for calls to deleteExternalApi. */ + public UnaryCallSettings deleteExternalApiSettings() { + return deleteExternalApiSettings; + } + + /** Returns the object with the settings used for calls to listExternalApis. */ + public PagedCallSettings< + ListExternalApisRequest, ListExternalApisResponse, ListExternalApisPagedResponse> + listExternalApisSettings() { + return listExternalApisSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + public ApiHubStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcApiHubStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonApiHubStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "apihub"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "apihub.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "apihub.mtls.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) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(ApiHubStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(ApiHubStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiHubStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 ApiHubStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createApiSettings = settingsBuilder.createApiSettings().build(); + getApiSettings = settingsBuilder.getApiSettings().build(); + listApisSettings = settingsBuilder.listApisSettings().build(); + updateApiSettings = settingsBuilder.updateApiSettings().build(); + deleteApiSettings = settingsBuilder.deleteApiSettings().build(); + createVersionSettings = settingsBuilder.createVersionSettings().build(); + getVersionSettings = settingsBuilder.getVersionSettings().build(); + listVersionsSettings = settingsBuilder.listVersionsSettings().build(); + updateVersionSettings = settingsBuilder.updateVersionSettings().build(); + deleteVersionSettings = settingsBuilder.deleteVersionSettings().build(); + createSpecSettings = settingsBuilder.createSpecSettings().build(); + getSpecSettings = settingsBuilder.getSpecSettings().build(); + getSpecContentsSettings = settingsBuilder.getSpecContentsSettings().build(); + listSpecsSettings = settingsBuilder.listSpecsSettings().build(); + updateSpecSettings = settingsBuilder.updateSpecSettings().build(); + deleteSpecSettings = settingsBuilder.deleteSpecSettings().build(); + getApiOperationSettings = settingsBuilder.getApiOperationSettings().build(); + listApiOperationsSettings = settingsBuilder.listApiOperationsSettings().build(); + getDefinitionSettings = settingsBuilder.getDefinitionSettings().build(); + createDeploymentSettings = settingsBuilder.createDeploymentSettings().build(); + getDeploymentSettings = settingsBuilder.getDeploymentSettings().build(); + listDeploymentsSettings = settingsBuilder.listDeploymentsSettings().build(); + updateDeploymentSettings = settingsBuilder.updateDeploymentSettings().build(); + deleteDeploymentSettings = settingsBuilder.deleteDeploymentSettings().build(); + createAttributeSettings = settingsBuilder.createAttributeSettings().build(); + getAttributeSettings = settingsBuilder.getAttributeSettings().build(); + updateAttributeSettings = settingsBuilder.updateAttributeSettings().build(); + deleteAttributeSettings = settingsBuilder.deleteAttributeSettings().build(); + listAttributesSettings = settingsBuilder.listAttributesSettings().build(); + searchResourcesSettings = settingsBuilder.searchResourcesSettings().build(); + createExternalApiSettings = settingsBuilder.createExternalApiSettings().build(); + getExternalApiSettings = settingsBuilder.getExternalApiSettings().build(); + updateExternalApiSettings = settingsBuilder.updateExternalApiSettings().build(); + deleteExternalApiSettings = settingsBuilder.deleteExternalApiSettings().build(); + listExternalApisSettings = settingsBuilder.listExternalApisSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + } + + /** Builder for ApiHubStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createApiSettings; + private final UnaryCallSettings.Builder getApiSettings; + private final PagedCallSettings.Builder< + ListApisRequest, ListApisResponse, ListApisPagedResponse> + listApisSettings; + private final UnaryCallSettings.Builder updateApiSettings; + private final UnaryCallSettings.Builder deleteApiSettings; + private final UnaryCallSettings.Builder createVersionSettings; + private final UnaryCallSettings.Builder getVersionSettings; + private final PagedCallSettings.Builder< + ListVersionsRequest, ListVersionsResponse, ListVersionsPagedResponse> + listVersionsSettings; + private final UnaryCallSettings.Builder updateVersionSettings; + private final UnaryCallSettings.Builder deleteVersionSettings; + private final UnaryCallSettings.Builder createSpecSettings; + private final UnaryCallSettings.Builder getSpecSettings; + private final UnaryCallSettings.Builder + getSpecContentsSettings; + private final PagedCallSettings.Builder< + ListSpecsRequest, ListSpecsResponse, ListSpecsPagedResponse> + listSpecsSettings; + private final UnaryCallSettings.Builder updateSpecSettings; + private final UnaryCallSettings.Builder deleteSpecSettings; + private final UnaryCallSettings.Builder + getApiOperationSettings; + private final PagedCallSettings.Builder< + ListApiOperationsRequest, ListApiOperationsResponse, ListApiOperationsPagedResponse> + listApiOperationsSettings; + private final UnaryCallSettings.Builder getDefinitionSettings; + private final UnaryCallSettings.Builder + createDeploymentSettings; + private final UnaryCallSettings.Builder getDeploymentSettings; + private final PagedCallSettings.Builder< + ListDeploymentsRequest, ListDeploymentsResponse, ListDeploymentsPagedResponse> + listDeploymentsSettings; + private final UnaryCallSettings.Builder + updateDeploymentSettings; + private final UnaryCallSettings.Builder + deleteDeploymentSettings; + private final UnaryCallSettings.Builder + createAttributeSettings; + private final UnaryCallSettings.Builder getAttributeSettings; + private final UnaryCallSettings.Builder + updateAttributeSettings; + private final UnaryCallSettings.Builder deleteAttributeSettings; + private final PagedCallSettings.Builder< + ListAttributesRequest, ListAttributesResponse, ListAttributesPagedResponse> + listAttributesSettings; + private final PagedCallSettings.Builder< + SearchResourcesRequest, SearchResourcesResponse, SearchResourcesPagedResponse> + searchResourcesSettings; + private final UnaryCallSettings.Builder + createExternalApiSettings; + private final UnaryCallSettings.Builder + getExternalApiSettings; + private final UnaryCallSettings.Builder + updateExternalApiSettings; + private final UnaryCallSettings.Builder + deleteExternalApiSettings; + private final PagedCallSettings.Builder< + ListExternalApisRequest, ListExternalApisResponse, ListExternalApisPagedResponse> + listExternalApisSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + 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() + .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() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .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().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); + + createApiSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getApiSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listApisSettings = PagedCallSettings.newBuilder(LIST_APIS_PAGE_STR_FACT); + updateApiSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteApiSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listVersionsSettings = PagedCallSettings.newBuilder(LIST_VERSIONS_PAGE_STR_FACT); + updateVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createSpecSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getSpecSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getSpecContentsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listSpecsSettings = PagedCallSettings.newBuilder(LIST_SPECS_PAGE_STR_FACT); + updateSpecSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteSpecSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getApiOperationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listApiOperationsSettings = PagedCallSettings.newBuilder(LIST_API_OPERATIONS_PAGE_STR_FACT); + getDefinitionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createDeploymentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getDeploymentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listDeploymentsSettings = PagedCallSettings.newBuilder(LIST_DEPLOYMENTS_PAGE_STR_FACT); + updateDeploymentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteDeploymentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createAttributeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getAttributeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateAttributeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteAttributeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listAttributesSettings = PagedCallSettings.newBuilder(LIST_ATTRIBUTES_PAGE_STR_FACT); + searchResourcesSettings = PagedCallSettings.newBuilder(SEARCH_RESOURCES_PAGE_STR_FACT); + createExternalApiSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getExternalApiSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateExternalApiSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteExternalApiSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listExternalApisSettings = PagedCallSettings.newBuilder(LIST_EXTERNAL_APIS_PAGE_STR_FACT); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createApiSettings, + getApiSettings, + listApisSettings, + updateApiSettings, + deleteApiSettings, + createVersionSettings, + getVersionSettings, + listVersionsSettings, + updateVersionSettings, + deleteVersionSettings, + createSpecSettings, + getSpecSettings, + getSpecContentsSettings, + listSpecsSettings, + updateSpecSettings, + deleteSpecSettings, + getApiOperationSettings, + listApiOperationsSettings, + getDefinitionSettings, + createDeploymentSettings, + getDeploymentSettings, + listDeploymentsSettings, + updateDeploymentSettings, + deleteDeploymentSettings, + createAttributeSettings, + getAttributeSettings, + updateAttributeSettings, + deleteAttributeSettings, + listAttributesSettings, + searchResourcesSettings, + createExternalApiSettings, + getExternalApiSettings, + updateExternalApiSettings, + deleteExternalApiSettings, + listExternalApisSettings, + listLocationsSettings, + getLocationSettings); + initDefaults(this); + } + + protected Builder(ApiHubStubSettings settings) { + super(settings); + + createApiSettings = settings.createApiSettings.toBuilder(); + getApiSettings = settings.getApiSettings.toBuilder(); + listApisSettings = settings.listApisSettings.toBuilder(); + updateApiSettings = settings.updateApiSettings.toBuilder(); + deleteApiSettings = settings.deleteApiSettings.toBuilder(); + createVersionSettings = settings.createVersionSettings.toBuilder(); + getVersionSettings = settings.getVersionSettings.toBuilder(); + listVersionsSettings = settings.listVersionsSettings.toBuilder(); + updateVersionSettings = settings.updateVersionSettings.toBuilder(); + deleteVersionSettings = settings.deleteVersionSettings.toBuilder(); + createSpecSettings = settings.createSpecSettings.toBuilder(); + getSpecSettings = settings.getSpecSettings.toBuilder(); + getSpecContentsSettings = settings.getSpecContentsSettings.toBuilder(); + listSpecsSettings = settings.listSpecsSettings.toBuilder(); + updateSpecSettings = settings.updateSpecSettings.toBuilder(); + deleteSpecSettings = settings.deleteSpecSettings.toBuilder(); + getApiOperationSettings = settings.getApiOperationSettings.toBuilder(); + listApiOperationsSettings = settings.listApiOperationsSettings.toBuilder(); + getDefinitionSettings = settings.getDefinitionSettings.toBuilder(); + createDeploymentSettings = settings.createDeploymentSettings.toBuilder(); + getDeploymentSettings = settings.getDeploymentSettings.toBuilder(); + listDeploymentsSettings = settings.listDeploymentsSettings.toBuilder(); + updateDeploymentSettings = settings.updateDeploymentSettings.toBuilder(); + deleteDeploymentSettings = settings.deleteDeploymentSettings.toBuilder(); + createAttributeSettings = settings.createAttributeSettings.toBuilder(); + getAttributeSettings = settings.getAttributeSettings.toBuilder(); + updateAttributeSettings = settings.updateAttributeSettings.toBuilder(); + deleteAttributeSettings = settings.deleteAttributeSettings.toBuilder(); + listAttributesSettings = settings.listAttributesSettings.toBuilder(); + searchResourcesSettings = settings.searchResourcesSettings.toBuilder(); + createExternalApiSettings = settings.createExternalApiSettings.toBuilder(); + getExternalApiSettings = settings.getExternalApiSettings.toBuilder(); + updateExternalApiSettings = settings.updateExternalApiSettings.toBuilder(); + deleteExternalApiSettings = settings.deleteExternalApiSettings.toBuilder(); + listExternalApisSettings = settings.listExternalApisSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createApiSettings, + getApiSettings, + listApisSettings, + updateApiSettings, + deleteApiSettings, + createVersionSettings, + getVersionSettings, + listVersionsSettings, + updateVersionSettings, + deleteVersionSettings, + createSpecSettings, + getSpecSettings, + getSpecContentsSettings, + listSpecsSettings, + updateSpecSettings, + deleteSpecSettings, + getApiOperationSettings, + listApiOperationsSettings, + getDefinitionSettings, + createDeploymentSettings, + getDeploymentSettings, + listDeploymentsSettings, + updateDeploymentSettings, + deleteDeploymentSettings, + createAttributeSettings, + getAttributeSettings, + updateAttributeSettings, + deleteAttributeSettings, + listAttributesSettings, + searchResourcesSettings, + createExternalApiSettings, + getExternalApiSettings, + updateExternalApiSettings, + deleteExternalApiSettings, + listExternalApisSettings, + listLocationsSettings, + getLocationSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createApiSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getApiSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listApisSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateApiSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteApiSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .createVersionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getVersionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listVersionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateVersionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteVersionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .createSpecSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getSpecSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getSpecContentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listSpecsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateSpecSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteSpecSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getApiOperationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listApiOperationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getDefinitionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createDeploymentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getDeploymentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listDeploymentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateDeploymentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteDeploymentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .createAttributeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getAttributeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateAttributeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteAttributeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .listAttributesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .searchResourcesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createExternalApiSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getExternalApiSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateExternalApiSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteExternalApiSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .listExternalApisSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + return builder; + } + + /** + * 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) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createApi. */ + public UnaryCallSettings.Builder createApiSettings() { + return createApiSettings; + } + + /** Returns the builder for the settings used for calls to getApi. */ + public UnaryCallSettings.Builder getApiSettings() { + return getApiSettings; + } + + /** Returns the builder for the settings used for calls to listApis. */ + public PagedCallSettings.Builder + listApisSettings() { + return listApisSettings; + } + + /** Returns the builder for the settings used for calls to updateApi. */ + public UnaryCallSettings.Builder updateApiSettings() { + return updateApiSettings; + } + + /** Returns the builder for the settings used for calls to deleteApi. */ + public UnaryCallSettings.Builder deleteApiSettings() { + return deleteApiSettings; + } + + /** Returns the builder for the settings used for calls to createVersion. */ + public UnaryCallSettings.Builder createVersionSettings() { + return createVersionSettings; + } + + /** Returns the builder for the settings used for calls to getVersion. */ + public UnaryCallSettings.Builder getVersionSettings() { + return getVersionSettings; + } + + /** Returns the builder for the settings used for calls to listVersions. */ + public PagedCallSettings.Builder< + ListVersionsRequest, ListVersionsResponse, ListVersionsPagedResponse> + listVersionsSettings() { + return listVersionsSettings; + } + + /** Returns the builder for the settings used for calls to updateVersion. */ + public UnaryCallSettings.Builder updateVersionSettings() { + return updateVersionSettings; + } + + /** Returns the builder for the settings used for calls to deleteVersion. */ + public UnaryCallSettings.Builder deleteVersionSettings() { + return deleteVersionSettings; + } + + /** Returns the builder for the settings used for calls to createSpec. */ + public UnaryCallSettings.Builder createSpecSettings() { + return createSpecSettings; + } + + /** Returns the builder for the settings used for calls to getSpec. */ + public UnaryCallSettings.Builder getSpecSettings() { + return getSpecSettings; + } + + /** Returns the builder for the settings used for calls to getSpecContents. */ + public UnaryCallSettings.Builder + getSpecContentsSettings() { + return getSpecContentsSettings; + } + + /** Returns the builder for the settings used for calls to listSpecs. */ + public PagedCallSettings.Builder + listSpecsSettings() { + return listSpecsSettings; + } + + /** Returns the builder for the settings used for calls to updateSpec. */ + public UnaryCallSettings.Builder updateSpecSettings() { + return updateSpecSettings; + } + + /** Returns the builder for the settings used for calls to deleteSpec. */ + public UnaryCallSettings.Builder deleteSpecSettings() { + return deleteSpecSettings; + } + + /** Returns the builder for the settings used for calls to getApi. */ + public UnaryCallSettings.Builder + getApiOperationSettings() { + return getApiOperationSettings; + } + + /** Returns the builder for the settings used for calls to listApiOperations. */ + public PagedCallSettings.Builder< + ListApiOperationsRequest, ListApiOperationsResponse, ListApiOperationsPagedResponse> + listApiOperationsSettings() { + return listApiOperationsSettings; + } + + /** Returns the builder for the settings used for calls to getDefinition. */ + public UnaryCallSettings.Builder getDefinitionSettings() { + return getDefinitionSettings; + } + + /** Returns the builder for the settings used for calls to createDeployment. */ + public UnaryCallSettings.Builder + createDeploymentSettings() { + return createDeploymentSettings; + } + + /** Returns the builder for the settings used for calls to getDeployment. */ + public UnaryCallSettings.Builder getDeploymentSettings() { + return getDeploymentSettings; + } + + /** Returns the builder for the settings used for calls to listDeployments. */ + public PagedCallSettings.Builder< + ListDeploymentsRequest, ListDeploymentsResponse, ListDeploymentsPagedResponse> + listDeploymentsSettings() { + return listDeploymentsSettings; + } + + /** Returns the builder for the settings used for calls to updateDeployment. */ + public UnaryCallSettings.Builder + updateDeploymentSettings() { + return updateDeploymentSettings; + } + + /** Returns the builder for the settings used for calls to deleteDeployment. */ + public UnaryCallSettings.Builder deleteDeploymentSettings() { + return deleteDeploymentSettings; + } + + /** Returns the builder for the settings used for calls to createAttribute. */ + public UnaryCallSettings.Builder createAttributeSettings() { + return createAttributeSettings; + } + + /** Returns the builder for the settings used for calls to getAttribute. */ + public UnaryCallSettings.Builder getAttributeSettings() { + return getAttributeSettings; + } + + /** Returns the builder for the settings used for calls to updateAttribute. */ + public UnaryCallSettings.Builder updateAttributeSettings() { + return updateAttributeSettings; + } + + /** Returns the builder for the settings used for calls to deleteAttribute. */ + public UnaryCallSettings.Builder deleteAttributeSettings() { + return deleteAttributeSettings; + } + + /** Returns the builder for the settings used for calls to listAttributes. */ + public PagedCallSettings.Builder< + ListAttributesRequest, ListAttributesResponse, ListAttributesPagedResponse> + listAttributesSettings() { + return listAttributesSettings; + } + + /** Returns the builder for the settings used for calls to searchResources. */ + public PagedCallSettings.Builder< + SearchResourcesRequest, SearchResourcesResponse, SearchResourcesPagedResponse> + searchResourcesSettings() { + return searchResourcesSettings; + } + + /** Returns the builder for the settings used for calls to createExternalApi. */ + public UnaryCallSettings.Builder + createExternalApiSettings() { + return createExternalApiSettings; + } + + /** Returns the builder for the settings used for calls to getExternalApi. */ + public UnaryCallSettings.Builder getExternalApiSettings() { + return getExternalApiSettings; + } + + /** Returns the builder for the settings used for calls to updateExternalApi. */ + public UnaryCallSettings.Builder + updateExternalApiSettings() { + return updateExternalApiSettings; + } + + /** Returns the builder for the settings used for calls to deleteExternalApi. */ + public UnaryCallSettings.Builder deleteExternalApiSettings() { + return deleteExternalApiSettings; + } + + /** Returns the builder for the settings used for calls to listExternalApis. */ + public PagedCallSettings.Builder< + ListExternalApisRequest, ListExternalApisResponse, ListExternalApisPagedResponse> + listExternalApisSettings() { + return listExternalApisSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + @Override + public ApiHubStubSettings build() throws IOException { + return new ApiHubStubSettings(this); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcApiHubCallableFactory.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcApiHubCallableFactory.java new file mode 100644 index 000000000000..f89eecfb50cb --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcApiHubCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.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 ApiHub service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcApiHubCallableFactory 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-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcApiHubDependenciesCallableFactory.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcApiHubDependenciesCallableFactory.java new file mode 100644 index 000000000000..4ece1fb1b51d --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcApiHubDependenciesCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.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 ApiHubDependencies service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcApiHubDependenciesCallableFactory 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-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcApiHubDependenciesStub.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcApiHubDependenciesStub.java new file mode 100644 index 000000000000..5f2c324ba451 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcApiHubDependenciesStub.java @@ -0,0 +1,374 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import static com.google.cloud.apihub.v1.ApiHubDependenciesClient.ListDependenciesPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubDependenciesClient.ListLocationsPagedResponse; + +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.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.apihub.v1.CreateDependencyRequest; +import com.google.cloud.apihub.v1.DeleteDependencyRequest; +import com.google.cloud.apihub.v1.Dependency; +import com.google.cloud.apihub.v1.GetDependencyRequest; +import com.google.cloud.apihub.v1.ListDependenciesRequest; +import com.google.cloud.apihub.v1.ListDependenciesResponse; +import com.google.cloud.apihub.v1.UpdateDependencyRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the ApiHubDependencies service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcApiHubDependenciesStub extends ApiHubDependenciesStub { + private static final MethodDescriptor + createDependencyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHubDependencies/CreateDependency") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateDependencyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Dependency.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getDependencyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHubDependencies/GetDependency") + .setRequestMarshaller( + ProtoUtils.marshaller(GetDependencyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Dependency.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateDependencyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHubDependencies/UpdateDependency") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateDependencyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Dependency.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteDependencyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHubDependencies/DeleteDependency") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteDependencyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listDependenciesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHubDependencies/ListDependencies") + .setRequestMarshaller( + ProtoUtils.marshaller(ListDependenciesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListDependenciesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + + private final UnaryCallable createDependencyCallable; + private final UnaryCallable getDependencyCallable; + private final UnaryCallable updateDependencyCallable; + private final UnaryCallable deleteDependencyCallable; + private final UnaryCallable + listDependenciesCallable; + private final UnaryCallable + listDependenciesPagedCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcApiHubDependenciesStub create(ApiHubDependenciesStubSettings settings) + throws IOException { + return new GrpcApiHubDependenciesStub(settings, ClientContext.create(settings)); + } + + public static final GrpcApiHubDependenciesStub create(ClientContext clientContext) + throws IOException { + return new GrpcApiHubDependenciesStub( + ApiHubDependenciesStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcApiHubDependenciesStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcApiHubDependenciesStub( + ApiHubDependenciesStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcApiHubDependenciesStub, 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 GrpcApiHubDependenciesStub( + ApiHubDependenciesStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcApiHubDependenciesCallableFactory()); + } + + /** + * Constructs an instance of GrpcApiHubDependenciesStub, 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 GrpcApiHubDependenciesStub( + ApiHubDependenciesStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createDependencyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createDependencyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getDependencyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getDependencyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateDependencyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateDependencyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("dependency.name", String.valueOf(request.getDependency().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteDependencyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteDependencyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listDependenciesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listDependenciesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.createDependencyCallable = + callableFactory.createUnaryCallable( + createDependencyTransportSettings, settings.createDependencySettings(), clientContext); + this.getDependencyCallable = + callableFactory.createUnaryCallable( + getDependencyTransportSettings, settings.getDependencySettings(), clientContext); + this.updateDependencyCallable = + callableFactory.createUnaryCallable( + updateDependencyTransportSettings, settings.updateDependencySettings(), clientContext); + this.deleteDependencyCallable = + callableFactory.createUnaryCallable( + deleteDependencyTransportSettings, settings.deleteDependencySettings(), clientContext); + this.listDependenciesCallable = + callableFactory.createUnaryCallable( + listDependenciesTransportSettings, settings.listDependenciesSettings(), clientContext); + this.listDependenciesPagedCallable = + callableFactory.createPagedCallable( + listDependenciesTransportSettings, settings.listDependenciesSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createDependencyCallable() { + return createDependencyCallable; + } + + @Override + public UnaryCallable getDependencyCallable() { + return getDependencyCallable; + } + + @Override + public UnaryCallable updateDependencyCallable() { + return updateDependencyCallable; + } + + @Override + public UnaryCallable deleteDependencyCallable() { + return deleteDependencyCallable; + } + + @Override + public UnaryCallable + listDependenciesCallable() { + return listDependenciesCallable; + } + + @Override + public UnaryCallable + listDependenciesPagedCallable() { + return listDependenciesPagedCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @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-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcApiHubPluginCallableFactory.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcApiHubPluginCallableFactory.java new file mode 100644 index 000000000000..019deb313fe2 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcApiHubPluginCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.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 ApiHubPlugin service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcApiHubPluginCallableFactory 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-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcApiHubPluginStub.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcApiHubPluginStub.java new file mode 100644 index 000000000000..e5c1f64cb7b2 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcApiHubPluginStub.java @@ -0,0 +1,290 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import static com.google.cloud.apihub.v1.ApiHubPluginClient.ListLocationsPagedResponse; + +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.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.apihub.v1.DisablePluginRequest; +import com.google.cloud.apihub.v1.EnablePluginRequest; +import com.google.cloud.apihub.v1.GetPluginRequest; +import com.google.cloud.apihub.v1.Plugin; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the ApiHubPlugin service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcApiHubPluginStub extends ApiHubPluginStub { + private static final MethodDescriptor getPluginMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHubPlugin/GetPlugin") + .setRequestMarshaller(ProtoUtils.marshaller(GetPluginRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Plugin.getDefaultInstance())) + .build(); + + private static final MethodDescriptor enablePluginMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHubPlugin/EnablePlugin") + .setRequestMarshaller(ProtoUtils.marshaller(EnablePluginRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Plugin.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + disablePluginMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHubPlugin/DisablePlugin") + .setRequestMarshaller( + ProtoUtils.marshaller(DisablePluginRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Plugin.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + + private final UnaryCallable getPluginCallable; + private final UnaryCallable enablePluginCallable; + private final UnaryCallable disablePluginCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcApiHubPluginStub create(ApiHubPluginStubSettings settings) + throws IOException { + return new GrpcApiHubPluginStub(settings, ClientContext.create(settings)); + } + + public static final GrpcApiHubPluginStub create(ClientContext clientContext) throws IOException { + return new GrpcApiHubPluginStub(ApiHubPluginStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcApiHubPluginStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcApiHubPluginStub( + ApiHubPluginStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcApiHubPluginStub, 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 GrpcApiHubPluginStub(ApiHubPluginStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcApiHubPluginCallableFactory()); + } + + /** + * Constructs an instance of GrpcApiHubPluginStub, 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 GrpcApiHubPluginStub( + ApiHubPluginStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings getPluginTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getPluginMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings enablePluginTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(enablePluginMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings disablePluginTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(disablePluginMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.getPluginCallable = + callableFactory.createUnaryCallable( + getPluginTransportSettings, settings.getPluginSettings(), clientContext); + this.enablePluginCallable = + callableFactory.createUnaryCallable( + enablePluginTransportSettings, settings.enablePluginSettings(), clientContext); + this.disablePluginCallable = + callableFactory.createUnaryCallable( + disablePluginTransportSettings, settings.disablePluginSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable getPluginCallable() { + return getPluginCallable; + } + + @Override + public UnaryCallable enablePluginCallable() { + return enablePluginCallable; + } + + @Override + public UnaryCallable disablePluginCallable() { + return disablePluginCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @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-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcApiHubStub.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcApiHubStub.java new file mode 100644 index 000000000000..70f5cf60a50e --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcApiHubStub.java @@ -0,0 +1,1363 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import static com.google.cloud.apihub.v1.ApiHubClient.ListApiOperationsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListApisPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListAttributesPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListDeploymentsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListExternalApisPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListLocationsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListSpecsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListVersionsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.SearchResourcesPagedResponse; + +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.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.apihub.v1.Api; +import com.google.cloud.apihub.v1.ApiOperation; +import com.google.cloud.apihub.v1.Attribute; +import com.google.cloud.apihub.v1.CreateApiRequest; +import com.google.cloud.apihub.v1.CreateAttributeRequest; +import com.google.cloud.apihub.v1.CreateDeploymentRequest; +import com.google.cloud.apihub.v1.CreateExternalApiRequest; +import com.google.cloud.apihub.v1.CreateSpecRequest; +import com.google.cloud.apihub.v1.CreateVersionRequest; +import com.google.cloud.apihub.v1.Definition; +import com.google.cloud.apihub.v1.DeleteApiRequest; +import com.google.cloud.apihub.v1.DeleteAttributeRequest; +import com.google.cloud.apihub.v1.DeleteDeploymentRequest; +import com.google.cloud.apihub.v1.DeleteExternalApiRequest; +import com.google.cloud.apihub.v1.DeleteSpecRequest; +import com.google.cloud.apihub.v1.DeleteVersionRequest; +import com.google.cloud.apihub.v1.Deployment; +import com.google.cloud.apihub.v1.ExternalApi; +import com.google.cloud.apihub.v1.GetApiOperationRequest; +import com.google.cloud.apihub.v1.GetApiRequest; +import com.google.cloud.apihub.v1.GetAttributeRequest; +import com.google.cloud.apihub.v1.GetDefinitionRequest; +import com.google.cloud.apihub.v1.GetDeploymentRequest; +import com.google.cloud.apihub.v1.GetExternalApiRequest; +import com.google.cloud.apihub.v1.GetSpecContentsRequest; +import com.google.cloud.apihub.v1.GetSpecRequest; +import com.google.cloud.apihub.v1.GetVersionRequest; +import com.google.cloud.apihub.v1.ListApiOperationsRequest; +import com.google.cloud.apihub.v1.ListApiOperationsResponse; +import com.google.cloud.apihub.v1.ListApisRequest; +import com.google.cloud.apihub.v1.ListApisResponse; +import com.google.cloud.apihub.v1.ListAttributesRequest; +import com.google.cloud.apihub.v1.ListAttributesResponse; +import com.google.cloud.apihub.v1.ListDeploymentsRequest; +import com.google.cloud.apihub.v1.ListDeploymentsResponse; +import com.google.cloud.apihub.v1.ListExternalApisRequest; +import com.google.cloud.apihub.v1.ListExternalApisResponse; +import com.google.cloud.apihub.v1.ListSpecsRequest; +import com.google.cloud.apihub.v1.ListSpecsResponse; +import com.google.cloud.apihub.v1.ListVersionsRequest; +import com.google.cloud.apihub.v1.ListVersionsResponse; +import com.google.cloud.apihub.v1.SearchResourcesRequest; +import com.google.cloud.apihub.v1.SearchResourcesResponse; +import com.google.cloud.apihub.v1.Spec; +import com.google.cloud.apihub.v1.SpecContents; +import com.google.cloud.apihub.v1.UpdateApiRequest; +import com.google.cloud.apihub.v1.UpdateAttributeRequest; +import com.google.cloud.apihub.v1.UpdateDeploymentRequest; +import com.google.cloud.apihub.v1.UpdateExternalApiRequest; +import com.google.cloud.apihub.v1.UpdateSpecRequest; +import com.google.cloud.apihub.v1.UpdateVersionRequest; +import com.google.cloud.apihub.v1.Version; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the ApiHub service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcApiHubStub extends ApiHubStub { + private static final MethodDescriptor createApiMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/CreateApi") + .setRequestMarshaller(ProtoUtils.marshaller(CreateApiRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Api.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getApiMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/GetApi") + .setRequestMarshaller(ProtoUtils.marshaller(GetApiRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Api.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listApisMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/ListApis") + .setRequestMarshaller(ProtoUtils.marshaller(ListApisRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListApisResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor updateApiMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/UpdateApi") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateApiRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Api.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteApiMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/DeleteApi") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteApiRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/CreateVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Version.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/GetVersion") + .setRequestMarshaller(ProtoUtils.marshaller(GetVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Version.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listVersionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/ListVersions") + .setRequestMarshaller(ProtoUtils.marshaller(ListVersionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListVersionsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/UpdateVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Version.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/DeleteVersion") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor createSpecMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/CreateSpec") + .setRequestMarshaller(ProtoUtils.marshaller(CreateSpecRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Spec.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getSpecMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/GetSpec") + .setRequestMarshaller(ProtoUtils.marshaller(GetSpecRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Spec.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getSpecContentsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/GetSpecContents") + .setRequestMarshaller( + ProtoUtils.marshaller(GetSpecContentsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SpecContents.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listSpecsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/ListSpecs") + .setRequestMarshaller(ProtoUtils.marshaller(ListSpecsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListSpecsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor updateSpecMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/UpdateSpec") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateSpecRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Spec.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteSpecMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/DeleteSpec") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteSpecRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getApiOperationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/GetApiOperation") + .setRequestMarshaller( + ProtoUtils.marshaller(GetApiOperationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ApiOperation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listApiOperationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/ListApiOperations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListApiOperationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListApiOperationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getDefinitionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/GetDefinition") + .setRequestMarshaller( + ProtoUtils.marshaller(GetDefinitionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Definition.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createDeploymentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/CreateDeployment") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateDeploymentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Deployment.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getDeploymentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/GetDeployment") + .setRequestMarshaller( + ProtoUtils.marshaller(GetDeploymentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Deployment.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listDeploymentsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/ListDeployments") + .setRequestMarshaller( + ProtoUtils.marshaller(ListDeploymentsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListDeploymentsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateDeploymentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/UpdateDeployment") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateDeploymentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Deployment.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteDeploymentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/DeleteDeployment") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteDeploymentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createAttributeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/CreateAttribute") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateAttributeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Attribute.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getAttributeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/GetAttribute") + .setRequestMarshaller(ProtoUtils.marshaller(GetAttributeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Attribute.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateAttributeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/UpdateAttribute") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateAttributeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Attribute.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteAttributeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/DeleteAttribute") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteAttributeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listAttributesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/ListAttributes") + .setRequestMarshaller( + ProtoUtils.marshaller(ListAttributesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListAttributesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + searchResourcesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/SearchResources") + .setRequestMarshaller( + ProtoUtils.marshaller(SearchResourcesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(SearchResourcesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createExternalApiMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/CreateExternalApi") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateExternalApiRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ExternalApi.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getExternalApiMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/GetExternalApi") + .setRequestMarshaller( + ProtoUtils.marshaller(GetExternalApiRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ExternalApi.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateExternalApiMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/UpdateExternalApi") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateExternalApiRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ExternalApi.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteExternalApiMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/DeleteExternalApi") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteExternalApiRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listExternalApisMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.ApiHub/ListExternalApis") + .setRequestMarshaller( + ProtoUtils.marshaller(ListExternalApisRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListExternalApisResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + + private final UnaryCallable createApiCallable; + private final UnaryCallable getApiCallable; + private final UnaryCallable listApisCallable; + private final UnaryCallable listApisPagedCallable; + private final UnaryCallable updateApiCallable; + private final UnaryCallable deleteApiCallable; + private final UnaryCallable createVersionCallable; + private final UnaryCallable getVersionCallable; + private final UnaryCallable listVersionsCallable; + private final UnaryCallable + listVersionsPagedCallable; + private final UnaryCallable updateVersionCallable; + private final UnaryCallable deleteVersionCallable; + private final UnaryCallable createSpecCallable; + private final UnaryCallable getSpecCallable; + private final UnaryCallable getSpecContentsCallable; + private final UnaryCallable listSpecsCallable; + private final UnaryCallable listSpecsPagedCallable; + private final UnaryCallable updateSpecCallable; + private final UnaryCallable deleteSpecCallable; + private final UnaryCallable getApiOperationCallable; + private final UnaryCallable + listApiOperationsCallable; + private final UnaryCallable + listApiOperationsPagedCallable; + private final UnaryCallable getDefinitionCallable; + private final UnaryCallable createDeploymentCallable; + private final UnaryCallable getDeploymentCallable; + private final UnaryCallable + listDeploymentsCallable; + private final UnaryCallable + listDeploymentsPagedCallable; + private final UnaryCallable updateDeploymentCallable; + private final UnaryCallable deleteDeploymentCallable; + private final UnaryCallable createAttributeCallable; + private final UnaryCallable getAttributeCallable; + private final UnaryCallable updateAttributeCallable; + private final UnaryCallable deleteAttributeCallable; + private final UnaryCallable listAttributesCallable; + private final UnaryCallable + listAttributesPagedCallable; + private final UnaryCallable + searchResourcesCallable; + private final UnaryCallable + searchResourcesPagedCallable; + private final UnaryCallable createExternalApiCallable; + private final UnaryCallable getExternalApiCallable; + private final UnaryCallable updateExternalApiCallable; + private final UnaryCallable deleteExternalApiCallable; + private final UnaryCallable + listExternalApisCallable; + private final UnaryCallable + listExternalApisPagedCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcApiHubStub create(ApiHubStubSettings settings) throws IOException { + return new GrpcApiHubStub(settings, ClientContext.create(settings)); + } + + public static final GrpcApiHubStub create(ClientContext clientContext) throws IOException { + return new GrpcApiHubStub(ApiHubStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcApiHubStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcApiHubStub( + ApiHubStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcApiHubStub, 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 GrpcApiHubStub(ApiHubStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcApiHubCallableFactory()); + } + + /** + * Constructs an instance of GrpcApiHubStub, 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 GrpcApiHubStub( + ApiHubStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createApiTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createApiMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getApiTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getApiMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listApisTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listApisMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateApiTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateApiMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("api.name", String.valueOf(request.getApi().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteApiTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteApiMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings createVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createVersionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getVersionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listVersionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listVersionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateVersionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("version.name", String.valueOf(request.getVersion().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteVersionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings createSpecTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSpecMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getSpecTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSpecMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getSpecContentsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSpecContentsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listSpecsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listSpecsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateSpecTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateSpecMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("spec.name", String.valueOf(request.getSpec().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteSpecTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteSpecMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getApiOperationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getApiOperationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listApiOperationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listApiOperationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getDefinitionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getDefinitionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings createDeploymentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createDeploymentMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getDeploymentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getDeploymentMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listDeploymentsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listDeploymentsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateDeploymentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateDeploymentMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("deployment.name", String.valueOf(request.getDeployment().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteDeploymentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteDeploymentMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings createAttributeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createAttributeMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getAttributeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getAttributeMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateAttributeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateAttributeMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("attribute.name", String.valueOf(request.getAttribute().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteAttributeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteAttributeMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listAttributesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listAttributesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + searchResourcesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(searchResourcesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("location", String.valueOf(request.getLocation())); + return builder.build(); + }) + .build(); + GrpcCallSettings createExternalApiTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createExternalApiMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getExternalApiTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getExternalApiMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateExternalApiTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateExternalApiMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "external_api.name", String.valueOf(request.getExternalApi().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteExternalApiTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteExternalApiMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listExternalApisTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listExternalApisMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.createApiCallable = + callableFactory.createUnaryCallable( + createApiTransportSettings, settings.createApiSettings(), clientContext); + this.getApiCallable = + callableFactory.createUnaryCallable( + getApiTransportSettings, settings.getApiSettings(), clientContext); + this.listApisCallable = + callableFactory.createUnaryCallable( + listApisTransportSettings, settings.listApisSettings(), clientContext); + this.listApisPagedCallable = + callableFactory.createPagedCallable( + listApisTransportSettings, settings.listApisSettings(), clientContext); + this.updateApiCallable = + callableFactory.createUnaryCallable( + updateApiTransportSettings, settings.updateApiSettings(), clientContext); + this.deleteApiCallable = + callableFactory.createUnaryCallable( + deleteApiTransportSettings, settings.deleteApiSettings(), clientContext); + this.createVersionCallable = + callableFactory.createUnaryCallable( + createVersionTransportSettings, settings.createVersionSettings(), clientContext); + this.getVersionCallable = + callableFactory.createUnaryCallable( + getVersionTransportSettings, settings.getVersionSettings(), clientContext); + this.listVersionsCallable = + callableFactory.createUnaryCallable( + listVersionsTransportSettings, settings.listVersionsSettings(), clientContext); + this.listVersionsPagedCallable = + callableFactory.createPagedCallable( + listVersionsTransportSettings, settings.listVersionsSettings(), clientContext); + this.updateVersionCallable = + callableFactory.createUnaryCallable( + updateVersionTransportSettings, settings.updateVersionSettings(), clientContext); + this.deleteVersionCallable = + callableFactory.createUnaryCallable( + deleteVersionTransportSettings, settings.deleteVersionSettings(), clientContext); + this.createSpecCallable = + callableFactory.createUnaryCallable( + createSpecTransportSettings, settings.createSpecSettings(), clientContext); + this.getSpecCallable = + callableFactory.createUnaryCallable( + getSpecTransportSettings, settings.getSpecSettings(), clientContext); + this.getSpecContentsCallable = + callableFactory.createUnaryCallable( + getSpecContentsTransportSettings, settings.getSpecContentsSettings(), clientContext); + this.listSpecsCallable = + callableFactory.createUnaryCallable( + listSpecsTransportSettings, settings.listSpecsSettings(), clientContext); + this.listSpecsPagedCallable = + callableFactory.createPagedCallable( + listSpecsTransportSettings, settings.listSpecsSettings(), clientContext); + this.updateSpecCallable = + callableFactory.createUnaryCallable( + updateSpecTransportSettings, settings.updateSpecSettings(), clientContext); + this.deleteSpecCallable = + callableFactory.createUnaryCallable( + deleteSpecTransportSettings, settings.deleteSpecSettings(), clientContext); + this.getApiOperationCallable = + callableFactory.createUnaryCallable( + getApiOperationTransportSettings, settings.getApiOperationSettings(), clientContext); + this.listApiOperationsCallable = + callableFactory.createUnaryCallable( + listApiOperationsTransportSettings, + settings.listApiOperationsSettings(), + clientContext); + this.listApiOperationsPagedCallable = + callableFactory.createPagedCallable( + listApiOperationsTransportSettings, + settings.listApiOperationsSettings(), + clientContext); + this.getDefinitionCallable = + callableFactory.createUnaryCallable( + getDefinitionTransportSettings, settings.getDefinitionSettings(), clientContext); + this.createDeploymentCallable = + callableFactory.createUnaryCallable( + createDeploymentTransportSettings, settings.createDeploymentSettings(), clientContext); + this.getDeploymentCallable = + callableFactory.createUnaryCallable( + getDeploymentTransportSettings, settings.getDeploymentSettings(), clientContext); + this.listDeploymentsCallable = + callableFactory.createUnaryCallable( + listDeploymentsTransportSettings, settings.listDeploymentsSettings(), clientContext); + this.listDeploymentsPagedCallable = + callableFactory.createPagedCallable( + listDeploymentsTransportSettings, settings.listDeploymentsSettings(), clientContext); + this.updateDeploymentCallable = + callableFactory.createUnaryCallable( + updateDeploymentTransportSettings, settings.updateDeploymentSettings(), clientContext); + this.deleteDeploymentCallable = + callableFactory.createUnaryCallable( + deleteDeploymentTransportSettings, settings.deleteDeploymentSettings(), clientContext); + this.createAttributeCallable = + callableFactory.createUnaryCallable( + createAttributeTransportSettings, settings.createAttributeSettings(), clientContext); + this.getAttributeCallable = + callableFactory.createUnaryCallable( + getAttributeTransportSettings, settings.getAttributeSettings(), clientContext); + this.updateAttributeCallable = + callableFactory.createUnaryCallable( + updateAttributeTransportSettings, settings.updateAttributeSettings(), clientContext); + this.deleteAttributeCallable = + callableFactory.createUnaryCallable( + deleteAttributeTransportSettings, settings.deleteAttributeSettings(), clientContext); + this.listAttributesCallable = + callableFactory.createUnaryCallable( + listAttributesTransportSettings, settings.listAttributesSettings(), clientContext); + this.listAttributesPagedCallable = + callableFactory.createPagedCallable( + listAttributesTransportSettings, settings.listAttributesSettings(), clientContext); + this.searchResourcesCallable = + callableFactory.createUnaryCallable( + searchResourcesTransportSettings, settings.searchResourcesSettings(), clientContext); + this.searchResourcesPagedCallable = + callableFactory.createPagedCallable( + searchResourcesTransportSettings, settings.searchResourcesSettings(), clientContext); + this.createExternalApiCallable = + callableFactory.createUnaryCallable( + createExternalApiTransportSettings, + settings.createExternalApiSettings(), + clientContext); + this.getExternalApiCallable = + callableFactory.createUnaryCallable( + getExternalApiTransportSettings, settings.getExternalApiSettings(), clientContext); + this.updateExternalApiCallable = + callableFactory.createUnaryCallable( + updateExternalApiTransportSettings, + settings.updateExternalApiSettings(), + clientContext); + this.deleteExternalApiCallable = + callableFactory.createUnaryCallable( + deleteExternalApiTransportSettings, + settings.deleteExternalApiSettings(), + clientContext); + this.listExternalApisCallable = + callableFactory.createUnaryCallable( + listExternalApisTransportSettings, settings.listExternalApisSettings(), clientContext); + this.listExternalApisPagedCallable = + callableFactory.createPagedCallable( + listExternalApisTransportSettings, settings.listExternalApisSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createApiCallable() { + return createApiCallable; + } + + @Override + public UnaryCallable getApiCallable() { + return getApiCallable; + } + + @Override + public UnaryCallable listApisCallable() { + return listApisCallable; + } + + @Override + public UnaryCallable listApisPagedCallable() { + return listApisPagedCallable; + } + + @Override + public UnaryCallable updateApiCallable() { + return updateApiCallable; + } + + @Override + public UnaryCallable deleteApiCallable() { + return deleteApiCallable; + } + + @Override + public UnaryCallable createVersionCallable() { + return createVersionCallable; + } + + @Override + public UnaryCallable getVersionCallable() { + return getVersionCallable; + } + + @Override + public UnaryCallable listVersionsCallable() { + return listVersionsCallable; + } + + @Override + public UnaryCallable listVersionsPagedCallable() { + return listVersionsPagedCallable; + } + + @Override + public UnaryCallable updateVersionCallable() { + return updateVersionCallable; + } + + @Override + public UnaryCallable deleteVersionCallable() { + return deleteVersionCallable; + } + + @Override + public UnaryCallable createSpecCallable() { + return createSpecCallable; + } + + @Override + public UnaryCallable getSpecCallable() { + return getSpecCallable; + } + + @Override + public UnaryCallable getSpecContentsCallable() { + return getSpecContentsCallable; + } + + @Override + public UnaryCallable listSpecsCallable() { + return listSpecsCallable; + } + + @Override + public UnaryCallable listSpecsPagedCallable() { + return listSpecsPagedCallable; + } + + @Override + public UnaryCallable updateSpecCallable() { + return updateSpecCallable; + } + + @Override + public UnaryCallable deleteSpecCallable() { + return deleteSpecCallable; + } + + @Override + public UnaryCallable getApiOperationCallable() { + return getApiOperationCallable; + } + + @Override + public UnaryCallable + listApiOperationsCallable() { + return listApiOperationsCallable; + } + + @Override + public UnaryCallable + listApiOperationsPagedCallable() { + return listApiOperationsPagedCallable; + } + + @Override + public UnaryCallable getDefinitionCallable() { + return getDefinitionCallable; + } + + @Override + public UnaryCallable createDeploymentCallable() { + return createDeploymentCallable; + } + + @Override + public UnaryCallable getDeploymentCallable() { + return getDeploymentCallable; + } + + @Override + public UnaryCallable listDeploymentsCallable() { + return listDeploymentsCallable; + } + + @Override + public UnaryCallable + listDeploymentsPagedCallable() { + return listDeploymentsPagedCallable; + } + + @Override + public UnaryCallable updateDeploymentCallable() { + return updateDeploymentCallable; + } + + @Override + public UnaryCallable deleteDeploymentCallable() { + return deleteDeploymentCallable; + } + + @Override + public UnaryCallable createAttributeCallable() { + return createAttributeCallable; + } + + @Override + public UnaryCallable getAttributeCallable() { + return getAttributeCallable; + } + + @Override + public UnaryCallable updateAttributeCallable() { + return updateAttributeCallable; + } + + @Override + public UnaryCallable deleteAttributeCallable() { + return deleteAttributeCallable; + } + + @Override + public UnaryCallable listAttributesCallable() { + return listAttributesCallable; + } + + @Override + public UnaryCallable + listAttributesPagedCallable() { + return listAttributesPagedCallable; + } + + @Override + public UnaryCallable searchResourcesCallable() { + return searchResourcesCallable; + } + + @Override + public UnaryCallable + searchResourcesPagedCallable() { + return searchResourcesPagedCallable; + } + + @Override + public UnaryCallable createExternalApiCallable() { + return createExternalApiCallable; + } + + @Override + public UnaryCallable getExternalApiCallable() { + return getExternalApiCallable; + } + + @Override + public UnaryCallable updateExternalApiCallable() { + return updateExternalApiCallable; + } + + @Override + public UnaryCallable deleteExternalApiCallable() { + return deleteExternalApiCallable; + } + + @Override + public UnaryCallable + listExternalApisCallable() { + return listExternalApisCallable; + } + + @Override + public UnaryCallable + listExternalApisPagedCallable() { + return listExternalApisPagedCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @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-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcHostProjectRegistrationServiceCallableFactory.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcHostProjectRegistrationServiceCallableFactory.java new file mode 100644 index 000000000000..f57dd3fc1641 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcHostProjectRegistrationServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.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 HostProjectRegistrationService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcHostProjectRegistrationServiceCallableFactory 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-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcHostProjectRegistrationServiceStub.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcHostProjectRegistrationServiceStub.java new file mode 100644 index 000000000000..f7459e9fab33 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcHostProjectRegistrationServiceStub.java @@ -0,0 +1,347 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import static com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient.ListHostProjectRegistrationsPagedResponse; +import static com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient.ListLocationsPagedResponse; + +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.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest; +import com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest; +import com.google.cloud.apihub.v1.HostProjectRegistration; +import com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest; +import com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the HostProjectRegistrationService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcHostProjectRegistrationServiceStub extends HostProjectRegistrationServiceStub { + private static final MethodDescriptor< + CreateHostProjectRegistrationRequest, HostProjectRegistration> + createHostProjectRegistrationMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.apihub.v1.HostProjectRegistrationService/CreateHostProjectRegistration") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateHostProjectRegistrationRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(HostProjectRegistration.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getHostProjectRegistrationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.apihub.v1.HostProjectRegistrationService/GetHostProjectRegistration") + .setRequestMarshaller( + ProtoUtils.marshaller(GetHostProjectRegistrationRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(HostProjectRegistration.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + ListHostProjectRegistrationsRequest, ListHostProjectRegistrationsResponse> + listHostProjectRegistrationsMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.apihub.v1.HostProjectRegistrationService/ListHostProjectRegistrations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListHostProjectRegistrationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListHostProjectRegistrationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + + private final UnaryCallable + createHostProjectRegistrationCallable; + private final UnaryCallable + getHostProjectRegistrationCallable; + private final UnaryCallable< + ListHostProjectRegistrationsRequest, ListHostProjectRegistrationsResponse> + listHostProjectRegistrationsCallable; + private final UnaryCallable< + ListHostProjectRegistrationsRequest, ListHostProjectRegistrationsPagedResponse> + listHostProjectRegistrationsPagedCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcHostProjectRegistrationServiceStub create( + HostProjectRegistrationServiceStubSettings settings) throws IOException { + return new GrpcHostProjectRegistrationServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcHostProjectRegistrationServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcHostProjectRegistrationServiceStub( + HostProjectRegistrationServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcHostProjectRegistrationServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcHostProjectRegistrationServiceStub( + HostProjectRegistrationServiceStubSettings.newBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of GrpcHostProjectRegistrationServiceStub, 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 GrpcHostProjectRegistrationServiceStub( + HostProjectRegistrationServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcHostProjectRegistrationServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcHostProjectRegistrationServiceStub, 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 GrpcHostProjectRegistrationServiceStub( + HostProjectRegistrationServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + createHostProjectRegistrationTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(createHostProjectRegistrationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + getHostProjectRegistrationTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(getHostProjectRegistrationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listHostProjectRegistrationsTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(listHostProjectRegistrationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.createHostProjectRegistrationCallable = + callableFactory.createUnaryCallable( + createHostProjectRegistrationTransportSettings, + settings.createHostProjectRegistrationSettings(), + clientContext); + this.getHostProjectRegistrationCallable = + callableFactory.createUnaryCallable( + getHostProjectRegistrationTransportSettings, + settings.getHostProjectRegistrationSettings(), + clientContext); + this.listHostProjectRegistrationsCallable = + callableFactory.createUnaryCallable( + listHostProjectRegistrationsTransportSettings, + settings.listHostProjectRegistrationsSettings(), + clientContext); + this.listHostProjectRegistrationsPagedCallable = + callableFactory.createPagedCallable( + listHostProjectRegistrationsTransportSettings, + settings.listHostProjectRegistrationsSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable + createHostProjectRegistrationCallable() { + return createHostProjectRegistrationCallable; + } + + @Override + public UnaryCallable + getHostProjectRegistrationCallable() { + return getHostProjectRegistrationCallable; + } + + @Override + public UnaryCallable + listHostProjectRegistrationsCallable() { + return listHostProjectRegistrationsCallable; + } + + @Override + public UnaryCallable< + ListHostProjectRegistrationsRequest, ListHostProjectRegistrationsPagedResponse> + listHostProjectRegistrationsPagedCallable() { + return listHostProjectRegistrationsPagedCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @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-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcLintingServiceCallableFactory.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcLintingServiceCallableFactory.java new file mode 100644 index 000000000000..3045318793f5 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcLintingServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.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 LintingService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcLintingServiceCallableFactory 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-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcLintingServiceStub.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcLintingServiceStub.java new file mode 100644 index 000000000000..b6a578a9aa28 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcLintingServiceStub.java @@ -0,0 +1,332 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import static com.google.cloud.apihub.v1.LintingServiceClient.ListLocationsPagedResponse; + +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.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.apihub.v1.GetStyleGuideContentsRequest; +import com.google.cloud.apihub.v1.GetStyleGuideRequest; +import com.google.cloud.apihub.v1.LintSpecRequest; +import com.google.cloud.apihub.v1.StyleGuide; +import com.google.cloud.apihub.v1.StyleGuideContents; +import com.google.cloud.apihub.v1.UpdateStyleGuideRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the LintingService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcLintingServiceStub extends LintingServiceStub { + private static final MethodDescriptor + getStyleGuideMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.LintingService/GetStyleGuide") + .setRequestMarshaller( + ProtoUtils.marshaller(GetStyleGuideRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(StyleGuide.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateStyleGuideMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.LintingService/UpdateStyleGuide") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateStyleGuideRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(StyleGuide.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getStyleGuideContentsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.LintingService/GetStyleGuideContents") + .setRequestMarshaller( + ProtoUtils.marshaller(GetStyleGuideContentsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(StyleGuideContents.getDefaultInstance())) + .build(); + + private static final MethodDescriptor lintSpecMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.LintingService/LintSpec") + .setRequestMarshaller(ProtoUtils.marshaller(LintSpecRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + + private final UnaryCallable getStyleGuideCallable; + private final UnaryCallable updateStyleGuideCallable; + private final UnaryCallable + getStyleGuideContentsCallable; + private final UnaryCallable lintSpecCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcLintingServiceStub create(LintingServiceStubSettings settings) + throws IOException { + return new GrpcLintingServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcLintingServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcLintingServiceStub( + LintingServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcLintingServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcLintingServiceStub( + LintingServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcLintingServiceStub, 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 GrpcLintingServiceStub(LintingServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcLintingServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcLintingServiceStub, 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 GrpcLintingServiceStub( + LintingServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings getStyleGuideTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getStyleGuideMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateStyleGuideTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateStyleGuideMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "style_guide.name", String.valueOf(request.getStyleGuide().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + getStyleGuideContentsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getStyleGuideContentsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings lintSpecTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(lintSpecMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.getStyleGuideCallable = + callableFactory.createUnaryCallable( + getStyleGuideTransportSettings, settings.getStyleGuideSettings(), clientContext); + this.updateStyleGuideCallable = + callableFactory.createUnaryCallable( + updateStyleGuideTransportSettings, settings.updateStyleGuideSettings(), clientContext); + this.getStyleGuideContentsCallable = + callableFactory.createUnaryCallable( + getStyleGuideContentsTransportSettings, + settings.getStyleGuideContentsSettings(), + clientContext); + this.lintSpecCallable = + callableFactory.createUnaryCallable( + lintSpecTransportSettings, settings.lintSpecSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable getStyleGuideCallable() { + return getStyleGuideCallable; + } + + @Override + public UnaryCallable updateStyleGuideCallable() { + return updateStyleGuideCallable; + } + + @Override + public UnaryCallable + getStyleGuideContentsCallable() { + return getStyleGuideContentsCallable; + } + + @Override + public UnaryCallable lintSpecCallable() { + return lintSpecCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @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-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcProvisioningCallableFactory.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcProvisioningCallableFactory.java new file mode 100644 index 000000000000..da44f895dac5 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcProvisioningCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.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 Provisioning service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcProvisioningCallableFactory 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-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcProvisioningStub.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcProvisioningStub.java new file mode 100644 index 000000000000..aa8a171355e8 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcProvisioningStub.java @@ -0,0 +1,322 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import static com.google.cloud.apihub.v1.ProvisioningClient.ListLocationsPagedResponse; + +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.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.apihub.v1.ApiHubInstance; +import com.google.cloud.apihub.v1.CreateApiHubInstanceRequest; +import com.google.cloud.apihub.v1.GetApiHubInstanceRequest; +import com.google.cloud.apihub.v1.LookupApiHubInstanceRequest; +import com.google.cloud.apihub.v1.LookupApiHubInstanceResponse; +import com.google.cloud.apihub.v1.OperationMetadata; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the Provisioning service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcProvisioningStub extends ProvisioningStub { + private static final MethodDescriptor + createApiHubInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.Provisioning/CreateApiHubInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateApiHubInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getApiHubInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.Provisioning/GetApiHubInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(GetApiHubInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ApiHubInstance.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + lookupApiHubInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apihub.v1.Provisioning/LookupApiHubInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(LookupApiHubInstanceRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(LookupApiHubInstanceResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + + private final UnaryCallable createApiHubInstanceCallable; + private final OperationCallable + createApiHubInstanceOperationCallable; + private final UnaryCallable getApiHubInstanceCallable; + private final UnaryCallable + lookupApiHubInstanceCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcProvisioningStub create(ProvisioningStubSettings settings) + throws IOException { + return new GrpcProvisioningStub(settings, ClientContext.create(settings)); + } + + public static final GrpcProvisioningStub create(ClientContext clientContext) throws IOException { + return new GrpcProvisioningStub(ProvisioningStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcProvisioningStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcProvisioningStub( + ProvisioningStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcProvisioningStub, 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 GrpcProvisioningStub(ProvisioningStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcProvisioningCallableFactory()); + } + + /** + * Constructs an instance of GrpcProvisioningStub, 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 GrpcProvisioningStub( + ProvisioningStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createApiHubInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createApiHubInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getApiHubInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getApiHubInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + lookupApiHubInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(lookupApiHubInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.createApiHubInstanceCallable = + callableFactory.createUnaryCallable( + createApiHubInstanceTransportSettings, + settings.createApiHubInstanceSettings(), + clientContext); + this.createApiHubInstanceOperationCallable = + callableFactory.createOperationCallable( + createApiHubInstanceTransportSettings, + settings.createApiHubInstanceOperationSettings(), + clientContext, + operationsStub); + this.getApiHubInstanceCallable = + callableFactory.createUnaryCallable( + getApiHubInstanceTransportSettings, + settings.getApiHubInstanceSettings(), + clientContext); + this.lookupApiHubInstanceCallable = + callableFactory.createUnaryCallable( + lookupApiHubInstanceTransportSettings, + settings.lookupApiHubInstanceSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createApiHubInstanceCallable() { + return createApiHubInstanceCallable; + } + + @Override + public OperationCallable + createApiHubInstanceOperationCallable() { + return createApiHubInstanceOperationCallable; + } + + @Override + public UnaryCallable getApiHubInstanceCallable() { + return getApiHubInstanceCallable; + } + + @Override + public UnaryCallable + lookupApiHubInstanceCallable() { + return lookupApiHubInstanceCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @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-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcRuntimeProjectAttachmentServiceCallableFactory.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcRuntimeProjectAttachmentServiceCallableFactory.java new file mode 100644 index 000000000000..33aa405c9a16 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcRuntimeProjectAttachmentServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.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 RuntimeProjectAttachmentService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcRuntimeProjectAttachmentServiceCallableFactory 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-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcRuntimeProjectAttachmentServiceStub.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcRuntimeProjectAttachmentServiceStub.java new file mode 100644 index 000000000000..73b685275eba --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/GrpcRuntimeProjectAttachmentServiceStub.java @@ -0,0 +1,432 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import static com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient.ListRuntimeProjectAttachmentsPagedResponse; + +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.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest; +import com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest; +import com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest; +import com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest; +import com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse; +import com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest; +import com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse; +import com.google.cloud.apihub.v1.RuntimeProjectAttachment; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the RuntimeProjectAttachmentService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcRuntimeProjectAttachmentServiceStub extends RuntimeProjectAttachmentServiceStub { + private static final MethodDescriptor< + CreateRuntimeProjectAttachmentRequest, RuntimeProjectAttachment> + createRuntimeProjectAttachmentMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.apihub.v1.RuntimeProjectAttachmentService/CreateRuntimeProjectAttachment") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateRuntimeProjectAttachmentRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(RuntimeProjectAttachment.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + GetRuntimeProjectAttachmentRequest, RuntimeProjectAttachment> + getRuntimeProjectAttachmentMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.apihub.v1.RuntimeProjectAttachmentService/GetRuntimeProjectAttachment") + .setRequestMarshaller( + ProtoUtils.marshaller(GetRuntimeProjectAttachmentRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(RuntimeProjectAttachment.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + ListRuntimeProjectAttachmentsRequest, ListRuntimeProjectAttachmentsResponse> + listRuntimeProjectAttachmentsMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.apihub.v1.RuntimeProjectAttachmentService/ListRuntimeProjectAttachments") + .setRequestMarshaller( + ProtoUtils.marshaller(ListRuntimeProjectAttachmentsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListRuntimeProjectAttachmentsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteRuntimeProjectAttachmentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.apihub.v1.RuntimeProjectAttachmentService/DeleteRuntimeProjectAttachment") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteRuntimeProjectAttachmentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + LookupRuntimeProjectAttachmentRequest, LookupRuntimeProjectAttachmentResponse> + lookupRuntimeProjectAttachmentMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.apihub.v1.RuntimeProjectAttachmentService/LookupRuntimeProjectAttachment") + .setRequestMarshaller( + ProtoUtils.marshaller(LookupRuntimeProjectAttachmentRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller( + LookupRuntimeProjectAttachmentResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + + private final UnaryCallable + createRuntimeProjectAttachmentCallable; + private final UnaryCallable + getRuntimeProjectAttachmentCallable; + private final UnaryCallable< + ListRuntimeProjectAttachmentsRequest, ListRuntimeProjectAttachmentsResponse> + listRuntimeProjectAttachmentsCallable; + private final UnaryCallable< + ListRuntimeProjectAttachmentsRequest, ListRuntimeProjectAttachmentsPagedResponse> + listRuntimeProjectAttachmentsPagedCallable; + private final UnaryCallable + deleteRuntimeProjectAttachmentCallable; + private final UnaryCallable< + LookupRuntimeProjectAttachmentRequest, LookupRuntimeProjectAttachmentResponse> + lookupRuntimeProjectAttachmentCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcRuntimeProjectAttachmentServiceStub create( + RuntimeProjectAttachmentServiceStubSettings settings) throws IOException { + return new GrpcRuntimeProjectAttachmentServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcRuntimeProjectAttachmentServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcRuntimeProjectAttachmentServiceStub( + RuntimeProjectAttachmentServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcRuntimeProjectAttachmentServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcRuntimeProjectAttachmentServiceStub( + RuntimeProjectAttachmentServiceStubSettings.newBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of GrpcRuntimeProjectAttachmentServiceStub, 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 GrpcRuntimeProjectAttachmentServiceStub( + RuntimeProjectAttachmentServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcRuntimeProjectAttachmentServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcRuntimeProjectAttachmentServiceStub, 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 GrpcRuntimeProjectAttachmentServiceStub( + RuntimeProjectAttachmentServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + createRuntimeProjectAttachmentTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(createRuntimeProjectAttachmentMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + getRuntimeProjectAttachmentTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(getRuntimeProjectAttachmentMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listRuntimeProjectAttachmentsTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(listRuntimeProjectAttachmentsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + deleteRuntimeProjectAttachmentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteRuntimeProjectAttachmentMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + lookupRuntimeProjectAttachmentTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(lookupRuntimeProjectAttachmentMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.createRuntimeProjectAttachmentCallable = + callableFactory.createUnaryCallable( + createRuntimeProjectAttachmentTransportSettings, + settings.createRuntimeProjectAttachmentSettings(), + clientContext); + this.getRuntimeProjectAttachmentCallable = + callableFactory.createUnaryCallable( + getRuntimeProjectAttachmentTransportSettings, + settings.getRuntimeProjectAttachmentSettings(), + clientContext); + this.listRuntimeProjectAttachmentsCallable = + callableFactory.createUnaryCallable( + listRuntimeProjectAttachmentsTransportSettings, + settings.listRuntimeProjectAttachmentsSettings(), + clientContext); + this.listRuntimeProjectAttachmentsPagedCallable = + callableFactory.createPagedCallable( + listRuntimeProjectAttachmentsTransportSettings, + settings.listRuntimeProjectAttachmentsSettings(), + clientContext); + this.deleteRuntimeProjectAttachmentCallable = + callableFactory.createUnaryCallable( + deleteRuntimeProjectAttachmentTransportSettings, + settings.deleteRuntimeProjectAttachmentSettings(), + clientContext); + this.lookupRuntimeProjectAttachmentCallable = + callableFactory.createUnaryCallable( + lookupRuntimeProjectAttachmentTransportSettings, + settings.lookupRuntimeProjectAttachmentSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable + createRuntimeProjectAttachmentCallable() { + return createRuntimeProjectAttachmentCallable; + } + + @Override + public UnaryCallable + getRuntimeProjectAttachmentCallable() { + return getRuntimeProjectAttachmentCallable; + } + + @Override + public UnaryCallable + listRuntimeProjectAttachmentsCallable() { + return listRuntimeProjectAttachmentsCallable; + } + + @Override + public UnaryCallable< + ListRuntimeProjectAttachmentsRequest, ListRuntimeProjectAttachmentsPagedResponse> + listRuntimeProjectAttachmentsPagedCallable() { + return listRuntimeProjectAttachmentsPagedCallable; + } + + @Override + public UnaryCallable + deleteRuntimeProjectAttachmentCallable() { + return deleteRuntimeProjectAttachmentCallable; + } + + @Override + public UnaryCallable< + LookupRuntimeProjectAttachmentRequest, LookupRuntimeProjectAttachmentResponse> + lookupRuntimeProjectAttachmentCallable() { + return lookupRuntimeProjectAttachmentCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @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-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HostProjectRegistrationServiceStub.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HostProjectRegistrationServiceStub.java new file mode 100644 index 000000000000..819d20ac5cad --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HostProjectRegistrationServiceStub.java @@ -0,0 +1,84 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import static com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient.ListHostProjectRegistrationsPagedResponse; +import static com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest; +import com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest; +import com.google.cloud.apihub.v1.HostProjectRegistration; +import com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest; +import com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the HostProjectRegistrationService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class HostProjectRegistrationServiceStub implements BackgroundResource { + + public UnaryCallable + createHostProjectRegistrationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createHostProjectRegistrationCallable()"); + } + + public UnaryCallable + getHostProjectRegistrationCallable() { + throw new UnsupportedOperationException( + "Not implemented: getHostProjectRegistrationCallable()"); + } + + public UnaryCallable< + ListHostProjectRegistrationsRequest, ListHostProjectRegistrationsPagedResponse> + listHostProjectRegistrationsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listHostProjectRegistrationsPagedCallable()"); + } + + public UnaryCallable + listHostProjectRegistrationsCallable() { + throw new UnsupportedOperationException( + "Not implemented: listHostProjectRegistrationsCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HostProjectRegistrationServiceStubSettings.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HostProjectRegistrationServiceStubSettings.java new file mode 100644 index 000000000000..697942d56f58 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HostProjectRegistrationServiceStubSettings.java @@ -0,0 +1,628 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import static com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient.ListHostProjectRegistrationsPagedResponse; +import static com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.core.ObsoleteApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.apihub.v1.CreateHostProjectRegistrationRequest; +import com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest; +import com.google.cloud.apihub.v1.HostProjectRegistration; +import com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest; +import com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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 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 HostProjectRegistrationServiceStub}. + * + *

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

    + *
  • The default service address (apihub.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 createHostProjectRegistration to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * HostProjectRegistrationServiceStubSettings.Builder
+ *     hostProjectRegistrationServiceSettingsBuilder =
+ *         HostProjectRegistrationServiceStubSettings.newBuilder();
+ * hostProjectRegistrationServiceSettingsBuilder
+ *     .createHostProjectRegistrationSettings()
+ *     .setRetrySettings(
+ *         hostProjectRegistrationServiceSettingsBuilder
+ *             .createHostProjectRegistrationSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * HostProjectRegistrationServiceStubSettings hostProjectRegistrationServiceSettings =
+ *     hostProjectRegistrationServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class HostProjectRegistrationServiceStubSettings + 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").build(); + + private final UnaryCallSettings + createHostProjectRegistrationSettings; + private final UnaryCallSettings + getHostProjectRegistrationSettings; + private final PagedCallSettings< + ListHostProjectRegistrationsRequest, + ListHostProjectRegistrationsResponse, + ListHostProjectRegistrationsPagedResponse> + listHostProjectRegistrationsSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + + private static final PagedListDescriptor< + ListHostProjectRegistrationsRequest, + ListHostProjectRegistrationsResponse, + HostProjectRegistration> + LIST_HOST_PROJECT_REGISTRATIONS_PAGE_STR_DESC = + new PagedListDescriptor< + ListHostProjectRegistrationsRequest, + ListHostProjectRegistrationsResponse, + HostProjectRegistration>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListHostProjectRegistrationsRequest injectToken( + ListHostProjectRegistrationsRequest payload, String token) { + return ListHostProjectRegistrationsRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public ListHostProjectRegistrationsRequest injectPageSize( + ListHostProjectRegistrationsRequest payload, int pageSize) { + return ListHostProjectRegistrationsRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListHostProjectRegistrationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListHostProjectRegistrationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListHostProjectRegistrationsResponse payload) { + return payload.getHostProjectRegistrationsList() == null + ? ImmutableList.of() + : payload.getHostProjectRegistrationsList(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListHostProjectRegistrationsRequest, + ListHostProjectRegistrationsResponse, + ListHostProjectRegistrationsPagedResponse> + LIST_HOST_PROJECT_REGISTRATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListHostProjectRegistrationsRequest, + ListHostProjectRegistrationsResponse, + ListHostProjectRegistrationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable< + ListHostProjectRegistrationsRequest, ListHostProjectRegistrationsResponse> + callable, + ListHostProjectRegistrationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListHostProjectRegistrationsRequest, + ListHostProjectRegistrationsResponse, + HostProjectRegistration> + pageContext = + PageContext.create( + callable, + LIST_HOST_PROJECT_REGISTRATIONS_PAGE_STR_DESC, + request, + context); + return ListHostProjectRegistrationsPagedResponse.createAsync( + pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createHostProjectRegistration. */ + public UnaryCallSettings + createHostProjectRegistrationSettings() { + return createHostProjectRegistrationSettings; + } + + /** Returns the object with the settings used for calls to getHostProjectRegistration. */ + public UnaryCallSettings + getHostProjectRegistrationSettings() { + return getHostProjectRegistrationSettings; + } + + /** Returns the object with the settings used for calls to listHostProjectRegistrations. */ + public PagedCallSettings< + ListHostProjectRegistrationsRequest, + ListHostProjectRegistrationsResponse, + ListHostProjectRegistrationsPagedResponse> + listHostProjectRegistrationsSettings() { + return listHostProjectRegistrationsSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + public HostProjectRegistrationServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcHostProjectRegistrationServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonHostProjectRegistrationServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "apihub"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "apihub.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "apihub.mtls.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) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", + GaxProperties.getLibraryVersion(HostProjectRegistrationServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", + GaxProperties.getLibraryVersion(HostProjectRegistrationServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return HostProjectRegistrationServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 HostProjectRegistrationServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createHostProjectRegistrationSettings = + settingsBuilder.createHostProjectRegistrationSettings().build(); + getHostProjectRegistrationSettings = + settingsBuilder.getHostProjectRegistrationSettings().build(); + listHostProjectRegistrationsSettings = + settingsBuilder.listHostProjectRegistrationsSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + } + + /** Builder for HostProjectRegistrationServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder< + CreateHostProjectRegistrationRequest, HostProjectRegistration> + createHostProjectRegistrationSettings; + private final UnaryCallSettings.Builder< + GetHostProjectRegistrationRequest, HostProjectRegistration> + getHostProjectRegistrationSettings; + private final PagedCallSettings.Builder< + ListHostProjectRegistrationsRequest, + ListHostProjectRegistrationsResponse, + ListHostProjectRegistrationsPagedResponse> + listHostProjectRegistrationsSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + 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() + .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() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .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().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); + + createHostProjectRegistrationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getHostProjectRegistrationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listHostProjectRegistrationsSettings = + PagedCallSettings.newBuilder(LIST_HOST_PROJECT_REGISTRATIONS_PAGE_STR_FACT); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createHostProjectRegistrationSettings, + getHostProjectRegistrationSettings, + listHostProjectRegistrationsSettings, + listLocationsSettings, + getLocationSettings); + initDefaults(this); + } + + protected Builder(HostProjectRegistrationServiceStubSettings settings) { + super(settings); + + createHostProjectRegistrationSettings = + settings.createHostProjectRegistrationSettings.toBuilder(); + getHostProjectRegistrationSettings = settings.getHostProjectRegistrationSettings.toBuilder(); + listHostProjectRegistrationsSettings = + settings.listHostProjectRegistrationsSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createHostProjectRegistrationSettings, + getHostProjectRegistrationSettings, + listHostProjectRegistrationsSettings, + listLocationsSettings, + getLocationSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createHostProjectRegistrationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getHostProjectRegistrationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listHostProjectRegistrationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + return builder; + } + + /** + * 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) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createHostProjectRegistration. */ + public UnaryCallSettings.Builder + createHostProjectRegistrationSettings() { + return createHostProjectRegistrationSettings; + } + + /** Returns the builder for the settings used for calls to getHostProjectRegistration. */ + public UnaryCallSettings.Builder + getHostProjectRegistrationSettings() { + return getHostProjectRegistrationSettings; + } + + /** Returns the builder for the settings used for calls to listHostProjectRegistrations. */ + public PagedCallSettings.Builder< + ListHostProjectRegistrationsRequest, + ListHostProjectRegistrationsResponse, + ListHostProjectRegistrationsPagedResponse> + listHostProjectRegistrationsSettings() { + return listHostProjectRegistrationsSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + @Override + public HostProjectRegistrationServiceStubSettings build() throws IOException { + return new HostProjectRegistrationServiceStubSettings(this); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonApiHubCallableFactory.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonApiHubCallableFactory.java new file mode 100644 index 000000000000..e0742d68436e --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonApiHubCallableFactory.java @@ -0,0 +1,101 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the ApiHub service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class HttpJsonApiHubCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonApiHubDependenciesCallableFactory.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonApiHubDependenciesCallableFactory.java new file mode 100644 index 000000000000..50f908aba708 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonApiHubDependenciesCallableFactory.java @@ -0,0 +1,101 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the ApiHubDependencies service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class HttpJsonApiHubDependenciesCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonApiHubDependenciesStub.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonApiHubDependenciesStub.java new file mode 100644 index 000000000000..45d0a0c18e7f --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonApiHubDependenciesStub.java @@ -0,0 +1,581 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import static com.google.cloud.apihub.v1.ApiHubDependenciesClient.ListDependenciesPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubDependenciesClient.ListLocationsPagedResponse; + +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.apihub.v1.CreateDependencyRequest; +import com.google.cloud.apihub.v1.DeleteDependencyRequest; +import com.google.cloud.apihub.v1.Dependency; +import com.google.cloud.apihub.v1.GetDependencyRequest; +import com.google.cloud.apihub.v1.ListDependenciesRequest; +import com.google.cloud.apihub.v1.ListDependenciesResponse; +import com.google.cloud.apihub.v1.UpdateDependencyRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the ApiHubDependencies service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class HttpJsonApiHubDependenciesStub extends ApiHubDependenciesStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + createDependencyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHubDependencies/CreateDependency") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/dependencies", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "dependencyId", request.getDependencyId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("dependency", request.getDependency(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Dependency.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getDependencyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHubDependencies/GetDependency") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/dependencies/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Dependency.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateDependencyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHubDependencies/UpdateDependency") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{dependency.name=projects/*/locations/*/dependencies/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "dependency.name", request.getDependency().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("dependency", request.getDependency(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Dependency.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteDependencyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHubDependencies/DeleteDependency") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/dependencies/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listDependenciesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHubDependencies/ListDependencies") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/dependencies", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListDependenciesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createDependencyCallable; + private final UnaryCallable getDependencyCallable; + private final UnaryCallable updateDependencyCallable; + private final UnaryCallable deleteDependencyCallable; + private final UnaryCallable + listDependenciesCallable; + private final UnaryCallable + listDependenciesPagedCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonApiHubDependenciesStub create(ApiHubDependenciesStubSettings settings) + throws IOException { + return new HttpJsonApiHubDependenciesStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonApiHubDependenciesStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonApiHubDependenciesStub( + ApiHubDependenciesStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonApiHubDependenciesStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonApiHubDependenciesStub( + ApiHubDependenciesStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonApiHubDependenciesStub, 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 HttpJsonApiHubDependenciesStub( + ApiHubDependenciesStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonApiHubDependenciesCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonApiHubDependenciesStub, 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 HttpJsonApiHubDependenciesStub( + ApiHubDependenciesStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings createDependencyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createDependencyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getDependencyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getDependencyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateDependencyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateDependencyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("dependency.name", String.valueOf(request.getDependency().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteDependencyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteDependencyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listDependenciesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listDependenciesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.createDependencyCallable = + callableFactory.createUnaryCallable( + createDependencyTransportSettings, settings.createDependencySettings(), clientContext); + this.getDependencyCallable = + callableFactory.createUnaryCallable( + getDependencyTransportSettings, settings.getDependencySettings(), clientContext); + this.updateDependencyCallable = + callableFactory.createUnaryCallable( + updateDependencyTransportSettings, settings.updateDependencySettings(), clientContext); + this.deleteDependencyCallable = + callableFactory.createUnaryCallable( + deleteDependencyTransportSettings, settings.deleteDependencySettings(), clientContext); + this.listDependenciesCallable = + callableFactory.createUnaryCallable( + listDependenciesTransportSettings, settings.listDependenciesSettings(), clientContext); + this.listDependenciesPagedCallable = + callableFactory.createPagedCallable( + listDependenciesTransportSettings, settings.listDependenciesSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createDependencyMethodDescriptor); + methodDescriptors.add(getDependencyMethodDescriptor); + methodDescriptors.add(updateDependencyMethodDescriptor); + methodDescriptors.add(deleteDependencyMethodDescriptor); + methodDescriptors.add(listDependenciesMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable createDependencyCallable() { + return createDependencyCallable; + } + + @Override + public UnaryCallable getDependencyCallable() { + return getDependencyCallable; + } + + @Override + public UnaryCallable updateDependencyCallable() { + return updateDependencyCallable; + } + + @Override + public UnaryCallable deleteDependencyCallable() { + return deleteDependencyCallable; + } + + @Override + public UnaryCallable + listDependenciesCallable() { + return listDependenciesCallable; + } + + @Override + public UnaryCallable + listDependenciesPagedCallable() { + return listDependenciesPagedCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @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-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonApiHubPluginCallableFactory.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonApiHubPluginCallableFactory.java new file mode 100644 index 000000000000..e8b62fe16e23 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonApiHubPluginCallableFactory.java @@ -0,0 +1,101 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the ApiHubPlugin service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class HttpJsonApiHubPluginCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonApiHubPluginStub.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonApiHubPluginStub.java new file mode 100644 index 000000000000..c1694674f344 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonApiHubPluginStub.java @@ -0,0 +1,442 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import static com.google.cloud.apihub.v1.ApiHubPluginClient.ListLocationsPagedResponse; + +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.apihub.v1.DisablePluginRequest; +import com.google.cloud.apihub.v1.EnablePluginRequest; +import com.google.cloud.apihub.v1.GetPluginRequest; +import com.google.cloud.apihub.v1.Plugin; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the ApiHubPlugin service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class HttpJsonApiHubPluginStub extends ApiHubPluginStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor getPluginMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHubPlugin/GetPlugin") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/plugins/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Plugin.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + enablePluginMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHubPlugin/EnablePlugin") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/plugins/*}:enable", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Plugin.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + disablePluginMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHubPlugin/DisablePlugin") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/plugins/*}:disable", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Plugin.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable getPluginCallable; + private final UnaryCallable enablePluginCallable; + private final UnaryCallable disablePluginCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonApiHubPluginStub create(ApiHubPluginStubSettings settings) + throws IOException { + return new HttpJsonApiHubPluginStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonApiHubPluginStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonApiHubPluginStub( + ApiHubPluginStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonApiHubPluginStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonApiHubPluginStub( + ApiHubPluginStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonApiHubPluginStub, 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 HttpJsonApiHubPluginStub(ApiHubPluginStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonApiHubPluginCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonApiHubPluginStub, 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 HttpJsonApiHubPluginStub( + ApiHubPluginStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings getPluginTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getPluginMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings enablePluginTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(enablePluginMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings disablePluginTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(disablePluginMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.getPluginCallable = + callableFactory.createUnaryCallable( + getPluginTransportSettings, settings.getPluginSettings(), clientContext); + this.enablePluginCallable = + callableFactory.createUnaryCallable( + enablePluginTransportSettings, settings.enablePluginSettings(), clientContext); + this.disablePluginCallable = + callableFactory.createUnaryCallable( + disablePluginTransportSettings, settings.disablePluginSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(getPluginMethodDescriptor); + methodDescriptors.add(enablePluginMethodDescriptor); + methodDescriptors.add(disablePluginMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable getPluginCallable() { + return getPluginCallable; + } + + @Override + public UnaryCallable enablePluginCallable() { + return enablePluginCallable; + } + + @Override + public UnaryCallable disablePluginCallable() { + return disablePluginCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @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-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonApiHubStub.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonApiHubStub.java new file mode 100644 index 000000000000..14997263c860 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonApiHubStub.java @@ -0,0 +1,2421 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import static com.google.cloud.apihub.v1.ApiHubClient.ListApiOperationsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListApisPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListAttributesPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListDeploymentsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListExternalApisPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListLocationsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListSpecsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListVersionsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.SearchResourcesPagedResponse; + +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.apihub.v1.Api; +import com.google.cloud.apihub.v1.ApiOperation; +import com.google.cloud.apihub.v1.Attribute; +import com.google.cloud.apihub.v1.CreateApiRequest; +import com.google.cloud.apihub.v1.CreateAttributeRequest; +import com.google.cloud.apihub.v1.CreateDeploymentRequest; +import com.google.cloud.apihub.v1.CreateExternalApiRequest; +import com.google.cloud.apihub.v1.CreateSpecRequest; +import com.google.cloud.apihub.v1.CreateVersionRequest; +import com.google.cloud.apihub.v1.Definition; +import com.google.cloud.apihub.v1.DeleteApiRequest; +import com.google.cloud.apihub.v1.DeleteAttributeRequest; +import com.google.cloud.apihub.v1.DeleteDeploymentRequest; +import com.google.cloud.apihub.v1.DeleteExternalApiRequest; +import com.google.cloud.apihub.v1.DeleteSpecRequest; +import com.google.cloud.apihub.v1.DeleteVersionRequest; +import com.google.cloud.apihub.v1.Deployment; +import com.google.cloud.apihub.v1.ExternalApi; +import com.google.cloud.apihub.v1.GetApiOperationRequest; +import com.google.cloud.apihub.v1.GetApiRequest; +import com.google.cloud.apihub.v1.GetAttributeRequest; +import com.google.cloud.apihub.v1.GetDefinitionRequest; +import com.google.cloud.apihub.v1.GetDeploymentRequest; +import com.google.cloud.apihub.v1.GetExternalApiRequest; +import com.google.cloud.apihub.v1.GetSpecContentsRequest; +import com.google.cloud.apihub.v1.GetSpecRequest; +import com.google.cloud.apihub.v1.GetVersionRequest; +import com.google.cloud.apihub.v1.ListApiOperationsRequest; +import com.google.cloud.apihub.v1.ListApiOperationsResponse; +import com.google.cloud.apihub.v1.ListApisRequest; +import com.google.cloud.apihub.v1.ListApisResponse; +import com.google.cloud.apihub.v1.ListAttributesRequest; +import com.google.cloud.apihub.v1.ListAttributesResponse; +import com.google.cloud.apihub.v1.ListDeploymentsRequest; +import com.google.cloud.apihub.v1.ListDeploymentsResponse; +import com.google.cloud.apihub.v1.ListExternalApisRequest; +import com.google.cloud.apihub.v1.ListExternalApisResponse; +import com.google.cloud.apihub.v1.ListSpecsRequest; +import com.google.cloud.apihub.v1.ListSpecsResponse; +import com.google.cloud.apihub.v1.ListVersionsRequest; +import com.google.cloud.apihub.v1.ListVersionsResponse; +import com.google.cloud.apihub.v1.SearchResourcesRequest; +import com.google.cloud.apihub.v1.SearchResourcesResponse; +import com.google.cloud.apihub.v1.Spec; +import com.google.cloud.apihub.v1.SpecContents; +import com.google.cloud.apihub.v1.UpdateApiRequest; +import com.google.cloud.apihub.v1.UpdateAttributeRequest; +import com.google.cloud.apihub.v1.UpdateDeploymentRequest; +import com.google.cloud.apihub.v1.UpdateExternalApiRequest; +import com.google.cloud.apihub.v1.UpdateSpecRequest; +import com.google.cloud.apihub.v1.UpdateVersionRequest; +import com.google.cloud.apihub.v1.Version; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the ApiHub service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class HttpJsonApiHubStub extends ApiHubStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor createApiMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/CreateApi") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/apis", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "apiId", request.getApiId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> ProtoRestSerializer.create().toBody("api", request.getApi(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Api.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getApiMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/GetApi") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/apis/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Api.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listApisMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/ListApis") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/apis", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListApisResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor updateApiMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/UpdateApi") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{api.name=projects/*/locations/*/apis/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "api.name", request.getApi().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> ProtoRestSerializer.create().toBody("api", request.getApi(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Api.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteApiMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/DeleteApi") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/apis/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "force", request.getForce()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/CreateVersion") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/apis/*}/versions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "versionId", request.getVersionId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("version", request.getVersion(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Version.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/GetVersion") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/apis/*/versions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Version.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listVersionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/ListVersions") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/apis/*}/versions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListVersionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/UpdateVersion") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{version.name=projects/*/locations/*/apis/*/versions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "version.name", request.getVersion().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("version", request.getVersion(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Version.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/DeleteVersion") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/apis/*/versions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "force", request.getForce()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor createSpecMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/CreateSpec") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "specId", request.getSpecId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("spec", request.getSpec(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Spec.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getSpecMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/GetSpec") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Spec.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getSpecContentsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/GetSpecContents") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:contents", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SpecContents.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listSpecsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/ListSpecs") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListSpecsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor updateSpecMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/UpdateSpec") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{spec.name=projects/*/locations/*/apis/*/versions/*/specs/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "spec.name", request.getSpec().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("spec", request.getSpec(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Spec.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteSpecMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/DeleteSpec") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getApiOperationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/GetApiOperation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/apis/*/versions/*/operations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ApiOperation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listApiOperationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/ListApiOperations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/operations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListApiOperationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getDefinitionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/GetDefinition") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/apis/*/versions/*/definitions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Definition.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createDeploymentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/CreateDeployment") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/deployments", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "deploymentId", request.getDeploymentId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("deployment", request.getDeployment(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Deployment.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getDeploymentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/GetDeployment") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/deployments/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Deployment.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listDeploymentsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/ListDeployments") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/deployments", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListDeploymentsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateDeploymentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/UpdateDeployment") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{deployment.name=projects/*/locations/*/deployments/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "deployment.name", request.getDeployment().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("deployment", request.getDeployment(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Deployment.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteDeploymentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/DeleteDeployment") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/deployments/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createAttributeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/CreateAttribute") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/attributes", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "attributeId", request.getAttributeId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("attribute", request.getAttribute(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Attribute.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getAttributeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/GetAttribute") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/attributes/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Attribute.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateAttributeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/UpdateAttribute") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{attribute.name=projects/*/locations/*/attributes/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "attribute.name", request.getAttribute().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("attribute", request.getAttribute(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Attribute.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteAttributeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/DeleteAttribute") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/attributes/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listAttributesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/ListAttributes") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/attributes", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListAttributesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + searchResourcesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/SearchResources") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{location=projects/*/locations/*}:searchResources", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "location", request.getLocation()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearLocation().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SearchResourcesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createExternalApiMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/CreateExternalApi") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/externalApis", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "externalApiId", request.getExternalApiId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("externalApi", request.getExternalApi(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ExternalApi.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getExternalApiMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/GetExternalApi") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/externalApis/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ExternalApi.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateExternalApiMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/UpdateExternalApi") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{externalApi.name=projects/*/locations/*/externalApis/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "externalApi.name", request.getExternalApi().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("externalApi", request.getExternalApi(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ExternalApi.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteExternalApiMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/DeleteExternalApi") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/externalApis/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listExternalApisMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.ApiHub/ListExternalApis") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/externalApis", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListExternalApisResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createApiCallable; + private final UnaryCallable getApiCallable; + private final UnaryCallable listApisCallable; + private final UnaryCallable listApisPagedCallable; + private final UnaryCallable updateApiCallable; + private final UnaryCallable deleteApiCallable; + private final UnaryCallable createVersionCallable; + private final UnaryCallable getVersionCallable; + private final UnaryCallable listVersionsCallable; + private final UnaryCallable + listVersionsPagedCallable; + private final UnaryCallable updateVersionCallable; + private final UnaryCallable deleteVersionCallable; + private final UnaryCallable createSpecCallable; + private final UnaryCallable getSpecCallable; + private final UnaryCallable getSpecContentsCallable; + private final UnaryCallable listSpecsCallable; + private final UnaryCallable listSpecsPagedCallable; + private final UnaryCallable updateSpecCallable; + private final UnaryCallable deleteSpecCallable; + private final UnaryCallable getApiOperationCallable; + private final UnaryCallable + listApiOperationsCallable; + private final UnaryCallable + listApiOperationsPagedCallable; + private final UnaryCallable getDefinitionCallable; + private final UnaryCallable createDeploymentCallable; + private final UnaryCallable getDeploymentCallable; + private final UnaryCallable + listDeploymentsCallable; + private final UnaryCallable + listDeploymentsPagedCallable; + private final UnaryCallable updateDeploymentCallable; + private final UnaryCallable deleteDeploymentCallable; + private final UnaryCallable createAttributeCallable; + private final UnaryCallable getAttributeCallable; + private final UnaryCallable updateAttributeCallable; + private final UnaryCallable deleteAttributeCallable; + private final UnaryCallable listAttributesCallable; + private final UnaryCallable + listAttributesPagedCallable; + private final UnaryCallable + searchResourcesCallable; + private final UnaryCallable + searchResourcesPagedCallable; + private final UnaryCallable createExternalApiCallable; + private final UnaryCallable getExternalApiCallable; + private final UnaryCallable updateExternalApiCallable; + private final UnaryCallable deleteExternalApiCallable; + private final UnaryCallable + listExternalApisCallable; + private final UnaryCallable + listExternalApisPagedCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonApiHubStub create(ApiHubStubSettings settings) throws IOException { + return new HttpJsonApiHubStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonApiHubStub create(ClientContext clientContext) throws IOException { + return new HttpJsonApiHubStub(ApiHubStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonApiHubStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonApiHubStub( + ApiHubStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonApiHubStub, 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 HttpJsonApiHubStub(ApiHubStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonApiHubCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonApiHubStub, 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 HttpJsonApiHubStub( + ApiHubStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings createApiTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createApiMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getApiTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getApiMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings listApisTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listApisMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateApiTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateApiMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("api.name", String.valueOf(request.getApi().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteApiTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteApiMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings createVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings listVersionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listVersionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("version.name", String.valueOf(request.getVersion().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings createSpecTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createSpecMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getSpecTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getSpecMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getSpecContentsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getSpecContentsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings listSpecsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listSpecsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateSpecTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateSpecMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("spec.name", String.valueOf(request.getSpec().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteSpecTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteSpecMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getApiOperationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getApiOperationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listApiOperationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listApiOperationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getDefinitionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getDefinitionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings createDeploymentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createDeploymentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getDeploymentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getDeploymentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listDeploymentsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listDeploymentsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateDeploymentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateDeploymentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("deployment.name", String.valueOf(request.getDeployment().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteDeploymentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteDeploymentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings createAttributeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createAttributeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getAttributeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getAttributeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateAttributeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateAttributeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("attribute.name", String.valueOf(request.getAttribute().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteAttributeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteAttributeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listAttributesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listAttributesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + searchResourcesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(searchResourcesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("location", String.valueOf(request.getLocation())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings createExternalApiTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createExternalApiMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getExternalApiTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getExternalApiMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateExternalApiTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateExternalApiMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "external_api.name", String.valueOf(request.getExternalApi().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteExternalApiTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteExternalApiMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listExternalApisTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listExternalApisMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.createApiCallable = + callableFactory.createUnaryCallable( + createApiTransportSettings, settings.createApiSettings(), clientContext); + this.getApiCallable = + callableFactory.createUnaryCallable( + getApiTransportSettings, settings.getApiSettings(), clientContext); + this.listApisCallable = + callableFactory.createUnaryCallable( + listApisTransportSettings, settings.listApisSettings(), clientContext); + this.listApisPagedCallable = + callableFactory.createPagedCallable( + listApisTransportSettings, settings.listApisSettings(), clientContext); + this.updateApiCallable = + callableFactory.createUnaryCallable( + updateApiTransportSettings, settings.updateApiSettings(), clientContext); + this.deleteApiCallable = + callableFactory.createUnaryCallable( + deleteApiTransportSettings, settings.deleteApiSettings(), clientContext); + this.createVersionCallable = + callableFactory.createUnaryCallable( + createVersionTransportSettings, settings.createVersionSettings(), clientContext); + this.getVersionCallable = + callableFactory.createUnaryCallable( + getVersionTransportSettings, settings.getVersionSettings(), clientContext); + this.listVersionsCallable = + callableFactory.createUnaryCallable( + listVersionsTransportSettings, settings.listVersionsSettings(), clientContext); + this.listVersionsPagedCallable = + callableFactory.createPagedCallable( + listVersionsTransportSettings, settings.listVersionsSettings(), clientContext); + this.updateVersionCallable = + callableFactory.createUnaryCallable( + updateVersionTransportSettings, settings.updateVersionSettings(), clientContext); + this.deleteVersionCallable = + callableFactory.createUnaryCallable( + deleteVersionTransportSettings, settings.deleteVersionSettings(), clientContext); + this.createSpecCallable = + callableFactory.createUnaryCallable( + createSpecTransportSettings, settings.createSpecSettings(), clientContext); + this.getSpecCallable = + callableFactory.createUnaryCallable( + getSpecTransportSettings, settings.getSpecSettings(), clientContext); + this.getSpecContentsCallable = + callableFactory.createUnaryCallable( + getSpecContentsTransportSettings, settings.getSpecContentsSettings(), clientContext); + this.listSpecsCallable = + callableFactory.createUnaryCallable( + listSpecsTransportSettings, settings.listSpecsSettings(), clientContext); + this.listSpecsPagedCallable = + callableFactory.createPagedCallable( + listSpecsTransportSettings, settings.listSpecsSettings(), clientContext); + this.updateSpecCallable = + callableFactory.createUnaryCallable( + updateSpecTransportSettings, settings.updateSpecSettings(), clientContext); + this.deleteSpecCallable = + callableFactory.createUnaryCallable( + deleteSpecTransportSettings, settings.deleteSpecSettings(), clientContext); + this.getApiOperationCallable = + callableFactory.createUnaryCallable( + getApiOperationTransportSettings, settings.getApiOperationSettings(), clientContext); + this.listApiOperationsCallable = + callableFactory.createUnaryCallable( + listApiOperationsTransportSettings, + settings.listApiOperationsSettings(), + clientContext); + this.listApiOperationsPagedCallable = + callableFactory.createPagedCallable( + listApiOperationsTransportSettings, + settings.listApiOperationsSettings(), + clientContext); + this.getDefinitionCallable = + callableFactory.createUnaryCallable( + getDefinitionTransportSettings, settings.getDefinitionSettings(), clientContext); + this.createDeploymentCallable = + callableFactory.createUnaryCallable( + createDeploymentTransportSettings, settings.createDeploymentSettings(), clientContext); + this.getDeploymentCallable = + callableFactory.createUnaryCallable( + getDeploymentTransportSettings, settings.getDeploymentSettings(), clientContext); + this.listDeploymentsCallable = + callableFactory.createUnaryCallable( + listDeploymentsTransportSettings, settings.listDeploymentsSettings(), clientContext); + this.listDeploymentsPagedCallable = + callableFactory.createPagedCallable( + listDeploymentsTransportSettings, settings.listDeploymentsSettings(), clientContext); + this.updateDeploymentCallable = + callableFactory.createUnaryCallable( + updateDeploymentTransportSettings, settings.updateDeploymentSettings(), clientContext); + this.deleteDeploymentCallable = + callableFactory.createUnaryCallable( + deleteDeploymentTransportSettings, settings.deleteDeploymentSettings(), clientContext); + this.createAttributeCallable = + callableFactory.createUnaryCallable( + createAttributeTransportSettings, settings.createAttributeSettings(), clientContext); + this.getAttributeCallable = + callableFactory.createUnaryCallable( + getAttributeTransportSettings, settings.getAttributeSettings(), clientContext); + this.updateAttributeCallable = + callableFactory.createUnaryCallable( + updateAttributeTransportSettings, settings.updateAttributeSettings(), clientContext); + this.deleteAttributeCallable = + callableFactory.createUnaryCallable( + deleteAttributeTransportSettings, settings.deleteAttributeSettings(), clientContext); + this.listAttributesCallable = + callableFactory.createUnaryCallable( + listAttributesTransportSettings, settings.listAttributesSettings(), clientContext); + this.listAttributesPagedCallable = + callableFactory.createPagedCallable( + listAttributesTransportSettings, settings.listAttributesSettings(), clientContext); + this.searchResourcesCallable = + callableFactory.createUnaryCallable( + searchResourcesTransportSettings, settings.searchResourcesSettings(), clientContext); + this.searchResourcesPagedCallable = + callableFactory.createPagedCallable( + searchResourcesTransportSettings, settings.searchResourcesSettings(), clientContext); + this.createExternalApiCallable = + callableFactory.createUnaryCallable( + createExternalApiTransportSettings, + settings.createExternalApiSettings(), + clientContext); + this.getExternalApiCallable = + callableFactory.createUnaryCallable( + getExternalApiTransportSettings, settings.getExternalApiSettings(), clientContext); + this.updateExternalApiCallable = + callableFactory.createUnaryCallable( + updateExternalApiTransportSettings, + settings.updateExternalApiSettings(), + clientContext); + this.deleteExternalApiCallable = + callableFactory.createUnaryCallable( + deleteExternalApiTransportSettings, + settings.deleteExternalApiSettings(), + clientContext); + this.listExternalApisCallable = + callableFactory.createUnaryCallable( + listExternalApisTransportSettings, settings.listExternalApisSettings(), clientContext); + this.listExternalApisPagedCallable = + callableFactory.createPagedCallable( + listExternalApisTransportSettings, settings.listExternalApisSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createApiMethodDescriptor); + methodDescriptors.add(getApiMethodDescriptor); + methodDescriptors.add(listApisMethodDescriptor); + methodDescriptors.add(updateApiMethodDescriptor); + methodDescriptors.add(deleteApiMethodDescriptor); + methodDescriptors.add(createVersionMethodDescriptor); + methodDescriptors.add(getVersionMethodDescriptor); + methodDescriptors.add(listVersionsMethodDescriptor); + methodDescriptors.add(updateVersionMethodDescriptor); + methodDescriptors.add(deleteVersionMethodDescriptor); + methodDescriptors.add(createSpecMethodDescriptor); + methodDescriptors.add(getSpecMethodDescriptor); + methodDescriptors.add(getSpecContentsMethodDescriptor); + methodDescriptors.add(listSpecsMethodDescriptor); + methodDescriptors.add(updateSpecMethodDescriptor); + methodDescriptors.add(deleteSpecMethodDescriptor); + methodDescriptors.add(getApiOperationMethodDescriptor); + methodDescriptors.add(listApiOperationsMethodDescriptor); + methodDescriptors.add(getDefinitionMethodDescriptor); + methodDescriptors.add(createDeploymentMethodDescriptor); + methodDescriptors.add(getDeploymentMethodDescriptor); + methodDescriptors.add(listDeploymentsMethodDescriptor); + methodDescriptors.add(updateDeploymentMethodDescriptor); + methodDescriptors.add(deleteDeploymentMethodDescriptor); + methodDescriptors.add(createAttributeMethodDescriptor); + methodDescriptors.add(getAttributeMethodDescriptor); + methodDescriptors.add(updateAttributeMethodDescriptor); + methodDescriptors.add(deleteAttributeMethodDescriptor); + methodDescriptors.add(listAttributesMethodDescriptor); + methodDescriptors.add(searchResourcesMethodDescriptor); + methodDescriptors.add(createExternalApiMethodDescriptor); + methodDescriptors.add(getExternalApiMethodDescriptor); + methodDescriptors.add(updateExternalApiMethodDescriptor); + methodDescriptors.add(deleteExternalApiMethodDescriptor); + methodDescriptors.add(listExternalApisMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable createApiCallable() { + return createApiCallable; + } + + @Override + public UnaryCallable getApiCallable() { + return getApiCallable; + } + + @Override + public UnaryCallable listApisCallable() { + return listApisCallable; + } + + @Override + public UnaryCallable listApisPagedCallable() { + return listApisPagedCallable; + } + + @Override + public UnaryCallable updateApiCallable() { + return updateApiCallable; + } + + @Override + public UnaryCallable deleteApiCallable() { + return deleteApiCallable; + } + + @Override + public UnaryCallable createVersionCallable() { + return createVersionCallable; + } + + @Override + public UnaryCallable getVersionCallable() { + return getVersionCallable; + } + + @Override + public UnaryCallable listVersionsCallable() { + return listVersionsCallable; + } + + @Override + public UnaryCallable listVersionsPagedCallable() { + return listVersionsPagedCallable; + } + + @Override + public UnaryCallable updateVersionCallable() { + return updateVersionCallable; + } + + @Override + public UnaryCallable deleteVersionCallable() { + return deleteVersionCallable; + } + + @Override + public UnaryCallable createSpecCallable() { + return createSpecCallable; + } + + @Override + public UnaryCallable getSpecCallable() { + return getSpecCallable; + } + + @Override + public UnaryCallable getSpecContentsCallable() { + return getSpecContentsCallable; + } + + @Override + public UnaryCallable listSpecsCallable() { + return listSpecsCallable; + } + + @Override + public UnaryCallable listSpecsPagedCallable() { + return listSpecsPagedCallable; + } + + @Override + public UnaryCallable updateSpecCallable() { + return updateSpecCallable; + } + + @Override + public UnaryCallable deleteSpecCallable() { + return deleteSpecCallable; + } + + @Override + public UnaryCallable getApiOperationCallable() { + return getApiOperationCallable; + } + + @Override + public UnaryCallable + listApiOperationsCallable() { + return listApiOperationsCallable; + } + + @Override + public UnaryCallable + listApiOperationsPagedCallable() { + return listApiOperationsPagedCallable; + } + + @Override + public UnaryCallable getDefinitionCallable() { + return getDefinitionCallable; + } + + @Override + public UnaryCallable createDeploymentCallable() { + return createDeploymentCallable; + } + + @Override + public UnaryCallable getDeploymentCallable() { + return getDeploymentCallable; + } + + @Override + public UnaryCallable listDeploymentsCallable() { + return listDeploymentsCallable; + } + + @Override + public UnaryCallable + listDeploymentsPagedCallable() { + return listDeploymentsPagedCallable; + } + + @Override + public UnaryCallable updateDeploymentCallable() { + return updateDeploymentCallable; + } + + @Override + public UnaryCallable deleteDeploymentCallable() { + return deleteDeploymentCallable; + } + + @Override + public UnaryCallable createAttributeCallable() { + return createAttributeCallable; + } + + @Override + public UnaryCallable getAttributeCallable() { + return getAttributeCallable; + } + + @Override + public UnaryCallable updateAttributeCallable() { + return updateAttributeCallable; + } + + @Override + public UnaryCallable deleteAttributeCallable() { + return deleteAttributeCallable; + } + + @Override + public UnaryCallable listAttributesCallable() { + return listAttributesCallable; + } + + @Override + public UnaryCallable + listAttributesPagedCallable() { + return listAttributesPagedCallable; + } + + @Override + public UnaryCallable searchResourcesCallable() { + return searchResourcesCallable; + } + + @Override + public UnaryCallable + searchResourcesPagedCallable() { + return searchResourcesPagedCallable; + } + + @Override + public UnaryCallable createExternalApiCallable() { + return createExternalApiCallable; + } + + @Override + public UnaryCallable getExternalApiCallable() { + return getExternalApiCallable; + } + + @Override + public UnaryCallable updateExternalApiCallable() { + return updateExternalApiCallable; + } + + @Override + public UnaryCallable deleteExternalApiCallable() { + return deleteExternalApiCallable; + } + + @Override + public UnaryCallable + listExternalApisCallable() { + return listExternalApisCallable; + } + + @Override + public UnaryCallable + listExternalApisPagedCallable() { + return listExternalApisPagedCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @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-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonHostProjectRegistrationServiceCallableFactory.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonHostProjectRegistrationServiceCallableFactory.java new file mode 100644 index 000000000000..94dd70e263b2 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonHostProjectRegistrationServiceCallableFactory.java @@ -0,0 +1,101 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the HostProjectRegistrationService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class HttpJsonHostProjectRegistrationServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonHostProjectRegistrationServiceStub.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonHostProjectRegistrationServiceStub.java new file mode 100644 index 000000000000..59033f66af97 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonHostProjectRegistrationServiceStub.java @@ -0,0 +1,501 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import static com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient.ListHostProjectRegistrationsPagedResponse; +import static com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest; +import com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest; +import com.google.cloud.apihub.v1.HostProjectRegistration; +import com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest; +import com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the HostProjectRegistrationService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class HttpJsonHostProjectRegistrationServiceStub extends HostProjectRegistrationServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor< + CreateHostProjectRegistrationRequest, HostProjectRegistration> + createHostProjectRegistrationMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.apihub.v1.HostProjectRegistrationService/CreateHostProjectRegistration") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/hostProjectRegistrations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, + "hostProjectRegistrationId", + request.getHostProjectRegistrationId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "hostProjectRegistration", + request.getHostProjectRegistration(), + true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(HostProjectRegistration.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + GetHostProjectRegistrationRequest, HostProjectRegistration> + getHostProjectRegistrationMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.apihub.v1.HostProjectRegistrationService/GetHostProjectRegistration") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/hostProjectRegistrations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(HostProjectRegistration.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + ListHostProjectRegistrationsRequest, ListHostProjectRegistrationsResponse> + listHostProjectRegistrationsMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName( + "google.cloud.apihub.v1.HostProjectRegistrationService/ListHostProjectRegistrations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/hostProjectRegistrations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListHostProjectRegistrationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable + createHostProjectRegistrationCallable; + private final UnaryCallable + getHostProjectRegistrationCallable; + private final UnaryCallable< + ListHostProjectRegistrationsRequest, ListHostProjectRegistrationsResponse> + listHostProjectRegistrationsCallable; + private final UnaryCallable< + ListHostProjectRegistrationsRequest, ListHostProjectRegistrationsPagedResponse> + listHostProjectRegistrationsPagedCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonHostProjectRegistrationServiceStub create( + HostProjectRegistrationServiceStubSettings settings) throws IOException { + return new HttpJsonHostProjectRegistrationServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonHostProjectRegistrationServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonHostProjectRegistrationServiceStub( + HostProjectRegistrationServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonHostProjectRegistrationServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonHostProjectRegistrationServiceStub( + HostProjectRegistrationServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonHostProjectRegistrationServiceStub, 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 HttpJsonHostProjectRegistrationServiceStub( + HostProjectRegistrationServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonHostProjectRegistrationServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonHostProjectRegistrationServiceStub, 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 HttpJsonHostProjectRegistrationServiceStub( + HostProjectRegistrationServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + createHostProjectRegistrationTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(createHostProjectRegistrationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + getHostProjectRegistrationTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(getHostProjectRegistrationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listHostProjectRegistrationsTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(listHostProjectRegistrationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.createHostProjectRegistrationCallable = + callableFactory.createUnaryCallable( + createHostProjectRegistrationTransportSettings, + settings.createHostProjectRegistrationSettings(), + clientContext); + this.getHostProjectRegistrationCallable = + callableFactory.createUnaryCallable( + getHostProjectRegistrationTransportSettings, + settings.getHostProjectRegistrationSettings(), + clientContext); + this.listHostProjectRegistrationsCallable = + callableFactory.createUnaryCallable( + listHostProjectRegistrationsTransportSettings, + settings.listHostProjectRegistrationsSettings(), + clientContext); + this.listHostProjectRegistrationsPagedCallable = + callableFactory.createPagedCallable( + listHostProjectRegistrationsTransportSettings, + settings.listHostProjectRegistrationsSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createHostProjectRegistrationMethodDescriptor); + methodDescriptors.add(getHostProjectRegistrationMethodDescriptor); + methodDescriptors.add(listHostProjectRegistrationsMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable + createHostProjectRegistrationCallable() { + return createHostProjectRegistrationCallable; + } + + @Override + public UnaryCallable + getHostProjectRegistrationCallable() { + return getHostProjectRegistrationCallable; + } + + @Override + public UnaryCallable + listHostProjectRegistrationsCallable() { + return listHostProjectRegistrationsCallable; + } + + @Override + public UnaryCallable< + ListHostProjectRegistrationsRequest, ListHostProjectRegistrationsPagedResponse> + listHostProjectRegistrationsPagedCallable() { + return listHostProjectRegistrationsPagedCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @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-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonLintingServiceCallableFactory.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonLintingServiceCallableFactory.java new file mode 100644 index 000000000000..14497997b4e4 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonLintingServiceCallableFactory.java @@ -0,0 +1,101 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the LintingService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class HttpJsonLintingServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonLintingServiceStub.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonLintingServiceStub.java new file mode 100644 index 000000000000..0332c6c29367 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonLintingServiceStub.java @@ -0,0 +1,508 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import static com.google.cloud.apihub.v1.LintingServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.apihub.v1.GetStyleGuideContentsRequest; +import com.google.cloud.apihub.v1.GetStyleGuideRequest; +import com.google.cloud.apihub.v1.LintSpecRequest; +import com.google.cloud.apihub.v1.StyleGuide; +import com.google.cloud.apihub.v1.StyleGuideContents; +import com.google.cloud.apihub.v1.UpdateStyleGuideRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the LintingService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class HttpJsonLintingServiceStub extends LintingServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + getStyleGuideMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.LintingService/GetStyleGuide") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/plugins/*/styleGuide}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(StyleGuide.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateStyleGuideMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.LintingService/UpdateStyleGuide") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{styleGuide.name=projects/*/locations/*/plugins/*/styleGuide}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "styleGuide.name", request.getStyleGuide().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("styleGuide", request.getStyleGuide(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(StyleGuide.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getStyleGuideContentsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.LintingService/GetStyleGuideContents") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/plugins/*/styleGuide}:contents", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(StyleGuideContents.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor lintSpecMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.LintingService/LintSpec") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:lint", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable getStyleGuideCallable; + private final UnaryCallable updateStyleGuideCallable; + private final UnaryCallable + getStyleGuideContentsCallable; + private final UnaryCallable lintSpecCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonLintingServiceStub create(LintingServiceStubSettings settings) + throws IOException { + return new HttpJsonLintingServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonLintingServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonLintingServiceStub( + LintingServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonLintingServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonLintingServiceStub( + LintingServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonLintingServiceStub, 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 HttpJsonLintingServiceStub( + LintingServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonLintingServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonLintingServiceStub, 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 HttpJsonLintingServiceStub( + LintingServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings getStyleGuideTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getStyleGuideMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateStyleGuideTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateStyleGuideMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "style_guide.name", String.valueOf(request.getStyleGuide().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + getStyleGuideContentsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getStyleGuideContentsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings lintSpecTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(lintSpecMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.getStyleGuideCallable = + callableFactory.createUnaryCallable( + getStyleGuideTransportSettings, settings.getStyleGuideSettings(), clientContext); + this.updateStyleGuideCallable = + callableFactory.createUnaryCallable( + updateStyleGuideTransportSettings, settings.updateStyleGuideSettings(), clientContext); + this.getStyleGuideContentsCallable = + callableFactory.createUnaryCallable( + getStyleGuideContentsTransportSettings, + settings.getStyleGuideContentsSettings(), + clientContext); + this.lintSpecCallable = + callableFactory.createUnaryCallable( + lintSpecTransportSettings, settings.lintSpecSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(getStyleGuideMethodDescriptor); + methodDescriptors.add(updateStyleGuideMethodDescriptor); + methodDescriptors.add(getStyleGuideContentsMethodDescriptor); + methodDescriptors.add(lintSpecMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable getStyleGuideCallable() { + return getStyleGuideCallable; + } + + @Override + public UnaryCallable updateStyleGuideCallable() { + return updateStyleGuideCallable; + } + + @Override + public UnaryCallable + getStyleGuideContentsCallable() { + return getStyleGuideContentsCallable; + } + + @Override + public UnaryCallable lintSpecCallable() { + return lintSpecCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @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-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonProvisioningCallableFactory.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonProvisioningCallableFactory.java new file mode 100644 index 000000000000..dc1a2e5c39d0 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonProvisioningCallableFactory.java @@ -0,0 +1,101 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Provisioning service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class HttpJsonProvisioningCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonProvisioningStub.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonProvisioningStub.java new file mode 100644 index 000000000000..179fb5fe6076 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonProvisioningStub.java @@ -0,0 +1,517 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import static com.google.cloud.apihub.v1.ProvisioningClient.ListLocationsPagedResponse; + +import com.google.api.HttpRule; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.apihub.v1.ApiHubInstance; +import com.google.cloud.apihub.v1.CreateApiHubInstanceRequest; +import com.google.cloud.apihub.v1.GetApiHubInstanceRequest; +import com.google.cloud.apihub.v1.LookupApiHubInstanceRequest; +import com.google.cloud.apihub.v1.LookupApiHubInstanceResponse; +import com.google.cloud.apihub.v1.OperationMetadata; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Provisioning service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class HttpJsonProvisioningStub extends ProvisioningStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(ApiHubInstance.getDescriptor()) + .add(OperationMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + createApiHubInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.Provisioning/CreateApiHubInstance") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/apiHubInstances", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "apiHubInstanceId", request.getApiHubInstanceId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("apiHubInstance", request.getApiHubInstance(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateApiHubInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + getApiHubInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apihub.v1.Provisioning/GetApiHubInstance") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/apiHubInstances/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ApiHubInstance.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + LookupApiHubInstanceRequest, LookupApiHubInstanceResponse> + lookupApiHubInstanceMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("google.cloud.apihub.v1.Provisioning/LookupApiHubInstance") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/apiHubInstances:lookup", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(LookupApiHubInstanceResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createApiHubInstanceCallable; + private final OperationCallable + createApiHubInstanceOperationCallable; + private final UnaryCallable getApiHubInstanceCallable; + private final UnaryCallable + lookupApiHubInstanceCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonProvisioningStub create(ProvisioningStubSettings settings) + throws IOException { + return new HttpJsonProvisioningStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonProvisioningStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonProvisioningStub( + ProvisioningStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonProvisioningStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonProvisioningStub( + ProvisioningStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonProvisioningStub, 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 HttpJsonProvisioningStub(ProvisioningStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonProvisioningCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonProvisioningStub, 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 HttpJsonProvisioningStub( + ProvisioningStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.CancelOperation", + HttpRule.newBuilder() + .setPost("/v1/{name=projects/*/locations/*/operations/*}:cancel") + .build()) + .put( + "google.longrunning.Operations.DeleteOperation", + HttpRule.newBuilder() + .setDelete("/v1/{name=projects/*/locations/*/operations/*}") + .build()) + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder() + .setGet("/v1/{name=projects/*/locations/*/operations/*}") + .build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder() + .setGet("/v1/{name=projects/*/locations/*}/operations") + .build()) + .build()); + + HttpJsonCallSettings + createApiHubInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createApiHubInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + getApiHubInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getApiHubInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + lookupApiHubInstanceTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(lookupApiHubInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.createApiHubInstanceCallable = + callableFactory.createUnaryCallable( + createApiHubInstanceTransportSettings, + settings.createApiHubInstanceSettings(), + clientContext); + this.createApiHubInstanceOperationCallable = + callableFactory.createOperationCallable( + createApiHubInstanceTransportSettings, + settings.createApiHubInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.getApiHubInstanceCallable = + callableFactory.createUnaryCallable( + getApiHubInstanceTransportSettings, + settings.getApiHubInstanceSettings(), + clientContext); + this.lookupApiHubInstanceCallable = + callableFactory.createUnaryCallable( + lookupApiHubInstanceTransportSettings, + settings.lookupApiHubInstanceSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createApiHubInstanceMethodDescriptor); + methodDescriptors.add(getApiHubInstanceMethodDescriptor); + methodDescriptors.add(lookupApiHubInstanceMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable createApiHubInstanceCallable() { + return createApiHubInstanceCallable; + } + + @Override + public OperationCallable + createApiHubInstanceOperationCallable() { + return createApiHubInstanceOperationCallable; + } + + @Override + public UnaryCallable getApiHubInstanceCallable() { + return getApiHubInstanceCallable; + } + + @Override + public UnaryCallable + lookupApiHubInstanceCallable() { + return lookupApiHubInstanceCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @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-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonRuntimeProjectAttachmentServiceCallableFactory.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonRuntimeProjectAttachmentServiceCallableFactory.java new file mode 100644 index 000000000000..c05aa69d0673 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonRuntimeProjectAttachmentServiceCallableFactory.java @@ -0,0 +1,101 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the RuntimeProjectAttachmentService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class HttpJsonRuntimeProjectAttachmentServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonRuntimeProjectAttachmentServiceStub.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonRuntimeProjectAttachmentServiceStub.java new file mode 100644 index 000000000000..7f3ef8fde380 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/HttpJsonRuntimeProjectAttachmentServiceStub.java @@ -0,0 +1,640 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import static com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient.ListRuntimeProjectAttachmentsPagedResponse; + +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest; +import com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest; +import com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest; +import com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest; +import com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse; +import com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest; +import com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse; +import com.google.cloud.apihub.v1.RuntimeProjectAttachment; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the RuntimeProjectAttachmentService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class HttpJsonRuntimeProjectAttachmentServiceStub + extends RuntimeProjectAttachmentServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor< + CreateRuntimeProjectAttachmentRequest, RuntimeProjectAttachment> + createRuntimeProjectAttachmentMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.apihub.v1.RuntimeProjectAttachmentService/CreateRuntimeProjectAttachment") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/runtimeProjectAttachments", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, + "runtimeProjectAttachmentId", + request.getRuntimeProjectAttachmentId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "runtimeProjectAttachment", + request.getRuntimeProjectAttachment(), + true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RuntimeProjectAttachment.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + GetRuntimeProjectAttachmentRequest, RuntimeProjectAttachment> + getRuntimeProjectAttachmentMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.apihub.v1.RuntimeProjectAttachmentService/GetRuntimeProjectAttachment") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/runtimeProjectAttachments/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RuntimeProjectAttachment.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + ListRuntimeProjectAttachmentsRequest, ListRuntimeProjectAttachmentsResponse> + listRuntimeProjectAttachmentsMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName( + "google.cloud.apihub.v1.RuntimeProjectAttachmentService/ListRuntimeProjectAttachments") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/runtimeProjectAttachments", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance( + ListRuntimeProjectAttachmentsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteRuntimeProjectAttachmentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.apihub.v1.RuntimeProjectAttachmentService/DeleteRuntimeProjectAttachment") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/runtimeProjectAttachments/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + LookupRuntimeProjectAttachmentRequest, LookupRuntimeProjectAttachmentResponse> + lookupRuntimeProjectAttachmentMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName( + "google.cloud.apihub.v1.RuntimeProjectAttachmentService/LookupRuntimeProjectAttachment") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*}:lookupRuntimeProjectAttachment", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance( + LookupRuntimeProjectAttachmentResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable + createRuntimeProjectAttachmentCallable; + private final UnaryCallable + getRuntimeProjectAttachmentCallable; + private final UnaryCallable< + ListRuntimeProjectAttachmentsRequest, ListRuntimeProjectAttachmentsResponse> + listRuntimeProjectAttachmentsCallable; + private final UnaryCallable< + ListRuntimeProjectAttachmentsRequest, ListRuntimeProjectAttachmentsPagedResponse> + listRuntimeProjectAttachmentsPagedCallable; + private final UnaryCallable + deleteRuntimeProjectAttachmentCallable; + private final UnaryCallable< + LookupRuntimeProjectAttachmentRequest, LookupRuntimeProjectAttachmentResponse> + lookupRuntimeProjectAttachmentCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonRuntimeProjectAttachmentServiceStub create( + RuntimeProjectAttachmentServiceStubSettings settings) throws IOException { + return new HttpJsonRuntimeProjectAttachmentServiceStub( + settings, ClientContext.create(settings)); + } + + public static final HttpJsonRuntimeProjectAttachmentServiceStub create( + ClientContext clientContext) throws IOException { + return new HttpJsonRuntimeProjectAttachmentServiceStub( + RuntimeProjectAttachmentServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonRuntimeProjectAttachmentServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRuntimeProjectAttachmentServiceStub( + RuntimeProjectAttachmentServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonRuntimeProjectAttachmentServiceStub, 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 HttpJsonRuntimeProjectAttachmentServiceStub( + RuntimeProjectAttachmentServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonRuntimeProjectAttachmentServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonRuntimeProjectAttachmentServiceStub, 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 HttpJsonRuntimeProjectAttachmentServiceStub( + RuntimeProjectAttachmentServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + createRuntimeProjectAttachmentTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(createRuntimeProjectAttachmentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + getRuntimeProjectAttachmentTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(getRuntimeProjectAttachmentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings< + ListRuntimeProjectAttachmentsRequest, ListRuntimeProjectAttachmentsResponse> + listRuntimeProjectAttachmentsTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(listRuntimeProjectAttachmentsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + deleteRuntimeProjectAttachmentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteRuntimeProjectAttachmentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings< + LookupRuntimeProjectAttachmentRequest, LookupRuntimeProjectAttachmentResponse> + lookupRuntimeProjectAttachmentTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(lookupRuntimeProjectAttachmentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.createRuntimeProjectAttachmentCallable = + callableFactory.createUnaryCallable( + createRuntimeProjectAttachmentTransportSettings, + settings.createRuntimeProjectAttachmentSettings(), + clientContext); + this.getRuntimeProjectAttachmentCallable = + callableFactory.createUnaryCallable( + getRuntimeProjectAttachmentTransportSettings, + settings.getRuntimeProjectAttachmentSettings(), + clientContext); + this.listRuntimeProjectAttachmentsCallable = + callableFactory.createUnaryCallable( + listRuntimeProjectAttachmentsTransportSettings, + settings.listRuntimeProjectAttachmentsSettings(), + clientContext); + this.listRuntimeProjectAttachmentsPagedCallable = + callableFactory.createPagedCallable( + listRuntimeProjectAttachmentsTransportSettings, + settings.listRuntimeProjectAttachmentsSettings(), + clientContext); + this.deleteRuntimeProjectAttachmentCallable = + callableFactory.createUnaryCallable( + deleteRuntimeProjectAttachmentTransportSettings, + settings.deleteRuntimeProjectAttachmentSettings(), + clientContext); + this.lookupRuntimeProjectAttachmentCallable = + callableFactory.createUnaryCallable( + lookupRuntimeProjectAttachmentTransportSettings, + settings.lookupRuntimeProjectAttachmentSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createRuntimeProjectAttachmentMethodDescriptor); + methodDescriptors.add(getRuntimeProjectAttachmentMethodDescriptor); + methodDescriptors.add(listRuntimeProjectAttachmentsMethodDescriptor); + methodDescriptors.add(deleteRuntimeProjectAttachmentMethodDescriptor); + methodDescriptors.add(lookupRuntimeProjectAttachmentMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable + createRuntimeProjectAttachmentCallable() { + return createRuntimeProjectAttachmentCallable; + } + + @Override + public UnaryCallable + getRuntimeProjectAttachmentCallable() { + return getRuntimeProjectAttachmentCallable; + } + + @Override + public UnaryCallable + listRuntimeProjectAttachmentsCallable() { + return listRuntimeProjectAttachmentsCallable; + } + + @Override + public UnaryCallable< + ListRuntimeProjectAttachmentsRequest, ListRuntimeProjectAttachmentsPagedResponse> + listRuntimeProjectAttachmentsPagedCallable() { + return listRuntimeProjectAttachmentsPagedCallable; + } + + @Override + public UnaryCallable + deleteRuntimeProjectAttachmentCallable() { + return deleteRuntimeProjectAttachmentCallable; + } + + @Override + public UnaryCallable< + LookupRuntimeProjectAttachmentRequest, LookupRuntimeProjectAttachmentResponse> + lookupRuntimeProjectAttachmentCallable() { + return lookupRuntimeProjectAttachmentCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @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-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/LintingServiceStub.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/LintingServiceStub.java new file mode 100644 index 000000000000..3b55d8544bee --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/LintingServiceStub.java @@ -0,0 +1,77 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import static com.google.cloud.apihub.v1.LintingServiceClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.apihub.v1.GetStyleGuideContentsRequest; +import com.google.cloud.apihub.v1.GetStyleGuideRequest; +import com.google.cloud.apihub.v1.LintSpecRequest; +import com.google.cloud.apihub.v1.StyleGuide; +import com.google.cloud.apihub.v1.StyleGuideContents; +import com.google.cloud.apihub.v1.UpdateStyleGuideRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the LintingService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class LintingServiceStub implements BackgroundResource { + + public UnaryCallable getStyleGuideCallable() { + throw new UnsupportedOperationException("Not implemented: getStyleGuideCallable()"); + } + + public UnaryCallable updateStyleGuideCallable() { + throw new UnsupportedOperationException("Not implemented: updateStyleGuideCallable()"); + } + + public UnaryCallable + getStyleGuideContentsCallable() { + throw new UnsupportedOperationException("Not implemented: getStyleGuideContentsCallable()"); + } + + public UnaryCallable lintSpecCallable() { + throw new UnsupportedOperationException("Not implemented: lintSpecCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/LintingServiceStubSettings.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/LintingServiceStubSettings.java new file mode 100644 index 000000000000..72117868c141 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/LintingServiceStubSettings.java @@ -0,0 +1,538 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import static com.google.cloud.apihub.v1.LintingServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.core.ObsoleteApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.apihub.v1.GetStyleGuideContentsRequest; +import com.google.cloud.apihub.v1.GetStyleGuideRequest; +import com.google.cloud.apihub.v1.LintSpecRequest; +import com.google.cloud.apihub.v1.StyleGuide; +import com.google.cloud.apihub.v1.StyleGuideContents; +import com.google.cloud.apihub.v1.UpdateStyleGuideRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.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 LintingServiceStub}. + * + *

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

    + *
  • The default service address (apihub.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 getStyleGuide to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * LintingServiceStubSettings.Builder lintingServiceSettingsBuilder =
+ *     LintingServiceStubSettings.newBuilder();
+ * lintingServiceSettingsBuilder
+ *     .getStyleGuideSettings()
+ *     .setRetrySettings(
+ *         lintingServiceSettingsBuilder
+ *             .getStyleGuideSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * LintingServiceStubSettings lintingServiceSettings = lintingServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class LintingServiceStubSettings 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").build(); + + private final UnaryCallSettings getStyleGuideSettings; + private final UnaryCallSettings updateStyleGuideSettings; + private final UnaryCallSettings + getStyleGuideContentsSettings; + private final UnaryCallSettings lintSpecSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to getStyleGuide. */ + public UnaryCallSettings getStyleGuideSettings() { + return getStyleGuideSettings; + } + + /** Returns the object with the settings used for calls to updateStyleGuide. */ + public UnaryCallSettings updateStyleGuideSettings() { + return updateStyleGuideSettings; + } + + /** Returns the object with the settings used for calls to getStyleGuideContents. */ + public UnaryCallSettings + getStyleGuideContentsSettings() { + return getStyleGuideContentsSettings; + } + + /** Returns the object with the settings used for calls to lintSpec. */ + public UnaryCallSettings lintSpecSettings() { + return lintSpecSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + public LintingServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcLintingServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonLintingServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "apihub"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "apihub.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "apihub.mtls.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) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(LintingServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(LintingServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return LintingServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 LintingServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getStyleGuideSettings = settingsBuilder.getStyleGuideSettings().build(); + updateStyleGuideSettings = settingsBuilder.updateStyleGuideSettings().build(); + getStyleGuideContentsSettings = settingsBuilder.getStyleGuideContentsSettings().build(); + lintSpecSettings = settingsBuilder.lintSpecSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + } + + /** Builder for LintingServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder getStyleGuideSettings; + private final UnaryCallSettings.Builder + updateStyleGuideSettings; + private final UnaryCallSettings.Builder + getStyleGuideContentsSettings; + private final UnaryCallSettings.Builder lintSpecSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + 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(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .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); + + getStyleGuideSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateStyleGuideSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getStyleGuideContentsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + lintSpecSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getStyleGuideSettings, + updateStyleGuideSettings, + getStyleGuideContentsSettings, + lintSpecSettings, + listLocationsSettings, + getLocationSettings); + initDefaults(this); + } + + protected Builder(LintingServiceStubSettings settings) { + super(settings); + + getStyleGuideSettings = settings.getStyleGuideSettings.toBuilder(); + updateStyleGuideSettings = settings.updateStyleGuideSettings.toBuilder(); + getStyleGuideContentsSettings = settings.getStyleGuideContentsSettings.toBuilder(); + lintSpecSettings = settings.lintSpecSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getStyleGuideSettings, + updateStyleGuideSettings, + getStyleGuideContentsSettings, + lintSpecSettings, + listLocationsSettings, + getLocationSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .getStyleGuideSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateStyleGuideSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getStyleGuideContentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .lintSpecSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + return builder; + } + + /** + * 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) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to getStyleGuide. */ + public UnaryCallSettings.Builder getStyleGuideSettings() { + return getStyleGuideSettings; + } + + /** Returns the builder for the settings used for calls to updateStyleGuide. */ + public UnaryCallSettings.Builder + updateStyleGuideSettings() { + return updateStyleGuideSettings; + } + + /** Returns the builder for the settings used for calls to getStyleGuideContents. */ + public UnaryCallSettings.Builder + getStyleGuideContentsSettings() { + return getStyleGuideContentsSettings; + } + + /** Returns the builder for the settings used for calls to lintSpec. */ + public UnaryCallSettings.Builder lintSpecSettings() { + return lintSpecSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + @Override + public LintingServiceStubSettings build() throws IOException { + return new LintingServiceStubSettings(this); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ProvisioningStub.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ProvisioningStub.java new file mode 100644 index 000000000000..1e83d5838f13 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ProvisioningStub.java @@ -0,0 +1,89 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import static com.google.cloud.apihub.v1.ProvisioningClient.ListLocationsPagedResponse; + +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.apihub.v1.ApiHubInstance; +import com.google.cloud.apihub.v1.CreateApiHubInstanceRequest; +import com.google.cloud.apihub.v1.GetApiHubInstanceRequest; +import com.google.cloud.apihub.v1.LookupApiHubInstanceRequest; +import com.google.cloud.apihub.v1.LookupApiHubInstanceResponse; +import com.google.cloud.apihub.v1.OperationMetadata; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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 Provisioning service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class ProvisioningStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public OperationCallable + createApiHubInstanceOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createApiHubInstanceOperationCallable()"); + } + + public UnaryCallable createApiHubInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: createApiHubInstanceCallable()"); + } + + public UnaryCallable getApiHubInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: getApiHubInstanceCallable()"); + } + + public UnaryCallable + lookupApiHubInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: lookupApiHubInstanceCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ProvisioningStubSettings.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ProvisioningStubSettings.java new file mode 100644 index 000000000000..450437f59440 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/ProvisioningStubSettings.java @@ -0,0 +1,573 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import static com.google.cloud.apihub.v1.ProvisioningClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.core.ObsoleteApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.apihub.v1.ApiHubInstance; +import com.google.cloud.apihub.v1.CreateApiHubInstanceRequest; +import com.google.cloud.apihub.v1.GetApiHubInstanceRequest; +import com.google.cloud.apihub.v1.LookupApiHubInstanceRequest; +import com.google.cloud.apihub.v1.LookupApiHubInstanceResponse; +import com.google.cloud.apihub.v1.OperationMetadata; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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 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 ProvisioningStub}. + * + *

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

    + *
  • The default service address (apihub.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 getApiHubInstance to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ProvisioningStubSettings.Builder provisioningSettingsBuilder =
+ *     ProvisioningStubSettings.newBuilder();
+ * provisioningSettingsBuilder
+ *     .getApiHubInstanceSettings()
+ *     .setRetrySettings(
+ *         provisioningSettingsBuilder
+ *             .getApiHubInstanceSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ProvisioningStubSettings provisioningSettings = provisioningSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class ProvisioningStubSettings 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").build(); + + private final UnaryCallSettings + createApiHubInstanceSettings; + private final OperationCallSettings< + CreateApiHubInstanceRequest, ApiHubInstance, OperationMetadata> + createApiHubInstanceOperationSettings; + private final UnaryCallSettings + getApiHubInstanceSettings; + private final UnaryCallSettings + lookupApiHubInstanceSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createApiHubInstance. */ + public UnaryCallSettings createApiHubInstanceSettings() { + return createApiHubInstanceSettings; + } + + /** Returns the object with the settings used for calls to createApiHubInstance. */ + public OperationCallSettings + createApiHubInstanceOperationSettings() { + return createApiHubInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to getApiHubInstance. */ + public UnaryCallSettings getApiHubInstanceSettings() { + return getApiHubInstanceSettings; + } + + /** Returns the object with the settings used for calls to lookupApiHubInstance. */ + public UnaryCallSettings + lookupApiHubInstanceSettings() { + return lookupApiHubInstanceSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + public ProvisioningStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcProvisioningStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonProvisioningStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "apihub"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "apihub.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "apihub.mtls.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) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ProvisioningStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ProvisioningStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ProvisioningStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 ProvisioningStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createApiHubInstanceSettings = settingsBuilder.createApiHubInstanceSettings().build(); + createApiHubInstanceOperationSettings = + settingsBuilder.createApiHubInstanceOperationSettings().build(); + getApiHubInstanceSettings = settingsBuilder.getApiHubInstanceSettings().build(); + lookupApiHubInstanceSettings = settingsBuilder.lookupApiHubInstanceSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + } + + /** Builder for ProvisioningStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + createApiHubInstanceSettings; + private final OperationCallSettings.Builder< + CreateApiHubInstanceRequest, ApiHubInstance, OperationMetadata> + createApiHubInstanceOperationSettings; + private final UnaryCallSettings.Builder + getApiHubInstanceSettings; + private final UnaryCallSettings.Builder< + LookupApiHubInstanceRequest, LookupApiHubInstanceResponse> + lookupApiHubInstanceSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + 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() + .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() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .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().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); + + createApiHubInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createApiHubInstanceOperationSettings = OperationCallSettings.newBuilder(); + getApiHubInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + lookupApiHubInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createApiHubInstanceSettings, + getApiHubInstanceSettings, + lookupApiHubInstanceSettings, + listLocationsSettings, + getLocationSettings); + initDefaults(this); + } + + protected Builder(ProvisioningStubSettings settings) { + super(settings); + + createApiHubInstanceSettings = settings.createApiHubInstanceSettings.toBuilder(); + createApiHubInstanceOperationSettings = + settings.createApiHubInstanceOperationSettings.toBuilder(); + getApiHubInstanceSettings = settings.getApiHubInstanceSettings.toBuilder(); + lookupApiHubInstanceSettings = settings.lookupApiHubInstanceSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createApiHubInstanceSettings, + getApiHubInstanceSettings, + lookupApiHubInstanceSettings, + listLocationsSettings, + getLocationSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createApiHubInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getApiHubInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .lookupApiHubInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createApiHubInstanceOperationSettings() + .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(ApiHubInstance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.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; + } + + /** + * 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) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createApiHubInstance. */ + public UnaryCallSettings.Builder + createApiHubInstanceSettings() { + return createApiHubInstanceSettings; + } + + /** Returns the builder for the settings used for calls to createApiHubInstance. */ + public OperationCallSettings.Builder< + CreateApiHubInstanceRequest, ApiHubInstance, OperationMetadata> + createApiHubInstanceOperationSettings() { + return createApiHubInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to getApiHubInstance. */ + public UnaryCallSettings.Builder + getApiHubInstanceSettings() { + return getApiHubInstanceSettings; + } + + /** Returns the builder for the settings used for calls to lookupApiHubInstance. */ + public UnaryCallSettings.Builder + lookupApiHubInstanceSettings() { + return lookupApiHubInstanceSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + @Override + public ProvisioningStubSettings build() throws IOException { + return new ProvisioningStubSettings(this); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/RuntimeProjectAttachmentServiceStub.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/RuntimeProjectAttachmentServiceStub.java new file mode 100644 index 000000000000..6cb2547579b1 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/RuntimeProjectAttachmentServiceStub.java @@ -0,0 +1,101 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import static com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient.ListRuntimeProjectAttachmentsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest; +import com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest; +import com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest; +import com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest; +import com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse; +import com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest; +import com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse; +import com.google.cloud.apihub.v1.RuntimeProjectAttachment; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the RuntimeProjectAttachmentService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class RuntimeProjectAttachmentServiceStub implements BackgroundResource { + + public UnaryCallable + createRuntimeProjectAttachmentCallable() { + throw new UnsupportedOperationException( + "Not implemented: createRuntimeProjectAttachmentCallable()"); + } + + public UnaryCallable + getRuntimeProjectAttachmentCallable() { + throw new UnsupportedOperationException( + "Not implemented: getRuntimeProjectAttachmentCallable()"); + } + + public UnaryCallable< + ListRuntimeProjectAttachmentsRequest, ListRuntimeProjectAttachmentsPagedResponse> + listRuntimeProjectAttachmentsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listRuntimeProjectAttachmentsPagedCallable()"); + } + + public UnaryCallable + listRuntimeProjectAttachmentsCallable() { + throw new UnsupportedOperationException( + "Not implemented: listRuntimeProjectAttachmentsCallable()"); + } + + public UnaryCallable + deleteRuntimeProjectAttachmentCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteRuntimeProjectAttachmentCallable()"); + } + + public UnaryCallable< + LookupRuntimeProjectAttachmentRequest, LookupRuntimeProjectAttachmentResponse> + lookupRuntimeProjectAttachmentCallable() { + throw new UnsupportedOperationException( + "Not implemented: lookupRuntimeProjectAttachmentCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/RuntimeProjectAttachmentServiceStubSettings.java b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/RuntimeProjectAttachmentServiceStubSettings.java new file mode 100644 index 000000000000..dc049fff2365 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/java/com/google/cloud/apihub/v1/stub/RuntimeProjectAttachmentServiceStubSettings.java @@ -0,0 +1,695 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub; + +import static com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient.ListRuntimeProjectAttachmentsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.core.ObsoleteApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.apihub.v1.CreateRuntimeProjectAttachmentRequest; +import com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest; +import com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest; +import com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest; +import com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse; +import com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest; +import com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse; +import com.google.cloud.apihub.v1.RuntimeProjectAttachment; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.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 RuntimeProjectAttachmentServiceStub}. + * + *

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

    + *
  • The default service address (apihub.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 createRuntimeProjectAttachment to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * RuntimeProjectAttachmentServiceStubSettings.Builder
+ *     runtimeProjectAttachmentServiceSettingsBuilder =
+ *         RuntimeProjectAttachmentServiceStubSettings.newBuilder();
+ * runtimeProjectAttachmentServiceSettingsBuilder
+ *     .createRuntimeProjectAttachmentSettings()
+ *     .setRetrySettings(
+ *         runtimeProjectAttachmentServiceSettingsBuilder
+ *             .createRuntimeProjectAttachmentSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * RuntimeProjectAttachmentServiceStubSettings runtimeProjectAttachmentServiceSettings =
+ *     runtimeProjectAttachmentServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class RuntimeProjectAttachmentServiceStubSettings + 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").build(); + + private final UnaryCallSettings + createRuntimeProjectAttachmentSettings; + private final UnaryCallSettings + getRuntimeProjectAttachmentSettings; + private final PagedCallSettings< + ListRuntimeProjectAttachmentsRequest, + ListRuntimeProjectAttachmentsResponse, + ListRuntimeProjectAttachmentsPagedResponse> + listRuntimeProjectAttachmentsSettings; + private final UnaryCallSettings + deleteRuntimeProjectAttachmentSettings; + private final UnaryCallSettings< + LookupRuntimeProjectAttachmentRequest, LookupRuntimeProjectAttachmentResponse> + lookupRuntimeProjectAttachmentSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + + private static final PagedListDescriptor< + ListRuntimeProjectAttachmentsRequest, + ListRuntimeProjectAttachmentsResponse, + RuntimeProjectAttachment> + LIST_RUNTIME_PROJECT_ATTACHMENTS_PAGE_STR_DESC = + new PagedListDescriptor< + ListRuntimeProjectAttachmentsRequest, + ListRuntimeProjectAttachmentsResponse, + RuntimeProjectAttachment>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListRuntimeProjectAttachmentsRequest injectToken( + ListRuntimeProjectAttachmentsRequest payload, String token) { + return ListRuntimeProjectAttachmentsRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public ListRuntimeProjectAttachmentsRequest injectPageSize( + ListRuntimeProjectAttachmentsRequest payload, int pageSize) { + return ListRuntimeProjectAttachmentsRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListRuntimeProjectAttachmentsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListRuntimeProjectAttachmentsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListRuntimeProjectAttachmentsResponse payload) { + return payload.getRuntimeProjectAttachmentsList() == null + ? ImmutableList.of() + : payload.getRuntimeProjectAttachmentsList(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListRuntimeProjectAttachmentsRequest, + ListRuntimeProjectAttachmentsResponse, + ListRuntimeProjectAttachmentsPagedResponse> + LIST_RUNTIME_PROJECT_ATTACHMENTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListRuntimeProjectAttachmentsRequest, + ListRuntimeProjectAttachmentsResponse, + ListRuntimeProjectAttachmentsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable< + ListRuntimeProjectAttachmentsRequest, ListRuntimeProjectAttachmentsResponse> + callable, + ListRuntimeProjectAttachmentsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListRuntimeProjectAttachmentsRequest, + ListRuntimeProjectAttachmentsResponse, + RuntimeProjectAttachment> + pageContext = + PageContext.create( + callable, + LIST_RUNTIME_PROJECT_ATTACHMENTS_PAGE_STR_DESC, + request, + context); + return ListRuntimeProjectAttachmentsPagedResponse.createAsync( + pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createRuntimeProjectAttachment. */ + public UnaryCallSettings + createRuntimeProjectAttachmentSettings() { + return createRuntimeProjectAttachmentSettings; + } + + /** Returns the object with the settings used for calls to getRuntimeProjectAttachment. */ + public UnaryCallSettings + getRuntimeProjectAttachmentSettings() { + return getRuntimeProjectAttachmentSettings; + } + + /** Returns the object with the settings used for calls to listRuntimeProjectAttachments. */ + public PagedCallSettings< + ListRuntimeProjectAttachmentsRequest, + ListRuntimeProjectAttachmentsResponse, + ListRuntimeProjectAttachmentsPagedResponse> + listRuntimeProjectAttachmentsSettings() { + return listRuntimeProjectAttachmentsSettings; + } + + /** Returns the object with the settings used for calls to deleteRuntimeProjectAttachment. */ + public UnaryCallSettings + deleteRuntimeProjectAttachmentSettings() { + return deleteRuntimeProjectAttachmentSettings; + } + + /** Returns the object with the settings used for calls to lookupRuntimeProjectAttachment. */ + public UnaryCallSettings< + LookupRuntimeProjectAttachmentRequest, LookupRuntimeProjectAttachmentResponse> + lookupRuntimeProjectAttachmentSettings() { + return lookupRuntimeProjectAttachmentSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + public RuntimeProjectAttachmentServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcRuntimeProjectAttachmentServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonRuntimeProjectAttachmentServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "apihub"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "apihub.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "apihub.mtls.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) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", + GaxProperties.getLibraryVersion(RuntimeProjectAttachmentServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", + GaxProperties.getLibraryVersion(RuntimeProjectAttachmentServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RuntimeProjectAttachmentServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 RuntimeProjectAttachmentServiceStubSettings(Builder settingsBuilder) + throws IOException { + super(settingsBuilder); + + createRuntimeProjectAttachmentSettings = + settingsBuilder.createRuntimeProjectAttachmentSettings().build(); + getRuntimeProjectAttachmentSettings = + settingsBuilder.getRuntimeProjectAttachmentSettings().build(); + listRuntimeProjectAttachmentsSettings = + settingsBuilder.listRuntimeProjectAttachmentsSettings().build(); + deleteRuntimeProjectAttachmentSettings = + settingsBuilder.deleteRuntimeProjectAttachmentSettings().build(); + lookupRuntimeProjectAttachmentSettings = + settingsBuilder.lookupRuntimeProjectAttachmentSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + } + + /** Builder for RuntimeProjectAttachmentServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder< + CreateRuntimeProjectAttachmentRequest, RuntimeProjectAttachment> + createRuntimeProjectAttachmentSettings; + private final UnaryCallSettings.Builder< + GetRuntimeProjectAttachmentRequest, RuntimeProjectAttachment> + getRuntimeProjectAttachmentSettings; + private final PagedCallSettings.Builder< + ListRuntimeProjectAttachmentsRequest, + ListRuntimeProjectAttachmentsResponse, + ListRuntimeProjectAttachmentsPagedResponse> + listRuntimeProjectAttachmentsSettings; + private final UnaryCallSettings.Builder + deleteRuntimeProjectAttachmentSettings; + private final UnaryCallSettings.Builder< + LookupRuntimeProjectAttachmentRequest, LookupRuntimeProjectAttachmentResponse> + lookupRuntimeProjectAttachmentSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + 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() + .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() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .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().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); + + createRuntimeProjectAttachmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getRuntimeProjectAttachmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listRuntimeProjectAttachmentsSettings = + PagedCallSettings.newBuilder(LIST_RUNTIME_PROJECT_ATTACHMENTS_PAGE_STR_FACT); + deleteRuntimeProjectAttachmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + lookupRuntimeProjectAttachmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createRuntimeProjectAttachmentSettings, + getRuntimeProjectAttachmentSettings, + listRuntimeProjectAttachmentsSettings, + deleteRuntimeProjectAttachmentSettings, + lookupRuntimeProjectAttachmentSettings, + listLocationsSettings, + getLocationSettings); + initDefaults(this); + } + + protected Builder(RuntimeProjectAttachmentServiceStubSettings settings) { + super(settings); + + createRuntimeProjectAttachmentSettings = + settings.createRuntimeProjectAttachmentSettings.toBuilder(); + getRuntimeProjectAttachmentSettings = + settings.getRuntimeProjectAttachmentSettings.toBuilder(); + listRuntimeProjectAttachmentsSettings = + settings.listRuntimeProjectAttachmentsSettings.toBuilder(); + deleteRuntimeProjectAttachmentSettings = + settings.deleteRuntimeProjectAttachmentSettings.toBuilder(); + lookupRuntimeProjectAttachmentSettings = + settings.lookupRuntimeProjectAttachmentSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createRuntimeProjectAttachmentSettings, + getRuntimeProjectAttachmentSettings, + listRuntimeProjectAttachmentsSettings, + deleteRuntimeProjectAttachmentSettings, + lookupRuntimeProjectAttachmentSettings, + listLocationsSettings, + getLocationSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createRuntimeProjectAttachmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getRuntimeProjectAttachmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listRuntimeProjectAttachmentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .deleteRuntimeProjectAttachmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .lookupRuntimeProjectAttachmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + return builder; + } + + /** + * 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) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createRuntimeProjectAttachment. */ + public UnaryCallSettings.Builder< + CreateRuntimeProjectAttachmentRequest, RuntimeProjectAttachment> + createRuntimeProjectAttachmentSettings() { + return createRuntimeProjectAttachmentSettings; + } + + /** Returns the builder for the settings used for calls to getRuntimeProjectAttachment. */ + public UnaryCallSettings.Builder + getRuntimeProjectAttachmentSettings() { + return getRuntimeProjectAttachmentSettings; + } + + /** Returns the builder for the settings used for calls to listRuntimeProjectAttachments. */ + public PagedCallSettings.Builder< + ListRuntimeProjectAttachmentsRequest, + ListRuntimeProjectAttachmentsResponse, + ListRuntimeProjectAttachmentsPagedResponse> + listRuntimeProjectAttachmentsSettings() { + return listRuntimeProjectAttachmentsSettings; + } + + /** Returns the builder for the settings used for calls to deleteRuntimeProjectAttachment. */ + public UnaryCallSettings.Builder + deleteRuntimeProjectAttachmentSettings() { + return deleteRuntimeProjectAttachmentSettings; + } + + /** Returns the builder for the settings used for calls to lookupRuntimeProjectAttachment. */ + public UnaryCallSettings.Builder< + LookupRuntimeProjectAttachmentRequest, LookupRuntimeProjectAttachmentResponse> + lookupRuntimeProjectAttachmentSettings() { + return lookupRuntimeProjectAttachmentSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + @Override + public RuntimeProjectAttachmentServiceStubSettings build() throws IOException { + return new RuntimeProjectAttachmentServiceStubSettings(this); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/main/resources/META-INF/native-image/com.google.cloud.apihub.v1/reflect-config.json b/java-apihub/google-cloud-apihub/src/main/resources/META-INF/native-image/com.google.cloud.apihub.v1/reflect-config.json new file mode 100644 index 000000000000..0885ff87efed --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/main/resources/META-INF/native-image/com.google.cloud.apihub.v1/reflect-config.json @@ -0,0 +1,3548 @@ +[ + { + "name": "com.google.api.ClientLibraryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryOrganization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldBehavior", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.LaunchStage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$History", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Style", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Api", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Api$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ApiHubInstance", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ApiHubInstance$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ApiHubInstance$Config", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ApiHubInstance$Config$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ApiHubInstance$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ApiHubResource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ApiHubResource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ApiOperation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ApiOperation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Attribute", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Attribute$AllowedValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Attribute$AllowedValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Attribute$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Attribute$DataType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Attribute$DefinitionType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Attribute$Scope", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.AttributeValues", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.AttributeValues$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.AttributeValues$EnumAttributeValues", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.AttributeValues$EnumAttributeValues$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.AttributeValues$StringAttributeValues", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.AttributeValues$StringAttributeValues$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.CreateApiHubInstanceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.CreateApiHubInstanceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.CreateApiRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.CreateApiRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.CreateAttributeRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.CreateAttributeRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.CreateDependencyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.CreateDependencyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.CreateDeploymentRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.CreateDeploymentRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.CreateExternalApiRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.CreateExternalApiRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.CreateSpecRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.CreateSpecRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.CreateVersionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.CreateVersionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Definition", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Definition$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Definition$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.DeleteApiRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.DeleteApiRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.DeleteAttributeRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.DeleteAttributeRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.DeleteDependencyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.DeleteDependencyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.DeleteDeploymentRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.DeleteDeploymentRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.DeleteExternalApiRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.DeleteExternalApiRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.DeleteSpecRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.DeleteSpecRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.DeleteVersionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.DeleteVersionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Dependency", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Dependency$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Dependency$DiscoveryMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Dependency$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.DependencyEntityReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.DependencyEntityReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.DependencyErrorDetail", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.DependencyErrorDetail$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.DependencyErrorDetail$Error", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Deployment", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Deployment$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.DisablePluginRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.DisablePluginRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Documentation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Documentation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.EnablePluginRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.EnablePluginRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ExternalApi", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ExternalApi$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetApiHubInstanceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetApiHubInstanceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetApiOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetApiOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetApiRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetApiRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetAttributeRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetAttributeRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetDefinitionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetDefinitionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetDependencyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetDependencyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetDeploymentRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetDeploymentRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetExternalApiRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetExternalApiRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetPluginRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetPluginRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetSpecContentsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetSpecContentsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetSpecRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetSpecRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetStyleGuideContentsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetStyleGuideContentsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetStyleGuideRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetStyleGuideRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetVersionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.GetVersionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.HostProjectRegistration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.HostProjectRegistration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.HttpOperation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.HttpOperation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.HttpOperation$Method", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Issue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Issue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.LintResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.LintResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.LintResponse$SummaryEntry", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.LintResponse$SummaryEntry$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.LintSpecRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.LintSpecRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.LintState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Linter", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListApiOperationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListApiOperationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListApiOperationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListApiOperationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListApisRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListApisRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListApisResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListApisResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListAttributesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListAttributesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListAttributesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListAttributesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListDependenciesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListDependenciesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListDependenciesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListDependenciesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListDeploymentsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListDeploymentsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListDeploymentsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListDeploymentsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListExternalApisRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListExternalApisRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListExternalApisResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListExternalApisResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListSpecsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListSpecsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListSpecsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListSpecsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListVersionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListVersionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListVersionsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.ListVersionsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.LookupApiHubInstanceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.LookupApiHubInstanceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.LookupApiHubInstanceResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.LookupApiHubInstanceResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.OpenApiSpecDetails", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.OpenApiSpecDetails$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.OpenApiSpecDetails$Format", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.OperationDetails", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.OperationDetails$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.OperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.OperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Owner", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Owner$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Path", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Path$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Plugin", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Plugin$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Plugin$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Point", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Point$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Range", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Range$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.RuntimeProjectAttachment", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.RuntimeProjectAttachment$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Schema", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Schema$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.SearchResourcesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.SearchResourcesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.SearchResourcesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.SearchResourcesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.SearchResult", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.SearchResult$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Severity", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Spec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Spec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Spec$ParsingMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.SpecContents", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.SpecContents$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.SpecDetails", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.SpecDetails$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.StyleGuide", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.StyleGuide$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.StyleGuideContents", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.StyleGuideContents$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.UpdateApiRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.UpdateApiRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.UpdateAttributeRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.UpdateAttributeRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.UpdateDependencyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.UpdateDependencyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.UpdateDeploymentRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.UpdateDeploymentRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.UpdateExternalApiRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.UpdateExternalApiRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.UpdateSpecRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.UpdateSpecRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.UpdateStyleGuideRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.UpdateStyleGuideRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.UpdateVersionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.UpdateVersionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Version", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apihub.v1.Version$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$Edition", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$VerificationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$EnumType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$FieldPresence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$JsonFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$MessageEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$RepeatedFieldEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Utf8Validation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionRetention", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionTargetType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Semantic", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ApiHubClientHttpJsonTest.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ApiHubClientHttpJsonTest.java new file mode 100644 index 000000000000..7b86669c4ec6 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ApiHubClientHttpJsonTest.java @@ -0,0 +1,3707 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import static com.google.cloud.apihub.v1.ApiHubClient.ListApiOperationsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListApisPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListAttributesPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListDeploymentsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListExternalApisPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListLocationsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListSpecsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListVersionsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.SearchResourcesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.apihub.v1.stub.HttpJsonApiHubStub; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +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 ApiHubClientHttpJsonTest { + private static MockHttpService mockService; + private static ApiHubClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonApiHubStub.getMethodDescriptors(), ApiHubSettings.getDefaultEndpoint()); + ApiHubSettings settings = + ApiHubSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + ApiHubSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ApiHubClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createApiTest() throws Exception { + Api expectedResponse = + Api.newBuilder() + .setName(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .setOwner(Owner.newBuilder().build()) + .addAllVersions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setTargetUser(AttributeValues.newBuilder().build()) + .setTeam(AttributeValues.newBuilder().build()) + .setBusinessUnit(AttributeValues.newBuilder().build()) + .setMaturityLevel(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setApiStyle(AttributeValues.newBuilder().build()) + .setSelectedVersion( + VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Api api = Api.newBuilder().build(); + String apiId = "apiId93021397"; + + Api actualResponse = client.createApi(parent, api, apiId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createApiExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Api api = Api.newBuilder().build(); + String apiId = "apiId93021397"; + client.createApi(parent, api, apiId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createApiTest2() throws Exception { + Api expectedResponse = + Api.newBuilder() + .setName(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .setOwner(Owner.newBuilder().build()) + .addAllVersions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setTargetUser(AttributeValues.newBuilder().build()) + .setTeam(AttributeValues.newBuilder().build()) + .setBusinessUnit(AttributeValues.newBuilder().build()) + .setMaturityLevel(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setApiStyle(AttributeValues.newBuilder().build()) + .setSelectedVersion( + VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + Api api = Api.newBuilder().build(); + String apiId = "apiId93021397"; + + Api actualResponse = client.createApi(parent, api, apiId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createApiExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + Api api = Api.newBuilder().build(); + String apiId = "apiId93021397"; + client.createApi(parent, api, apiId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getApiTest() throws Exception { + Api expectedResponse = + Api.newBuilder() + .setName(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .setOwner(Owner.newBuilder().build()) + .addAllVersions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setTargetUser(AttributeValues.newBuilder().build()) + .setTeam(AttributeValues.newBuilder().build()) + .setBusinessUnit(AttributeValues.newBuilder().build()) + .setMaturityLevel(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setApiStyle(AttributeValues.newBuilder().build()) + .setSelectedVersion( + VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .build(); + mockService.addResponse(expectedResponse); + + ApiName name = ApiName.of("[PROJECT]", "[LOCATION]", "[API]"); + + Api actualResponse = client.getApi(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getApiExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ApiName name = ApiName.of("[PROJECT]", "[LOCATION]", "[API]"); + client.getApi(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getApiTest2() throws Exception { + Api expectedResponse = + Api.newBuilder() + .setName(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .setOwner(Owner.newBuilder().build()) + .addAllVersions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setTargetUser(AttributeValues.newBuilder().build()) + .setTeam(AttributeValues.newBuilder().build()) + .setBusinessUnit(AttributeValues.newBuilder().build()) + .setMaturityLevel(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setApiStyle(AttributeValues.newBuilder().build()) + .setSelectedVersion( + VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-3607/locations/location-3607/apis/api-3607"; + + Api actualResponse = client.getApi(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getApiExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-3607/locations/location-3607/apis/api-3607"; + client.getApi(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listApisTest() throws Exception { + Api responsesElement = Api.newBuilder().build(); + ListApisResponse expectedResponse = + ListApisResponse.newBuilder() + .setNextPageToken("") + .addAllApis(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListApisPagedResponse pagedListResponse = client.listApis(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getApisList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listApisExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listApis(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listApisTest2() throws Exception { + Api responsesElement = Api.newBuilder().build(); + ListApisResponse expectedResponse = + ListApisResponse.newBuilder() + .setNextPageToken("") + .addAllApis(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListApisPagedResponse pagedListResponse = client.listApis(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getApisList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listApisExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listApis(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateApiTest() throws Exception { + Api expectedResponse = + Api.newBuilder() + .setName(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .setOwner(Owner.newBuilder().build()) + .addAllVersions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setTargetUser(AttributeValues.newBuilder().build()) + .setTeam(AttributeValues.newBuilder().build()) + .setBusinessUnit(AttributeValues.newBuilder().build()) + .setMaturityLevel(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setApiStyle(AttributeValues.newBuilder().build()) + .setSelectedVersion( + VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .build(); + mockService.addResponse(expectedResponse); + + Api api = + Api.newBuilder() + .setName(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .setOwner(Owner.newBuilder().build()) + .addAllVersions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setTargetUser(AttributeValues.newBuilder().build()) + .setTeam(AttributeValues.newBuilder().build()) + .setBusinessUnit(AttributeValues.newBuilder().build()) + .setMaturityLevel(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setApiStyle(AttributeValues.newBuilder().build()) + .setSelectedVersion( + VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Api actualResponse = client.updateApi(api, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateApiExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Api api = + Api.newBuilder() + .setName(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .setOwner(Owner.newBuilder().build()) + .addAllVersions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setTargetUser(AttributeValues.newBuilder().build()) + .setTeam(AttributeValues.newBuilder().build()) + .setBusinessUnit(AttributeValues.newBuilder().build()) + .setMaturityLevel(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setApiStyle(AttributeValues.newBuilder().build()) + .setSelectedVersion( + VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateApi(api, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteApiTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + ApiName name = ApiName.of("[PROJECT]", "[LOCATION]", "[API]"); + + client.deleteApi(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteApiExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ApiName name = ApiName.of("[PROJECT]", "[LOCATION]", "[API]"); + client.deleteApi(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteApiTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-3607/locations/location-3607/apis/api-3607"; + + client.deleteApi(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteApiExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-3607/locations/location-3607/apis/api-3607"; + client.deleteApi(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createVersionTest() throws Exception { + Version expectedResponse = + Version.newBuilder() + .setName(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .addAllSpecs(new ArrayList()) + .addAllApiOperations(new ArrayList()) + .addAllDefinitions(new ArrayList()) + .addAllDeployments(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLifecycle(AttributeValues.newBuilder().build()) + .setCompliance(AttributeValues.newBuilder().build()) + .setAccreditation(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setSelectedDeployment( + DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + .build(); + mockService.addResponse(expectedResponse); + + ApiName parent = ApiName.of("[PROJECT]", "[LOCATION]", "[API]"); + Version version = Version.newBuilder().build(); + String versionId = "versionId-1407102957"; + + Version actualResponse = client.createVersion(parent, version, versionId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createVersionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ApiName parent = ApiName.of("[PROJECT]", "[LOCATION]", "[API]"); + Version version = Version.newBuilder().build(); + String versionId = "versionId-1407102957"; + client.createVersion(parent, version, versionId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createVersionTest2() throws Exception { + Version expectedResponse = + Version.newBuilder() + .setName(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .addAllSpecs(new ArrayList()) + .addAllApiOperations(new ArrayList()) + .addAllDefinitions(new ArrayList()) + .addAllDeployments(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLifecycle(AttributeValues.newBuilder().build()) + .setCompliance(AttributeValues.newBuilder().build()) + .setAccreditation(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setSelectedDeployment( + DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-7414/locations/location-7414/apis/api-7414"; + Version version = Version.newBuilder().build(); + String versionId = "versionId-1407102957"; + + Version actualResponse = client.createVersion(parent, version, versionId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createVersionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-7414/locations/location-7414/apis/api-7414"; + Version version = Version.newBuilder().build(); + String versionId = "versionId-1407102957"; + client.createVersion(parent, version, versionId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getVersionTest() throws Exception { + Version expectedResponse = + Version.newBuilder() + .setName(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .addAllSpecs(new ArrayList()) + .addAllApiOperations(new ArrayList()) + .addAllDefinitions(new ArrayList()) + .addAllDeployments(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLifecycle(AttributeValues.newBuilder().build()) + .setCompliance(AttributeValues.newBuilder().build()) + .setAccreditation(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setSelectedDeployment( + DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + .build(); + mockService.addResponse(expectedResponse); + + VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + + Version actualResponse = client.getVersion(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getVersionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + client.getVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getVersionTest2() throws Exception { + Version expectedResponse = + Version.newBuilder() + .setName(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .addAllSpecs(new ArrayList()) + .addAllApiOperations(new ArrayList()) + .addAllDefinitions(new ArrayList()) + .addAllDeployments(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLifecycle(AttributeValues.newBuilder().build()) + .setCompliance(AttributeValues.newBuilder().build()) + .setAccreditation(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setSelectedDeployment( + DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-6412/locations/location-6412/apis/api-6412/versions/version-6412"; + + Version actualResponse = client.getVersion(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getVersionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-6412/locations/location-6412/apis/api-6412/versions/version-6412"; + client.getVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listVersionsTest() throws Exception { + Version responsesElement = Version.newBuilder().build(); + ListVersionsResponse expectedResponse = + ListVersionsResponse.newBuilder() + .setNextPageToken("") + .addAllVersions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ApiName parent = ApiName.of("[PROJECT]", "[LOCATION]", "[API]"); + + ListVersionsPagedResponse pagedListResponse = client.listVersions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getVersionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listVersionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ApiName parent = ApiName.of("[PROJECT]", "[LOCATION]", "[API]"); + client.listVersions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listVersionsTest2() throws Exception { + Version responsesElement = Version.newBuilder().build(); + ListVersionsResponse expectedResponse = + ListVersionsResponse.newBuilder() + .setNextPageToken("") + .addAllVersions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-7414/locations/location-7414/apis/api-7414"; + + ListVersionsPagedResponse pagedListResponse = client.listVersions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getVersionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listVersionsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-7414/locations/location-7414/apis/api-7414"; + client.listVersions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateVersionTest() throws Exception { + Version expectedResponse = + Version.newBuilder() + .setName(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .addAllSpecs(new ArrayList()) + .addAllApiOperations(new ArrayList()) + .addAllDefinitions(new ArrayList()) + .addAllDeployments(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLifecycle(AttributeValues.newBuilder().build()) + .setCompliance(AttributeValues.newBuilder().build()) + .setAccreditation(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setSelectedDeployment( + DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + .build(); + mockService.addResponse(expectedResponse); + + Version version = + Version.newBuilder() + .setName(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .addAllSpecs(new ArrayList()) + .addAllApiOperations(new ArrayList()) + .addAllDefinitions(new ArrayList()) + .addAllDeployments(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLifecycle(AttributeValues.newBuilder().build()) + .setCompliance(AttributeValues.newBuilder().build()) + .setAccreditation(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setSelectedDeployment( + DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Version actualResponse = client.updateVersion(version, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateVersionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Version version = + Version.newBuilder() + .setName(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .addAllSpecs(new ArrayList()) + .addAllApiOperations(new ArrayList()) + .addAllDefinitions(new ArrayList()) + .addAllDeployments(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLifecycle(AttributeValues.newBuilder().build()) + .setCompliance(AttributeValues.newBuilder().build()) + .setAccreditation(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setSelectedDeployment( + DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateVersion(version, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteVersionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + + client.deleteVersion(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteVersionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + client.deleteVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteVersionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-6412/locations/location-6412/apis/api-6412/versions/version-6412"; + + client.deleteVersion(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteVersionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-6412/locations/location-6412/apis/api-6412/versions/version-6412"; + client.deleteVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSpecTest() throws Exception { + Spec expectedResponse = + Spec.newBuilder() + .setName( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .setDisplayName("displayName1714148973") + .setSpecType(AttributeValues.newBuilder().build()) + .setContents(SpecContents.newBuilder().build()) + .setDetails(SpecDetails.newBuilder().build()) + .setSourceUri("sourceUri-1698419887") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLintResponse(LintResponse.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setDocumentation(Documentation.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + VersionName parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + Spec spec = Spec.newBuilder().build(); + String specId = "specId-896074186"; + + Spec actualResponse = client.createSpec(parent, spec, specId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createSpecExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + VersionName parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + Spec spec = Spec.newBuilder().build(); + String specId = "specId-896074186"; + client.createSpec(parent, spec, specId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSpecTest2() throws Exception { + Spec expectedResponse = + Spec.newBuilder() + .setName( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .setDisplayName("displayName1714148973") + .setSpecType(AttributeValues.newBuilder().build()) + .setContents(SpecContents.newBuilder().build()) + .setDetails(SpecDetails.newBuilder().build()) + .setSourceUri("sourceUri-1698419887") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLintResponse(LintResponse.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setDocumentation(Documentation.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = + "projects/project-1179/locations/location-1179/apis/api-1179/versions/version-1179"; + Spec spec = Spec.newBuilder().build(); + String specId = "specId-896074186"; + + Spec actualResponse = client.createSpec(parent, spec, specId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createSpecExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "projects/project-1179/locations/location-1179/apis/api-1179/versions/version-1179"; + Spec spec = Spec.newBuilder().build(); + String specId = "specId-896074186"; + client.createSpec(parent, spec, specId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSpecTest() throws Exception { + Spec expectedResponse = + Spec.newBuilder() + .setName( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .setDisplayName("displayName1714148973") + .setSpecType(AttributeValues.newBuilder().build()) + .setContents(SpecContents.newBuilder().build()) + .setDetails(SpecDetails.newBuilder().build()) + .setSourceUri("sourceUri-1698419887") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLintResponse(LintResponse.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setDocumentation(Documentation.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SpecName name = SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]"); + + Spec actualResponse = client.getSpec(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getSpecExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SpecName name = SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]"); + client.getSpec(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSpecTest2() throws Exception { + Spec expectedResponse = + Spec.newBuilder() + .setName( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .setDisplayName("displayName1714148973") + .setSpecType(AttributeValues.newBuilder().build()) + .setContents(SpecContents.newBuilder().build()) + .setDetails(SpecDetails.newBuilder().build()) + .setSourceUri("sourceUri-1698419887") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLintResponse(LintResponse.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setDocumentation(Documentation.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-1520/locations/location-1520/apis/api-1520/versions/version-1520/specs/spec-1520"; + + Spec actualResponse = client.getSpec(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getSpecExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-1520/locations/location-1520/apis/api-1520/versions/version-1520/specs/spec-1520"; + client.getSpec(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSpecContentsTest() throws Exception { + SpecContents expectedResponse = + SpecContents.newBuilder() + .setContents(ByteString.EMPTY) + .setMimeType("mimeType-1392120434") + .build(); + mockService.addResponse(expectedResponse); + + SpecName name = SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]"); + + SpecContents actualResponse = client.getSpecContents(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getSpecContentsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SpecName name = SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]"); + client.getSpecContents(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSpecContentsTest2() throws Exception { + SpecContents expectedResponse = + SpecContents.newBuilder() + .setContents(ByteString.EMPTY) + .setMimeType("mimeType-1392120434") + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-1520/locations/location-1520/apis/api-1520/versions/version-1520/specs/spec-1520"; + + SpecContents actualResponse = client.getSpecContents(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getSpecContentsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-1520/locations/location-1520/apis/api-1520/versions/version-1520/specs/spec-1520"; + client.getSpecContents(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSpecsTest() throws Exception { + Spec responsesElement = Spec.newBuilder().build(); + ListSpecsResponse expectedResponse = + ListSpecsResponse.newBuilder() + .setNextPageToken("") + .addAllSpecs(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + VersionName parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + + ListSpecsPagedResponse pagedListResponse = client.listSpecs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSpecsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listSpecsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + VersionName parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + client.listSpecs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSpecsTest2() throws Exception { + Spec responsesElement = Spec.newBuilder().build(); + ListSpecsResponse expectedResponse = + ListSpecsResponse.newBuilder() + .setNextPageToken("") + .addAllSpecs(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = + "projects/project-1179/locations/location-1179/apis/api-1179/versions/version-1179"; + + ListSpecsPagedResponse pagedListResponse = client.listSpecs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSpecsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listSpecsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "projects/project-1179/locations/location-1179/apis/api-1179/versions/version-1179"; + client.listSpecs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateSpecTest() throws Exception { + Spec expectedResponse = + Spec.newBuilder() + .setName( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .setDisplayName("displayName1714148973") + .setSpecType(AttributeValues.newBuilder().build()) + .setContents(SpecContents.newBuilder().build()) + .setDetails(SpecDetails.newBuilder().build()) + .setSourceUri("sourceUri-1698419887") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLintResponse(LintResponse.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setDocumentation(Documentation.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + Spec spec = + Spec.newBuilder() + .setName( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .setDisplayName("displayName1714148973") + .setSpecType(AttributeValues.newBuilder().build()) + .setContents(SpecContents.newBuilder().build()) + .setDetails(SpecDetails.newBuilder().build()) + .setSourceUri("sourceUri-1698419887") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLintResponse(LintResponse.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setDocumentation(Documentation.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Spec actualResponse = client.updateSpec(spec, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateSpecExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Spec spec = + Spec.newBuilder() + .setName( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .setDisplayName("displayName1714148973") + .setSpecType(AttributeValues.newBuilder().build()) + .setContents(SpecContents.newBuilder().build()) + .setDetails(SpecDetails.newBuilder().build()) + .setSourceUri("sourceUri-1698419887") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLintResponse(LintResponse.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setDocumentation(Documentation.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateSpec(spec, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSpecTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + SpecName name = SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]"); + + client.deleteSpec(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteSpecExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SpecName name = SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]"); + client.deleteSpec(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSpecTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-1520/locations/location-1520/apis/api-1520/versions/version-1520/specs/spec-1520"; + + client.deleteSpec(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteSpecExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-1520/locations/location-1520/apis/api-1520/versions/version-1520/specs/spec-1520"; + client.deleteSpec(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getApiOperationTest() throws Exception { + ApiOperation expectedResponse = + ApiOperation.newBuilder() + .setName( + ApiOperationName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[OPERATION]") + .toString()) + .setSpec( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .setDetails(OperationDetails.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + mockService.addResponse(expectedResponse); + + ApiOperationName name = + ApiOperationName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[OPERATION]"); + + ApiOperation actualResponse = client.getApiOperation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getApiOperationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ApiOperationName name = + ApiOperationName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[OPERATION]"); + client.getApiOperation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getApiOperationTest2() throws Exception { + ApiOperation expectedResponse = + ApiOperation.newBuilder() + .setName( + ApiOperationName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[OPERATION]") + .toString()) + .setSpec( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .setDetails(OperationDetails.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-2438/locations/location-2438/apis/api-2438/versions/version-2438/operations/operation-2438"; + + ApiOperation actualResponse = client.getApiOperation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getApiOperationExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-2438/locations/location-2438/apis/api-2438/versions/version-2438/operations/operation-2438"; + client.getApiOperation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listApiOperationsTest() throws Exception { + ApiOperation responsesElement = ApiOperation.newBuilder().build(); + ListApiOperationsResponse expectedResponse = + ListApiOperationsResponse.newBuilder() + .setNextPageToken("") + .addAllApiOperations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + VersionName parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + + ListApiOperationsPagedResponse pagedListResponse = client.listApiOperations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getApiOperationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listApiOperationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + VersionName parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + client.listApiOperations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listApiOperationsTest2() throws Exception { + ApiOperation responsesElement = ApiOperation.newBuilder().build(); + ListApiOperationsResponse expectedResponse = + ListApiOperationsResponse.newBuilder() + .setNextPageToken("") + .addAllApiOperations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = + "projects/project-1179/locations/location-1179/apis/api-1179/versions/version-1179"; + + ListApiOperationsPagedResponse pagedListResponse = client.listApiOperations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getApiOperationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listApiOperationsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "projects/project-1179/locations/location-1179/apis/api-1179/versions/version-1179"; + client.listApiOperations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDefinitionTest() throws Exception { + Definition expectedResponse = + Definition.newBuilder() + .setName( + DefinitionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[DEFINITION]") + .toString()) + .setSpec( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + mockService.addResponse(expectedResponse); + + DefinitionName name = + DefinitionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[DEFINITION]"); + + Definition actualResponse = client.getDefinition(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getDefinitionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DefinitionName name = + DefinitionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[DEFINITION]"); + client.getDefinition(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDefinitionTest2() throws Exception { + Definition expectedResponse = + Definition.newBuilder() + .setName( + DefinitionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[DEFINITION]") + .toString()) + .setSpec( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-9608/locations/location-9608/apis/api-9608/versions/version-9608/definitions/definition-9608"; + + Definition actualResponse = client.getDefinition(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getDefinitionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-9608/locations/location-9608/apis/api-9608/versions/version-9608/definitions/definition-9608"; + client.getDefinition(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createDeploymentTest() throws Exception { + Deployment expectedResponse = + Deployment.newBuilder() + .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .setDeploymentType(AttributeValues.newBuilder().build()) + .setResourceUri("resourceUri1234527870") + .addAllEndpoints(new ArrayList()) + .addAllApiVersions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setSlo(AttributeValues.newBuilder().build()) + .setEnvironment(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Deployment deployment = Deployment.newBuilder().build(); + String deploymentId = "deploymentId-136894784"; + + Deployment actualResponse = client.createDeployment(parent, deployment, deploymentId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createDeploymentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Deployment deployment = Deployment.newBuilder().build(); + String deploymentId = "deploymentId-136894784"; + client.createDeployment(parent, deployment, deploymentId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createDeploymentTest2() throws Exception { + Deployment expectedResponse = + Deployment.newBuilder() + .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .setDeploymentType(AttributeValues.newBuilder().build()) + .setResourceUri("resourceUri1234527870") + .addAllEndpoints(new ArrayList()) + .addAllApiVersions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setSlo(AttributeValues.newBuilder().build()) + .setEnvironment(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + Deployment deployment = Deployment.newBuilder().build(); + String deploymentId = "deploymentId-136894784"; + + Deployment actualResponse = client.createDeployment(parent, deployment, deploymentId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createDeploymentExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + Deployment deployment = Deployment.newBuilder().build(); + String deploymentId = "deploymentId-136894784"; + client.createDeployment(parent, deployment, deploymentId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDeploymentTest() throws Exception { + Deployment expectedResponse = + Deployment.newBuilder() + .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .setDeploymentType(AttributeValues.newBuilder().build()) + .setResourceUri("resourceUri1234527870") + .addAllEndpoints(new ArrayList()) + .addAllApiVersions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setSlo(AttributeValues.newBuilder().build()) + .setEnvironment(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + mockService.addResponse(expectedResponse); + + DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]"); + + Deployment actualResponse = client.getDeployment(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getDeploymentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]"); + client.getDeployment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDeploymentTest2() throws Exception { + Deployment expectedResponse = + Deployment.newBuilder() + .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .setDeploymentType(AttributeValues.newBuilder().build()) + .setResourceUri("resourceUri1234527870") + .addAllEndpoints(new ArrayList()) + .addAllApiVersions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setSlo(AttributeValues.newBuilder().build()) + .setEnvironment(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-4348/locations/location-4348/deployments/deployment-4348"; + + Deployment actualResponse = client.getDeployment(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getDeploymentExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-4348/locations/location-4348/deployments/deployment-4348"; + client.getDeployment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDeploymentsTest() throws Exception { + Deployment responsesElement = Deployment.newBuilder().build(); + ListDeploymentsResponse expectedResponse = + ListDeploymentsResponse.newBuilder() + .setNextPageToken("") + .addAllDeployments(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListDeploymentsPagedResponse pagedListResponse = client.listDeployments(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDeploymentsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listDeploymentsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listDeployments(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDeploymentsTest2() throws Exception { + Deployment responsesElement = Deployment.newBuilder().build(); + ListDeploymentsResponse expectedResponse = + ListDeploymentsResponse.newBuilder() + .setNextPageToken("") + .addAllDeployments(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListDeploymentsPagedResponse pagedListResponse = client.listDeployments(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDeploymentsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listDeploymentsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listDeployments(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateDeploymentTest() throws Exception { + Deployment expectedResponse = + Deployment.newBuilder() + .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .setDeploymentType(AttributeValues.newBuilder().build()) + .setResourceUri("resourceUri1234527870") + .addAllEndpoints(new ArrayList()) + .addAllApiVersions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setSlo(AttributeValues.newBuilder().build()) + .setEnvironment(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + mockService.addResponse(expectedResponse); + + Deployment deployment = + Deployment.newBuilder() + .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .setDeploymentType(AttributeValues.newBuilder().build()) + .setResourceUri("resourceUri1234527870") + .addAllEndpoints(new ArrayList()) + .addAllApiVersions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setSlo(AttributeValues.newBuilder().build()) + .setEnvironment(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Deployment actualResponse = client.updateDeployment(deployment, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateDeploymentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Deployment deployment = + Deployment.newBuilder() + .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .setDeploymentType(AttributeValues.newBuilder().build()) + .setResourceUri("resourceUri1234527870") + .addAllEndpoints(new ArrayList()) + .addAllApiVersions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setSlo(AttributeValues.newBuilder().build()) + .setEnvironment(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateDeployment(deployment, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDeploymentTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]"); + + client.deleteDeployment(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteDeploymentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]"); + client.deleteDeployment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDeploymentTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-4348/locations/location-4348/deployments/deployment-4348"; + + client.deleteDeployment(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteDeploymentExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-4348/locations/location-4348/deployments/deployment-4348"; + client.deleteDeployment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createAttributeTest() throws Exception { + Attribute expectedResponse = + Attribute.newBuilder() + .setName(AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllAllowedValues(new ArrayList()) + .setCardinality(845213070) + .setMandatory(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Attribute attribute = Attribute.newBuilder().build(); + String attributeId = "attributeId-309887785"; + + Attribute actualResponse = client.createAttribute(parent, attribute, attributeId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createAttributeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Attribute attribute = Attribute.newBuilder().build(); + String attributeId = "attributeId-309887785"; + client.createAttribute(parent, attribute, attributeId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createAttributeTest2() throws Exception { + Attribute expectedResponse = + Attribute.newBuilder() + .setName(AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllAllowedValues(new ArrayList()) + .setCardinality(845213070) + .setMandatory(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + Attribute attribute = Attribute.newBuilder().build(); + String attributeId = "attributeId-309887785"; + + Attribute actualResponse = client.createAttribute(parent, attribute, attributeId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createAttributeExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + Attribute attribute = Attribute.newBuilder().build(); + String attributeId = "attributeId-309887785"; + client.createAttribute(parent, attribute, attributeId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAttributeTest() throws Exception { + Attribute expectedResponse = + Attribute.newBuilder() + .setName(AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllAllowedValues(new ArrayList()) + .setCardinality(845213070) + .setMandatory(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + AttributeName name = AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]"); + + Attribute actualResponse = client.getAttribute(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getAttributeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AttributeName name = AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]"); + client.getAttribute(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAttributeTest2() throws Exception { + Attribute expectedResponse = + Attribute.newBuilder() + .setName(AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllAllowedValues(new ArrayList()) + .setCardinality(845213070) + .setMandatory(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-7207/locations/location-7207/attributes/attribute-7207"; + + Attribute actualResponse = client.getAttribute(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getAttributeExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-7207/locations/location-7207/attributes/attribute-7207"; + client.getAttribute(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateAttributeTest() throws Exception { + Attribute expectedResponse = + Attribute.newBuilder() + .setName(AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllAllowedValues(new ArrayList()) + .setCardinality(845213070) + .setMandatory(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + Attribute attribute = + Attribute.newBuilder() + .setName(AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllAllowedValues(new ArrayList()) + .setCardinality(845213070) + .setMandatory(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Attribute actualResponse = client.updateAttribute(attribute, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateAttributeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Attribute attribute = + Attribute.newBuilder() + .setName(AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllAllowedValues(new ArrayList()) + .setCardinality(845213070) + .setMandatory(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateAttribute(attribute, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteAttributeTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + AttributeName name = AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]"); + + client.deleteAttribute(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteAttributeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AttributeName name = AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]"); + client.deleteAttribute(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteAttributeTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-7207/locations/location-7207/attributes/attribute-7207"; + + client.deleteAttribute(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteAttributeExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-7207/locations/location-7207/attributes/attribute-7207"; + client.deleteAttribute(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAttributesTest() throws Exception { + Attribute responsesElement = Attribute.newBuilder().build(); + ListAttributesResponse expectedResponse = + ListAttributesResponse.newBuilder() + .setNextPageToken("") + .addAllAttributes(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListAttributesPagedResponse pagedListResponse = client.listAttributes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAttributesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listAttributesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listAttributes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAttributesTest2() throws Exception { + Attribute responsesElement = Attribute.newBuilder().build(); + ListAttributesResponse expectedResponse = + ListAttributesResponse.newBuilder() + .setNextPageToken("") + .addAllAttributes(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListAttributesPagedResponse pagedListResponse = client.listAttributes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAttributesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listAttributesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listAttributes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchResourcesTest() throws Exception { + SearchResult responsesElement = SearchResult.newBuilder().build(); + SearchResourcesResponse expectedResponse = + SearchResourcesResponse.newBuilder() + .setNextPageToken("") + .addAllSearchResults(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName location = LocationName.of("[PROJECT]", "[LOCATION]"); + String query = "query107944136"; + + SearchResourcesPagedResponse pagedListResponse = client.searchResources(location, query); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSearchResultsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void searchResourcesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName location = LocationName.of("[PROJECT]", "[LOCATION]"); + String query = "query107944136"; + client.searchResources(location, query); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchResourcesTest2() throws Exception { + SearchResult responsesElement = SearchResult.newBuilder().build(); + SearchResourcesResponse expectedResponse = + SearchResourcesResponse.newBuilder() + .setNextPageToken("") + .addAllSearchResults(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String location = "projects/project-7132/locations/location-7132"; + String query = "query107944136"; + + SearchResourcesPagedResponse pagedListResponse = client.searchResources(location, query); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSearchResultsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void searchResourcesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String location = "projects/project-7132/locations/location-7132"; + String query = "query107944136"; + client.searchResources(location, query); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createExternalApiTest() throws Exception { + ExternalApi expectedResponse = + ExternalApi.newBuilder() + .setName(ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllEndpoints(new ArrayList()) + .addAllPaths(new ArrayList()) + .setDocumentation(Documentation.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ExternalApi externalApi = ExternalApi.newBuilder().build(); + String externalApiId = "externalApiId-31672374"; + + ExternalApi actualResponse = client.createExternalApi(parent, externalApi, externalApiId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createExternalApiExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ExternalApi externalApi = ExternalApi.newBuilder().build(); + String externalApiId = "externalApiId-31672374"; + client.createExternalApi(parent, externalApi, externalApiId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createExternalApiTest2() throws Exception { + ExternalApi expectedResponse = + ExternalApi.newBuilder() + .setName(ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllEndpoints(new ArrayList()) + .addAllPaths(new ArrayList()) + .setDocumentation(Documentation.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + ExternalApi externalApi = ExternalApi.newBuilder().build(); + String externalApiId = "externalApiId-31672374"; + + ExternalApi actualResponse = client.createExternalApi(parent, externalApi, externalApiId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createExternalApiExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + ExternalApi externalApi = ExternalApi.newBuilder().build(); + String externalApiId = "externalApiId-31672374"; + client.createExternalApi(parent, externalApi, externalApiId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getExternalApiTest() throws Exception { + ExternalApi expectedResponse = + ExternalApi.newBuilder() + .setName(ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllEndpoints(new ArrayList()) + .addAllPaths(new ArrayList()) + .setDocumentation(Documentation.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ExternalApiName name = ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]"); + + ExternalApi actualResponse = client.getExternalApi(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getExternalApiExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ExternalApiName name = ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]"); + client.getExternalApi(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getExternalApiTest2() throws Exception { + ExternalApi expectedResponse = + ExternalApi.newBuilder() + .setName(ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllEndpoints(new ArrayList()) + .addAllPaths(new ArrayList()) + .setDocumentation(Documentation.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-4884/locations/location-4884/externalApis/externalApi-4884"; + + ExternalApi actualResponse = client.getExternalApi(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getExternalApiExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-4884/locations/location-4884/externalApis/externalApi-4884"; + client.getExternalApi(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateExternalApiTest() throws Exception { + ExternalApi expectedResponse = + ExternalApi.newBuilder() + .setName(ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllEndpoints(new ArrayList()) + .addAllPaths(new ArrayList()) + .setDocumentation(Documentation.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ExternalApi externalApi = + ExternalApi.newBuilder() + .setName(ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllEndpoints(new ArrayList()) + .addAllPaths(new ArrayList()) + .setDocumentation(Documentation.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + ExternalApi actualResponse = client.updateExternalApi(externalApi, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateExternalApiExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ExternalApi externalApi = + ExternalApi.newBuilder() + .setName(ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllEndpoints(new ArrayList()) + .addAllPaths(new ArrayList()) + .setDocumentation(Documentation.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateExternalApi(externalApi, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteExternalApiTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + ExternalApiName name = ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]"); + + client.deleteExternalApi(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteExternalApiExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ExternalApiName name = ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]"); + client.deleteExternalApi(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteExternalApiTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-4884/locations/location-4884/externalApis/externalApi-4884"; + + client.deleteExternalApi(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteExternalApiExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-4884/locations/location-4884/externalApis/externalApi-4884"; + client.deleteExternalApi(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listExternalApisTest() throws Exception { + ExternalApi responsesElement = ExternalApi.newBuilder().build(); + ListExternalApisResponse expectedResponse = + ListExternalApisResponse.newBuilder() + .setNextPageToken("") + .addAllExternalApis(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListExternalApisPagedResponse pagedListResponse = client.listExternalApis(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getExternalApisList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listExternalApisExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listExternalApis(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listExternalApisTest2() throws Exception { + ExternalApi responsesElement = ExternalApi.newBuilder().build(); + ListExternalApisResponse expectedResponse = + ListExternalApisResponse.newBuilder() + .setNextPageToken("") + .addAllExternalApis(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListExternalApisPagedResponse pagedListResponse = client.listExternalApis(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getExternalApisList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listExternalApisExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listExternalApis(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ApiHubClientTest.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ApiHubClientTest.java new file mode 100644 index 000000000000..5aa602c7d80d --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ApiHubClientTest.java @@ -0,0 +1,3155 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import static com.google.cloud.apihub.v1.ApiHubClient.ListApiOperationsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListApisPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListAttributesPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListDeploymentsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListExternalApisPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListLocationsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListSpecsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.ListVersionsPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubClient.SearchResourcesPagedResponse; + +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +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 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 ApiHubClientTest { + private static MockApiHub mockApiHub; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private ApiHubClient client; + + @BeforeClass + public static void startStaticServer() { + mockApiHub = new MockApiHub(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockApiHub, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + ApiHubSettings settings = + ApiHubSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ApiHubClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createApiTest() throws Exception { + Api expectedResponse = + Api.newBuilder() + .setName(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .setOwner(Owner.newBuilder().build()) + .addAllVersions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setTargetUser(AttributeValues.newBuilder().build()) + .setTeam(AttributeValues.newBuilder().build()) + .setBusinessUnit(AttributeValues.newBuilder().build()) + .setMaturityLevel(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setApiStyle(AttributeValues.newBuilder().build()) + .setSelectedVersion( + VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .build(); + mockApiHub.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Api api = Api.newBuilder().build(); + String apiId = "apiId93021397"; + + Api actualResponse = client.createApi(parent, api, apiId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateApiRequest actualRequest = ((CreateApiRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(api, actualRequest.getApi()); + Assert.assertEquals(apiId, actualRequest.getApiId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createApiExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Api api = Api.newBuilder().build(); + String apiId = "apiId93021397"; + client.createApi(parent, api, apiId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createApiTest2() throws Exception { + Api expectedResponse = + Api.newBuilder() + .setName(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .setOwner(Owner.newBuilder().build()) + .addAllVersions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setTargetUser(AttributeValues.newBuilder().build()) + .setTeam(AttributeValues.newBuilder().build()) + .setBusinessUnit(AttributeValues.newBuilder().build()) + .setMaturityLevel(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setApiStyle(AttributeValues.newBuilder().build()) + .setSelectedVersion( + VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .build(); + mockApiHub.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Api api = Api.newBuilder().build(); + String apiId = "apiId93021397"; + + Api actualResponse = client.createApi(parent, api, apiId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateApiRequest actualRequest = ((CreateApiRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(api, actualRequest.getApi()); + Assert.assertEquals(apiId, actualRequest.getApiId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createApiExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String parent = "parent-995424086"; + Api api = Api.newBuilder().build(); + String apiId = "apiId93021397"; + client.createApi(parent, api, apiId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getApiTest() throws Exception { + Api expectedResponse = + Api.newBuilder() + .setName(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .setOwner(Owner.newBuilder().build()) + .addAllVersions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setTargetUser(AttributeValues.newBuilder().build()) + .setTeam(AttributeValues.newBuilder().build()) + .setBusinessUnit(AttributeValues.newBuilder().build()) + .setMaturityLevel(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setApiStyle(AttributeValues.newBuilder().build()) + .setSelectedVersion( + VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .build(); + mockApiHub.addResponse(expectedResponse); + + ApiName name = ApiName.of("[PROJECT]", "[LOCATION]", "[API]"); + + Api actualResponse = client.getApi(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetApiRequest actualRequest = ((GetApiRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getApiExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + ApiName name = ApiName.of("[PROJECT]", "[LOCATION]", "[API]"); + client.getApi(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getApiTest2() throws Exception { + Api expectedResponse = + Api.newBuilder() + .setName(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .setOwner(Owner.newBuilder().build()) + .addAllVersions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setTargetUser(AttributeValues.newBuilder().build()) + .setTeam(AttributeValues.newBuilder().build()) + .setBusinessUnit(AttributeValues.newBuilder().build()) + .setMaturityLevel(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setApiStyle(AttributeValues.newBuilder().build()) + .setSelectedVersion( + VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .build(); + mockApiHub.addResponse(expectedResponse); + + String name = "name3373707"; + + Api actualResponse = client.getApi(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetApiRequest actualRequest = ((GetApiRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getApiExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String name = "name3373707"; + client.getApi(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listApisTest() throws Exception { + Api responsesElement = Api.newBuilder().build(); + ListApisResponse expectedResponse = + ListApisResponse.newBuilder() + .setNextPageToken("") + .addAllApis(Arrays.asList(responsesElement)) + .build(); + mockApiHub.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListApisPagedResponse pagedListResponse = client.listApis(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getApisList().get(0), resources.get(0)); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListApisRequest actualRequest = ((ListApisRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listApisExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listApis(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listApisTest2() throws Exception { + Api responsesElement = Api.newBuilder().build(); + ListApisResponse expectedResponse = + ListApisResponse.newBuilder() + .setNextPageToken("") + .addAllApis(Arrays.asList(responsesElement)) + .build(); + mockApiHub.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListApisPagedResponse pagedListResponse = client.listApis(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getApisList().get(0), resources.get(0)); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListApisRequest actualRequest = ((ListApisRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listApisExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String parent = "parent-995424086"; + client.listApis(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateApiTest() throws Exception { + Api expectedResponse = + Api.newBuilder() + .setName(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .setOwner(Owner.newBuilder().build()) + .addAllVersions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setTargetUser(AttributeValues.newBuilder().build()) + .setTeam(AttributeValues.newBuilder().build()) + .setBusinessUnit(AttributeValues.newBuilder().build()) + .setMaturityLevel(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setApiStyle(AttributeValues.newBuilder().build()) + .setSelectedVersion( + VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .build(); + mockApiHub.addResponse(expectedResponse); + + Api api = Api.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Api actualResponse = client.updateApi(api, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateApiRequest actualRequest = ((UpdateApiRequest) actualRequests.get(0)); + + Assert.assertEquals(api, actualRequest.getApi()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateApiExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + Api api = Api.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateApi(api, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteApiTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockApiHub.addResponse(expectedResponse); + + ApiName name = ApiName.of("[PROJECT]", "[LOCATION]", "[API]"); + + client.deleteApi(name); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteApiRequest actualRequest = ((DeleteApiRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteApiExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + ApiName name = ApiName.of("[PROJECT]", "[LOCATION]", "[API]"); + client.deleteApi(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteApiTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockApiHub.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteApi(name); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteApiRequest actualRequest = ((DeleteApiRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteApiExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String name = "name3373707"; + client.deleteApi(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createVersionTest() throws Exception { + Version expectedResponse = + Version.newBuilder() + .setName(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .addAllSpecs(new ArrayList()) + .addAllApiOperations(new ArrayList()) + .addAllDefinitions(new ArrayList()) + .addAllDeployments(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLifecycle(AttributeValues.newBuilder().build()) + .setCompliance(AttributeValues.newBuilder().build()) + .setAccreditation(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setSelectedDeployment( + DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + .build(); + mockApiHub.addResponse(expectedResponse); + + ApiName parent = ApiName.of("[PROJECT]", "[LOCATION]", "[API]"); + Version version = Version.newBuilder().build(); + String versionId = "versionId-1407102957"; + + Version actualResponse = client.createVersion(parent, version, versionId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateVersionRequest actualRequest = ((CreateVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(version, actualRequest.getVersion()); + Assert.assertEquals(versionId, actualRequest.getVersionId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createVersionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + ApiName parent = ApiName.of("[PROJECT]", "[LOCATION]", "[API]"); + Version version = Version.newBuilder().build(); + String versionId = "versionId-1407102957"; + client.createVersion(parent, version, versionId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createVersionTest2() throws Exception { + Version expectedResponse = + Version.newBuilder() + .setName(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .addAllSpecs(new ArrayList()) + .addAllApiOperations(new ArrayList()) + .addAllDefinitions(new ArrayList()) + .addAllDeployments(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLifecycle(AttributeValues.newBuilder().build()) + .setCompliance(AttributeValues.newBuilder().build()) + .setAccreditation(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setSelectedDeployment( + DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + .build(); + mockApiHub.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Version version = Version.newBuilder().build(); + String versionId = "versionId-1407102957"; + + Version actualResponse = client.createVersion(parent, version, versionId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateVersionRequest actualRequest = ((CreateVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(version, actualRequest.getVersion()); + Assert.assertEquals(versionId, actualRequest.getVersionId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createVersionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String parent = "parent-995424086"; + Version version = Version.newBuilder().build(); + String versionId = "versionId-1407102957"; + client.createVersion(parent, version, versionId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getVersionTest() throws Exception { + Version expectedResponse = + Version.newBuilder() + .setName(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .addAllSpecs(new ArrayList()) + .addAllApiOperations(new ArrayList()) + .addAllDefinitions(new ArrayList()) + .addAllDeployments(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLifecycle(AttributeValues.newBuilder().build()) + .setCompliance(AttributeValues.newBuilder().build()) + .setAccreditation(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setSelectedDeployment( + DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + .build(); + mockApiHub.addResponse(expectedResponse); + + VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + + Version actualResponse = client.getVersion(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetVersionRequest actualRequest = ((GetVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getVersionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + client.getVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getVersionTest2() throws Exception { + Version expectedResponse = + Version.newBuilder() + .setName(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .addAllSpecs(new ArrayList()) + .addAllApiOperations(new ArrayList()) + .addAllDefinitions(new ArrayList()) + .addAllDeployments(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLifecycle(AttributeValues.newBuilder().build()) + .setCompliance(AttributeValues.newBuilder().build()) + .setAccreditation(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setSelectedDeployment( + DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + .build(); + mockApiHub.addResponse(expectedResponse); + + String name = "name3373707"; + + Version actualResponse = client.getVersion(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetVersionRequest actualRequest = ((GetVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getVersionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String name = "name3373707"; + client.getVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listVersionsTest() throws Exception { + Version responsesElement = Version.newBuilder().build(); + ListVersionsResponse expectedResponse = + ListVersionsResponse.newBuilder() + .setNextPageToken("") + .addAllVersions(Arrays.asList(responsesElement)) + .build(); + mockApiHub.addResponse(expectedResponse); + + ApiName parent = ApiName.of("[PROJECT]", "[LOCATION]", "[API]"); + + ListVersionsPagedResponse pagedListResponse = client.listVersions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getVersionsList().get(0), resources.get(0)); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListVersionsRequest actualRequest = ((ListVersionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listVersionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + ApiName parent = ApiName.of("[PROJECT]", "[LOCATION]", "[API]"); + client.listVersions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listVersionsTest2() throws Exception { + Version responsesElement = Version.newBuilder().build(); + ListVersionsResponse expectedResponse = + ListVersionsResponse.newBuilder() + .setNextPageToken("") + .addAllVersions(Arrays.asList(responsesElement)) + .build(); + mockApiHub.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListVersionsPagedResponse pagedListResponse = client.listVersions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getVersionsList().get(0), resources.get(0)); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListVersionsRequest actualRequest = ((ListVersionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listVersionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String parent = "parent-995424086"; + client.listVersions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateVersionTest() throws Exception { + Version expectedResponse = + Version.newBuilder() + .setName(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .addAllSpecs(new ArrayList()) + .addAllApiOperations(new ArrayList()) + .addAllDefinitions(new ArrayList()) + .addAllDeployments(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLifecycle(AttributeValues.newBuilder().build()) + .setCompliance(AttributeValues.newBuilder().build()) + .setAccreditation(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setSelectedDeployment( + DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + .build(); + mockApiHub.addResponse(expectedResponse); + + Version version = Version.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Version actualResponse = client.updateVersion(version, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateVersionRequest actualRequest = ((UpdateVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(version, actualRequest.getVersion()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateVersionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + Version version = Version.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateVersion(version, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteVersionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockApiHub.addResponse(expectedResponse); + + VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + + client.deleteVersion(name); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteVersionRequest actualRequest = ((DeleteVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteVersionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + client.deleteVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteVersionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockApiHub.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteVersion(name); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteVersionRequest actualRequest = ((DeleteVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteVersionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String name = "name3373707"; + client.deleteVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSpecTest() throws Exception { + Spec expectedResponse = + Spec.newBuilder() + .setName( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .setDisplayName("displayName1714148973") + .setSpecType(AttributeValues.newBuilder().build()) + .setContents(SpecContents.newBuilder().build()) + .setDetails(SpecDetails.newBuilder().build()) + .setSourceUri("sourceUri-1698419887") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLintResponse(LintResponse.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setDocumentation(Documentation.newBuilder().build()) + .build(); + mockApiHub.addResponse(expectedResponse); + + VersionName parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + Spec spec = Spec.newBuilder().build(); + String specId = "specId-896074186"; + + Spec actualResponse = client.createSpec(parent, spec, specId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSpecRequest actualRequest = ((CreateSpecRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(spec, actualRequest.getSpec()); + Assert.assertEquals(specId, actualRequest.getSpecId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSpecExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + VersionName parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + Spec spec = Spec.newBuilder().build(); + String specId = "specId-896074186"; + client.createSpec(parent, spec, specId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSpecTest2() throws Exception { + Spec expectedResponse = + Spec.newBuilder() + .setName( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .setDisplayName("displayName1714148973") + .setSpecType(AttributeValues.newBuilder().build()) + .setContents(SpecContents.newBuilder().build()) + .setDetails(SpecDetails.newBuilder().build()) + .setSourceUri("sourceUri-1698419887") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLintResponse(LintResponse.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setDocumentation(Documentation.newBuilder().build()) + .build(); + mockApiHub.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Spec spec = Spec.newBuilder().build(); + String specId = "specId-896074186"; + + Spec actualResponse = client.createSpec(parent, spec, specId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSpecRequest actualRequest = ((CreateSpecRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(spec, actualRequest.getSpec()); + Assert.assertEquals(specId, actualRequest.getSpecId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSpecExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String parent = "parent-995424086"; + Spec spec = Spec.newBuilder().build(); + String specId = "specId-896074186"; + client.createSpec(parent, spec, specId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSpecTest() throws Exception { + Spec expectedResponse = + Spec.newBuilder() + .setName( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .setDisplayName("displayName1714148973") + .setSpecType(AttributeValues.newBuilder().build()) + .setContents(SpecContents.newBuilder().build()) + .setDetails(SpecDetails.newBuilder().build()) + .setSourceUri("sourceUri-1698419887") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLintResponse(LintResponse.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setDocumentation(Documentation.newBuilder().build()) + .build(); + mockApiHub.addResponse(expectedResponse); + + SpecName name = SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]"); + + Spec actualResponse = client.getSpec(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSpecRequest actualRequest = ((GetSpecRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSpecExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + SpecName name = SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]"); + client.getSpec(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSpecTest2() throws Exception { + Spec expectedResponse = + Spec.newBuilder() + .setName( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .setDisplayName("displayName1714148973") + .setSpecType(AttributeValues.newBuilder().build()) + .setContents(SpecContents.newBuilder().build()) + .setDetails(SpecDetails.newBuilder().build()) + .setSourceUri("sourceUri-1698419887") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLintResponse(LintResponse.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setDocumentation(Documentation.newBuilder().build()) + .build(); + mockApiHub.addResponse(expectedResponse); + + String name = "name3373707"; + + Spec actualResponse = client.getSpec(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSpecRequest actualRequest = ((GetSpecRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSpecExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String name = "name3373707"; + client.getSpec(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSpecContentsTest() throws Exception { + SpecContents expectedResponse = + SpecContents.newBuilder() + .setContents(ByteString.EMPTY) + .setMimeType("mimeType-1392120434") + .build(); + mockApiHub.addResponse(expectedResponse); + + SpecName name = SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]"); + + SpecContents actualResponse = client.getSpecContents(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSpecContentsRequest actualRequest = ((GetSpecContentsRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSpecContentsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + SpecName name = SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]"); + client.getSpecContents(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSpecContentsTest2() throws Exception { + SpecContents expectedResponse = + SpecContents.newBuilder() + .setContents(ByteString.EMPTY) + .setMimeType("mimeType-1392120434") + .build(); + mockApiHub.addResponse(expectedResponse); + + String name = "name3373707"; + + SpecContents actualResponse = client.getSpecContents(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSpecContentsRequest actualRequest = ((GetSpecContentsRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSpecContentsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String name = "name3373707"; + client.getSpecContents(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSpecsTest() throws Exception { + Spec responsesElement = Spec.newBuilder().build(); + ListSpecsResponse expectedResponse = + ListSpecsResponse.newBuilder() + .setNextPageToken("") + .addAllSpecs(Arrays.asList(responsesElement)) + .build(); + mockApiHub.addResponse(expectedResponse); + + VersionName parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + + ListSpecsPagedResponse pagedListResponse = client.listSpecs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSpecsList().get(0), resources.get(0)); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSpecsRequest actualRequest = ((ListSpecsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSpecsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + VersionName parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + client.listSpecs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSpecsTest2() throws Exception { + Spec responsesElement = Spec.newBuilder().build(); + ListSpecsResponse expectedResponse = + ListSpecsResponse.newBuilder() + .setNextPageToken("") + .addAllSpecs(Arrays.asList(responsesElement)) + .build(); + mockApiHub.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListSpecsPagedResponse pagedListResponse = client.listSpecs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSpecsList().get(0), resources.get(0)); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSpecsRequest actualRequest = ((ListSpecsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSpecsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String parent = "parent-995424086"; + client.listSpecs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateSpecTest() throws Exception { + Spec expectedResponse = + Spec.newBuilder() + .setName( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .setDisplayName("displayName1714148973") + .setSpecType(AttributeValues.newBuilder().build()) + .setContents(SpecContents.newBuilder().build()) + .setDetails(SpecDetails.newBuilder().build()) + .setSourceUri("sourceUri-1698419887") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLintResponse(LintResponse.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setDocumentation(Documentation.newBuilder().build()) + .build(); + mockApiHub.addResponse(expectedResponse); + + Spec spec = Spec.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Spec actualResponse = client.updateSpec(spec, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSpecRequest actualRequest = ((UpdateSpecRequest) actualRequests.get(0)); + + Assert.assertEquals(spec, actualRequest.getSpec()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateSpecExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + Spec spec = Spec.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateSpec(spec, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSpecTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockApiHub.addResponse(expectedResponse); + + SpecName name = SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]"); + + client.deleteSpec(name); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSpecRequest actualRequest = ((DeleteSpecRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSpecExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + SpecName name = SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]"); + client.deleteSpec(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSpecTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockApiHub.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteSpec(name); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSpecRequest actualRequest = ((DeleteSpecRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSpecExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String name = "name3373707"; + client.deleteSpec(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getApiOperationTest() throws Exception { + ApiOperation expectedResponse = + ApiOperation.newBuilder() + .setName( + ApiOperationName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[OPERATION]") + .toString()) + .setSpec( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .setDetails(OperationDetails.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + mockApiHub.addResponse(expectedResponse); + + ApiOperationName name = + ApiOperationName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[OPERATION]"); + + ApiOperation actualResponse = client.getApiOperation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetApiOperationRequest actualRequest = ((GetApiOperationRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getApiOperationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + ApiOperationName name = + ApiOperationName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[OPERATION]"); + client.getApiOperation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getApiOperationTest2() throws Exception { + ApiOperation expectedResponse = + ApiOperation.newBuilder() + .setName( + ApiOperationName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[OPERATION]") + .toString()) + .setSpec( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .setDetails(OperationDetails.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + mockApiHub.addResponse(expectedResponse); + + String name = "name3373707"; + + ApiOperation actualResponse = client.getApiOperation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetApiOperationRequest actualRequest = ((GetApiOperationRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getApiOperationExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String name = "name3373707"; + client.getApiOperation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listApiOperationsTest() throws Exception { + ApiOperation responsesElement = ApiOperation.newBuilder().build(); + ListApiOperationsResponse expectedResponse = + ListApiOperationsResponse.newBuilder() + .setNextPageToken("") + .addAllApiOperations(Arrays.asList(responsesElement)) + .build(); + mockApiHub.addResponse(expectedResponse); + + VersionName parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + + ListApiOperationsPagedResponse pagedListResponse = client.listApiOperations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getApiOperationsList().get(0), resources.get(0)); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListApiOperationsRequest actualRequest = ((ListApiOperationsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listApiOperationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + VersionName parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + client.listApiOperations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listApiOperationsTest2() throws Exception { + ApiOperation responsesElement = ApiOperation.newBuilder().build(); + ListApiOperationsResponse expectedResponse = + ListApiOperationsResponse.newBuilder() + .setNextPageToken("") + .addAllApiOperations(Arrays.asList(responsesElement)) + .build(); + mockApiHub.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListApiOperationsPagedResponse pagedListResponse = client.listApiOperations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getApiOperationsList().get(0), resources.get(0)); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListApiOperationsRequest actualRequest = ((ListApiOperationsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listApiOperationsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String parent = "parent-995424086"; + client.listApiOperations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDefinitionTest() throws Exception { + Definition expectedResponse = + Definition.newBuilder() + .setName( + DefinitionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[DEFINITION]") + .toString()) + .setSpec( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + mockApiHub.addResponse(expectedResponse); + + DefinitionName name = + DefinitionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[DEFINITION]"); + + Definition actualResponse = client.getDefinition(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetDefinitionRequest actualRequest = ((GetDefinitionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getDefinitionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + DefinitionName name = + DefinitionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[DEFINITION]"); + client.getDefinition(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDefinitionTest2() throws Exception { + Definition expectedResponse = + Definition.newBuilder() + .setName( + DefinitionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[DEFINITION]") + .toString()) + .setSpec( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + mockApiHub.addResponse(expectedResponse); + + String name = "name3373707"; + + Definition actualResponse = client.getDefinition(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetDefinitionRequest actualRequest = ((GetDefinitionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getDefinitionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String name = "name3373707"; + client.getDefinition(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createDeploymentTest() throws Exception { + Deployment expectedResponse = + Deployment.newBuilder() + .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .setDeploymentType(AttributeValues.newBuilder().build()) + .setResourceUri("resourceUri1234527870") + .addAllEndpoints(new ArrayList()) + .addAllApiVersions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setSlo(AttributeValues.newBuilder().build()) + .setEnvironment(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + mockApiHub.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Deployment deployment = Deployment.newBuilder().build(); + String deploymentId = "deploymentId-136894784"; + + Deployment actualResponse = client.createDeployment(parent, deployment, deploymentId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateDeploymentRequest actualRequest = ((CreateDeploymentRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(deployment, actualRequest.getDeployment()); + Assert.assertEquals(deploymentId, actualRequest.getDeploymentId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createDeploymentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Deployment deployment = Deployment.newBuilder().build(); + String deploymentId = "deploymentId-136894784"; + client.createDeployment(parent, deployment, deploymentId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createDeploymentTest2() throws Exception { + Deployment expectedResponse = + Deployment.newBuilder() + .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .setDeploymentType(AttributeValues.newBuilder().build()) + .setResourceUri("resourceUri1234527870") + .addAllEndpoints(new ArrayList()) + .addAllApiVersions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setSlo(AttributeValues.newBuilder().build()) + .setEnvironment(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + mockApiHub.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Deployment deployment = Deployment.newBuilder().build(); + String deploymentId = "deploymentId-136894784"; + + Deployment actualResponse = client.createDeployment(parent, deployment, deploymentId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateDeploymentRequest actualRequest = ((CreateDeploymentRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(deployment, actualRequest.getDeployment()); + Assert.assertEquals(deploymentId, actualRequest.getDeploymentId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createDeploymentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String parent = "parent-995424086"; + Deployment deployment = Deployment.newBuilder().build(); + String deploymentId = "deploymentId-136894784"; + client.createDeployment(parent, deployment, deploymentId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDeploymentTest() throws Exception { + Deployment expectedResponse = + Deployment.newBuilder() + .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .setDeploymentType(AttributeValues.newBuilder().build()) + .setResourceUri("resourceUri1234527870") + .addAllEndpoints(new ArrayList()) + .addAllApiVersions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setSlo(AttributeValues.newBuilder().build()) + .setEnvironment(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + mockApiHub.addResponse(expectedResponse); + + DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]"); + + Deployment actualResponse = client.getDeployment(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetDeploymentRequest actualRequest = ((GetDeploymentRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getDeploymentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]"); + client.getDeployment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDeploymentTest2() throws Exception { + Deployment expectedResponse = + Deployment.newBuilder() + .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .setDeploymentType(AttributeValues.newBuilder().build()) + .setResourceUri("resourceUri1234527870") + .addAllEndpoints(new ArrayList()) + .addAllApiVersions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setSlo(AttributeValues.newBuilder().build()) + .setEnvironment(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + mockApiHub.addResponse(expectedResponse); + + String name = "name3373707"; + + Deployment actualResponse = client.getDeployment(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetDeploymentRequest actualRequest = ((GetDeploymentRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getDeploymentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String name = "name3373707"; + client.getDeployment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDeploymentsTest() throws Exception { + Deployment responsesElement = Deployment.newBuilder().build(); + ListDeploymentsResponse expectedResponse = + ListDeploymentsResponse.newBuilder() + .setNextPageToken("") + .addAllDeployments(Arrays.asList(responsesElement)) + .build(); + mockApiHub.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListDeploymentsPagedResponse pagedListResponse = client.listDeployments(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDeploymentsList().get(0), resources.get(0)); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListDeploymentsRequest actualRequest = ((ListDeploymentsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listDeploymentsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listDeployments(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDeploymentsTest2() throws Exception { + Deployment responsesElement = Deployment.newBuilder().build(); + ListDeploymentsResponse expectedResponse = + ListDeploymentsResponse.newBuilder() + .setNextPageToken("") + .addAllDeployments(Arrays.asList(responsesElement)) + .build(); + mockApiHub.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListDeploymentsPagedResponse pagedListResponse = client.listDeployments(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDeploymentsList().get(0), resources.get(0)); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListDeploymentsRequest actualRequest = ((ListDeploymentsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listDeploymentsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String parent = "parent-995424086"; + client.listDeployments(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateDeploymentTest() throws Exception { + Deployment expectedResponse = + Deployment.newBuilder() + .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setDocumentation(Documentation.newBuilder().build()) + .setDeploymentType(AttributeValues.newBuilder().build()) + .setResourceUri("resourceUri1234527870") + .addAllEndpoints(new ArrayList()) + .addAllApiVersions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setSlo(AttributeValues.newBuilder().build()) + .setEnvironment(AttributeValues.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + mockApiHub.addResponse(expectedResponse); + + Deployment deployment = Deployment.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Deployment actualResponse = client.updateDeployment(deployment, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateDeploymentRequest actualRequest = ((UpdateDeploymentRequest) actualRequests.get(0)); + + Assert.assertEquals(deployment, actualRequest.getDeployment()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateDeploymentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + Deployment deployment = Deployment.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateDeployment(deployment, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDeploymentTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockApiHub.addResponse(expectedResponse); + + DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]"); + + client.deleteDeployment(name); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteDeploymentRequest actualRequest = ((DeleteDeploymentRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteDeploymentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]"); + client.deleteDeployment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDeploymentTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockApiHub.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteDeployment(name); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteDeploymentRequest actualRequest = ((DeleteDeploymentRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteDeploymentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String name = "name3373707"; + client.deleteDeployment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createAttributeTest() throws Exception { + Attribute expectedResponse = + Attribute.newBuilder() + .setName(AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllAllowedValues(new ArrayList()) + .setCardinality(845213070) + .setMandatory(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockApiHub.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Attribute attribute = Attribute.newBuilder().build(); + String attributeId = "attributeId-309887785"; + + Attribute actualResponse = client.createAttribute(parent, attribute, attributeId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateAttributeRequest actualRequest = ((CreateAttributeRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(attribute, actualRequest.getAttribute()); + Assert.assertEquals(attributeId, actualRequest.getAttributeId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createAttributeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Attribute attribute = Attribute.newBuilder().build(); + String attributeId = "attributeId-309887785"; + client.createAttribute(parent, attribute, attributeId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createAttributeTest2() throws Exception { + Attribute expectedResponse = + Attribute.newBuilder() + .setName(AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllAllowedValues(new ArrayList()) + .setCardinality(845213070) + .setMandatory(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockApiHub.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Attribute attribute = Attribute.newBuilder().build(); + String attributeId = "attributeId-309887785"; + + Attribute actualResponse = client.createAttribute(parent, attribute, attributeId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateAttributeRequest actualRequest = ((CreateAttributeRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(attribute, actualRequest.getAttribute()); + Assert.assertEquals(attributeId, actualRequest.getAttributeId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createAttributeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String parent = "parent-995424086"; + Attribute attribute = Attribute.newBuilder().build(); + String attributeId = "attributeId-309887785"; + client.createAttribute(parent, attribute, attributeId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAttributeTest() throws Exception { + Attribute expectedResponse = + Attribute.newBuilder() + .setName(AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllAllowedValues(new ArrayList()) + .setCardinality(845213070) + .setMandatory(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockApiHub.addResponse(expectedResponse); + + AttributeName name = AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]"); + + Attribute actualResponse = client.getAttribute(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAttributeRequest actualRequest = ((GetAttributeRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAttributeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + AttributeName name = AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]"); + client.getAttribute(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAttributeTest2() throws Exception { + Attribute expectedResponse = + Attribute.newBuilder() + .setName(AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllAllowedValues(new ArrayList()) + .setCardinality(845213070) + .setMandatory(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockApiHub.addResponse(expectedResponse); + + String name = "name3373707"; + + Attribute actualResponse = client.getAttribute(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAttributeRequest actualRequest = ((GetAttributeRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAttributeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String name = "name3373707"; + client.getAttribute(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateAttributeTest() throws Exception { + Attribute expectedResponse = + Attribute.newBuilder() + .setName(AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllAllowedValues(new ArrayList()) + .setCardinality(845213070) + .setMandatory(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockApiHub.addResponse(expectedResponse); + + Attribute attribute = Attribute.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Attribute actualResponse = client.updateAttribute(attribute, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateAttributeRequest actualRequest = ((UpdateAttributeRequest) actualRequests.get(0)); + + Assert.assertEquals(attribute, actualRequest.getAttribute()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateAttributeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + Attribute attribute = Attribute.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateAttribute(attribute, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteAttributeTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockApiHub.addResponse(expectedResponse); + + AttributeName name = AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]"); + + client.deleteAttribute(name); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteAttributeRequest actualRequest = ((DeleteAttributeRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteAttributeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + AttributeName name = AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]"); + client.deleteAttribute(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteAttributeTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockApiHub.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteAttribute(name); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteAttributeRequest actualRequest = ((DeleteAttributeRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteAttributeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String name = "name3373707"; + client.deleteAttribute(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAttributesTest() throws Exception { + Attribute responsesElement = Attribute.newBuilder().build(); + ListAttributesResponse expectedResponse = + ListAttributesResponse.newBuilder() + .setNextPageToken("") + .addAllAttributes(Arrays.asList(responsesElement)) + .build(); + mockApiHub.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListAttributesPagedResponse pagedListResponse = client.listAttributes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAttributesList().get(0), resources.get(0)); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAttributesRequest actualRequest = ((ListAttributesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAttributesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listAttributes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAttributesTest2() throws Exception { + Attribute responsesElement = Attribute.newBuilder().build(); + ListAttributesResponse expectedResponse = + ListAttributesResponse.newBuilder() + .setNextPageToken("") + .addAllAttributes(Arrays.asList(responsesElement)) + .build(); + mockApiHub.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListAttributesPagedResponse pagedListResponse = client.listAttributes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAttributesList().get(0), resources.get(0)); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAttributesRequest actualRequest = ((ListAttributesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAttributesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String parent = "parent-995424086"; + client.listAttributes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchResourcesTest() throws Exception { + SearchResult responsesElement = SearchResult.newBuilder().build(); + SearchResourcesResponse expectedResponse = + SearchResourcesResponse.newBuilder() + .setNextPageToken("") + .addAllSearchResults(Arrays.asList(responsesElement)) + .build(); + mockApiHub.addResponse(expectedResponse); + + LocationName location = LocationName.of("[PROJECT]", "[LOCATION]"); + String query = "query107944136"; + + SearchResourcesPagedResponse pagedListResponse = client.searchResources(location, query); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSearchResultsList().get(0), resources.get(0)); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchResourcesRequest actualRequest = ((SearchResourcesRequest) actualRequests.get(0)); + + Assert.assertEquals(location.toString(), actualRequest.getLocation()); + Assert.assertEquals(query, actualRequest.getQuery()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchResourcesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + LocationName location = LocationName.of("[PROJECT]", "[LOCATION]"); + String query = "query107944136"; + client.searchResources(location, query); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchResourcesTest2() throws Exception { + SearchResult responsesElement = SearchResult.newBuilder().build(); + SearchResourcesResponse expectedResponse = + SearchResourcesResponse.newBuilder() + .setNextPageToken("") + .addAllSearchResults(Arrays.asList(responsesElement)) + .build(); + mockApiHub.addResponse(expectedResponse); + + String location = "location1901043637"; + String query = "query107944136"; + + SearchResourcesPagedResponse pagedListResponse = client.searchResources(location, query); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSearchResultsList().get(0), resources.get(0)); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchResourcesRequest actualRequest = ((SearchResourcesRequest) actualRequests.get(0)); + + Assert.assertEquals(location, actualRequest.getLocation()); + Assert.assertEquals(query, actualRequest.getQuery()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchResourcesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String location = "location1901043637"; + String query = "query107944136"; + client.searchResources(location, query); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createExternalApiTest() throws Exception { + ExternalApi expectedResponse = + ExternalApi.newBuilder() + .setName(ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllEndpoints(new ArrayList()) + .addAllPaths(new ArrayList()) + .setDocumentation(Documentation.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockApiHub.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ExternalApi externalApi = ExternalApi.newBuilder().build(); + String externalApiId = "externalApiId-31672374"; + + ExternalApi actualResponse = client.createExternalApi(parent, externalApi, externalApiId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateExternalApiRequest actualRequest = ((CreateExternalApiRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(externalApi, actualRequest.getExternalApi()); + Assert.assertEquals(externalApiId, actualRequest.getExternalApiId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createExternalApiExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ExternalApi externalApi = ExternalApi.newBuilder().build(); + String externalApiId = "externalApiId-31672374"; + client.createExternalApi(parent, externalApi, externalApiId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createExternalApiTest2() throws Exception { + ExternalApi expectedResponse = + ExternalApi.newBuilder() + .setName(ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllEndpoints(new ArrayList()) + .addAllPaths(new ArrayList()) + .setDocumentation(Documentation.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockApiHub.addResponse(expectedResponse); + + String parent = "parent-995424086"; + ExternalApi externalApi = ExternalApi.newBuilder().build(); + String externalApiId = "externalApiId-31672374"; + + ExternalApi actualResponse = client.createExternalApi(parent, externalApi, externalApiId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateExternalApiRequest actualRequest = ((CreateExternalApiRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(externalApi, actualRequest.getExternalApi()); + Assert.assertEquals(externalApiId, actualRequest.getExternalApiId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createExternalApiExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String parent = "parent-995424086"; + ExternalApi externalApi = ExternalApi.newBuilder().build(); + String externalApiId = "externalApiId-31672374"; + client.createExternalApi(parent, externalApi, externalApiId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getExternalApiTest() throws Exception { + ExternalApi expectedResponse = + ExternalApi.newBuilder() + .setName(ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllEndpoints(new ArrayList()) + .addAllPaths(new ArrayList()) + .setDocumentation(Documentation.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockApiHub.addResponse(expectedResponse); + + ExternalApiName name = ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]"); + + ExternalApi actualResponse = client.getExternalApi(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetExternalApiRequest actualRequest = ((GetExternalApiRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getExternalApiExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + ExternalApiName name = ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]"); + client.getExternalApi(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getExternalApiTest2() throws Exception { + ExternalApi expectedResponse = + ExternalApi.newBuilder() + .setName(ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllEndpoints(new ArrayList()) + .addAllPaths(new ArrayList()) + .setDocumentation(Documentation.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockApiHub.addResponse(expectedResponse); + + String name = "name3373707"; + + ExternalApi actualResponse = client.getExternalApi(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetExternalApiRequest actualRequest = ((GetExternalApiRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getExternalApiExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String name = "name3373707"; + client.getExternalApi(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateExternalApiTest() throws Exception { + ExternalApi expectedResponse = + ExternalApi.newBuilder() + .setName(ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllEndpoints(new ArrayList()) + .addAllPaths(new ArrayList()) + .setDocumentation(Documentation.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockApiHub.addResponse(expectedResponse); + + ExternalApi externalApi = ExternalApi.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + ExternalApi actualResponse = client.updateExternalApi(externalApi, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateExternalApiRequest actualRequest = ((UpdateExternalApiRequest) actualRequests.get(0)); + + Assert.assertEquals(externalApi, actualRequest.getExternalApi()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateExternalApiExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + ExternalApi externalApi = ExternalApi.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateExternalApi(externalApi, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteExternalApiTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockApiHub.addResponse(expectedResponse); + + ExternalApiName name = ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]"); + + client.deleteExternalApi(name); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteExternalApiRequest actualRequest = ((DeleteExternalApiRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteExternalApiExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + ExternalApiName name = ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]"); + client.deleteExternalApi(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteExternalApiTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockApiHub.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteExternalApi(name); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteExternalApiRequest actualRequest = ((DeleteExternalApiRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteExternalApiExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String name = "name3373707"; + client.deleteExternalApi(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listExternalApisTest() throws Exception { + ExternalApi responsesElement = ExternalApi.newBuilder().build(); + ListExternalApisResponse expectedResponse = + ListExternalApisResponse.newBuilder() + .setNextPageToken("") + .addAllExternalApis(Arrays.asList(responsesElement)) + .build(); + mockApiHub.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListExternalApisPagedResponse pagedListResponse = client.listExternalApis(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getExternalApisList().get(0), resources.get(0)); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListExternalApisRequest actualRequest = ((ListExternalApisRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listExternalApisExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listExternalApis(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listExternalApisTest2() throws Exception { + ExternalApi responsesElement = ExternalApi.newBuilder().build(); + ListExternalApisResponse expectedResponse = + ListExternalApisResponse.newBuilder() + .setNextPageToken("") + .addAllExternalApis(Arrays.asList(responsesElement)) + .build(); + mockApiHub.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListExternalApisPagedResponse pagedListResponse = client.listExternalApis(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getExternalApisList().get(0), resources.get(0)); + + List actualRequests = mockApiHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListExternalApisRequest actualRequest = ((ListExternalApisRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listExternalApisExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHub.addException(exception); + + try { + String parent = "parent-995424086"; + client.listExternalApis(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ApiHubDependenciesClientHttpJsonTest.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ApiHubDependenciesClientHttpJsonTest.java new file mode 100644 index 000000000000..78a72bc4ca88 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ApiHubDependenciesClientHttpJsonTest.java @@ -0,0 +1,668 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import static com.google.cloud.apihub.v1.ApiHubDependenciesClient.ListDependenciesPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubDependenciesClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.apihub.v1.stub.HttpJsonApiHubDependenciesStub; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +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 ApiHubDependenciesClientHttpJsonTest { + private static MockHttpService mockService; + private static ApiHubDependenciesClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonApiHubDependenciesStub.getMethodDescriptors(), + ApiHubDependenciesSettings.getDefaultEndpoint()); + ApiHubDependenciesSettings settings = + ApiHubDependenciesSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + ApiHubDependenciesSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ApiHubDependenciesClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createDependencyTest() throws Exception { + Dependency expectedResponse = + Dependency.newBuilder() + .setName(DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString()) + .setConsumer(DependencyEntityReference.newBuilder().build()) + .setSupplier(DependencyEntityReference.newBuilder().build()) + .setDescription("description-1724546052") + .setErrorDetail(DependencyErrorDetail.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Dependency dependency = Dependency.newBuilder().build(); + String dependencyId = "dependencyId503788998"; + + Dependency actualResponse = client.createDependency(parent, dependency, dependencyId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createDependencyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Dependency dependency = Dependency.newBuilder().build(); + String dependencyId = "dependencyId503788998"; + client.createDependency(parent, dependency, dependencyId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createDependencyTest2() throws Exception { + Dependency expectedResponse = + Dependency.newBuilder() + .setName(DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString()) + .setConsumer(DependencyEntityReference.newBuilder().build()) + .setSupplier(DependencyEntityReference.newBuilder().build()) + .setDescription("description-1724546052") + .setErrorDetail(DependencyErrorDetail.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + Dependency dependency = Dependency.newBuilder().build(); + String dependencyId = "dependencyId503788998"; + + Dependency actualResponse = client.createDependency(parent, dependency, dependencyId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createDependencyExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + Dependency dependency = Dependency.newBuilder().build(); + String dependencyId = "dependencyId503788998"; + client.createDependency(parent, dependency, dependencyId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDependencyTest() throws Exception { + Dependency expectedResponse = + Dependency.newBuilder() + .setName(DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString()) + .setConsumer(DependencyEntityReference.newBuilder().build()) + .setSupplier(DependencyEntityReference.newBuilder().build()) + .setDescription("description-1724546052") + .setErrorDetail(DependencyErrorDetail.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + mockService.addResponse(expectedResponse); + + DependencyName name = DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]"); + + Dependency actualResponse = client.getDependency(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getDependencyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DependencyName name = DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]"); + client.getDependency(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDependencyTest2() throws Exception { + Dependency expectedResponse = + Dependency.newBuilder() + .setName(DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString()) + .setConsumer(DependencyEntityReference.newBuilder().build()) + .setSupplier(DependencyEntityReference.newBuilder().build()) + .setDescription("description-1724546052") + .setErrorDetail(DependencyErrorDetail.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-6073/locations/location-6073/dependencies/dependencie-6073"; + + Dependency actualResponse = client.getDependency(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getDependencyExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-6073/locations/location-6073/dependencies/dependencie-6073"; + client.getDependency(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateDependencyTest() throws Exception { + Dependency expectedResponse = + Dependency.newBuilder() + .setName(DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString()) + .setConsumer(DependencyEntityReference.newBuilder().build()) + .setSupplier(DependencyEntityReference.newBuilder().build()) + .setDescription("description-1724546052") + .setErrorDetail(DependencyErrorDetail.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + mockService.addResponse(expectedResponse); + + Dependency dependency = + Dependency.newBuilder() + .setName(DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString()) + .setConsumer(DependencyEntityReference.newBuilder().build()) + .setSupplier(DependencyEntityReference.newBuilder().build()) + .setDescription("description-1724546052") + .setErrorDetail(DependencyErrorDetail.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Dependency actualResponse = client.updateDependency(dependency, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateDependencyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Dependency dependency = + Dependency.newBuilder() + .setName(DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString()) + .setConsumer(DependencyEntityReference.newBuilder().build()) + .setSupplier(DependencyEntityReference.newBuilder().build()) + .setDescription("description-1724546052") + .setErrorDetail(DependencyErrorDetail.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateDependency(dependency, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDependencyTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + DependencyName name = DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]"); + + client.deleteDependency(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteDependencyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DependencyName name = DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]"); + client.deleteDependency(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDependencyTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-6073/locations/location-6073/dependencies/dependencie-6073"; + + client.deleteDependency(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteDependencyExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-6073/locations/location-6073/dependencies/dependencie-6073"; + client.deleteDependency(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDependenciesTest() throws Exception { + Dependency responsesElement = Dependency.newBuilder().build(); + ListDependenciesResponse expectedResponse = + ListDependenciesResponse.newBuilder() + .setNextPageToken("") + .addAllDependencies(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListDependenciesPagedResponse pagedListResponse = client.listDependencies(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDependenciesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listDependenciesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listDependencies(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDependenciesTest2() throws Exception { + Dependency responsesElement = Dependency.newBuilder().build(); + ListDependenciesResponse expectedResponse = + ListDependenciesResponse.newBuilder() + .setNextPageToken("") + .addAllDependencies(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListDependenciesPagedResponse pagedListResponse = client.listDependencies(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDependenciesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listDependenciesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listDependencies(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ApiHubDependenciesClientTest.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ApiHubDependenciesClientTest.java new file mode 100644 index 000000000000..15ee2c4dedbd --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ApiHubDependenciesClientTest.java @@ -0,0 +1,590 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import static com.google.cloud.apihub.v1.ApiHubDependenciesClient.ListDependenciesPagedResponse; +import static com.google.cloud.apihub.v1.ApiHubDependenciesClient.ListLocationsPagedResponse; + +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +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 ApiHubDependenciesClientTest { + private static MockApiHubDependencies mockApiHubDependencies; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private ApiHubDependenciesClient client; + + @BeforeClass + public static void startStaticServer() { + mockApiHubDependencies = new MockApiHubDependencies(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockApiHubDependencies, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + ApiHubDependenciesSettings settings = + ApiHubDependenciesSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ApiHubDependenciesClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createDependencyTest() throws Exception { + Dependency expectedResponse = + Dependency.newBuilder() + .setName(DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString()) + .setConsumer(DependencyEntityReference.newBuilder().build()) + .setSupplier(DependencyEntityReference.newBuilder().build()) + .setDescription("description-1724546052") + .setErrorDetail(DependencyErrorDetail.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + mockApiHubDependencies.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Dependency dependency = Dependency.newBuilder().build(); + String dependencyId = "dependencyId503788998"; + + Dependency actualResponse = client.createDependency(parent, dependency, dependencyId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHubDependencies.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateDependencyRequest actualRequest = ((CreateDependencyRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(dependency, actualRequest.getDependency()); + Assert.assertEquals(dependencyId, actualRequest.getDependencyId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createDependencyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHubDependencies.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Dependency dependency = Dependency.newBuilder().build(); + String dependencyId = "dependencyId503788998"; + client.createDependency(parent, dependency, dependencyId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createDependencyTest2() throws Exception { + Dependency expectedResponse = + Dependency.newBuilder() + .setName(DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString()) + .setConsumer(DependencyEntityReference.newBuilder().build()) + .setSupplier(DependencyEntityReference.newBuilder().build()) + .setDescription("description-1724546052") + .setErrorDetail(DependencyErrorDetail.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + mockApiHubDependencies.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Dependency dependency = Dependency.newBuilder().build(); + String dependencyId = "dependencyId503788998"; + + Dependency actualResponse = client.createDependency(parent, dependency, dependencyId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHubDependencies.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateDependencyRequest actualRequest = ((CreateDependencyRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(dependency, actualRequest.getDependency()); + Assert.assertEquals(dependencyId, actualRequest.getDependencyId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createDependencyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHubDependencies.addException(exception); + + try { + String parent = "parent-995424086"; + Dependency dependency = Dependency.newBuilder().build(); + String dependencyId = "dependencyId503788998"; + client.createDependency(parent, dependency, dependencyId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDependencyTest() throws Exception { + Dependency expectedResponse = + Dependency.newBuilder() + .setName(DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString()) + .setConsumer(DependencyEntityReference.newBuilder().build()) + .setSupplier(DependencyEntityReference.newBuilder().build()) + .setDescription("description-1724546052") + .setErrorDetail(DependencyErrorDetail.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + mockApiHubDependencies.addResponse(expectedResponse); + + DependencyName name = DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]"); + + Dependency actualResponse = client.getDependency(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHubDependencies.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetDependencyRequest actualRequest = ((GetDependencyRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getDependencyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHubDependencies.addException(exception); + + try { + DependencyName name = DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]"); + client.getDependency(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDependencyTest2() throws Exception { + Dependency expectedResponse = + Dependency.newBuilder() + .setName(DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString()) + .setConsumer(DependencyEntityReference.newBuilder().build()) + .setSupplier(DependencyEntityReference.newBuilder().build()) + .setDescription("description-1724546052") + .setErrorDetail(DependencyErrorDetail.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + mockApiHubDependencies.addResponse(expectedResponse); + + String name = "name3373707"; + + Dependency actualResponse = client.getDependency(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHubDependencies.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetDependencyRequest actualRequest = ((GetDependencyRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getDependencyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHubDependencies.addException(exception); + + try { + String name = "name3373707"; + client.getDependency(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateDependencyTest() throws Exception { + Dependency expectedResponse = + Dependency.newBuilder() + .setName(DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString()) + .setConsumer(DependencyEntityReference.newBuilder().build()) + .setSupplier(DependencyEntityReference.newBuilder().build()) + .setDescription("description-1724546052") + .setErrorDetail(DependencyErrorDetail.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllAttributes(new HashMap()) + .build(); + mockApiHubDependencies.addResponse(expectedResponse); + + Dependency dependency = Dependency.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Dependency actualResponse = client.updateDependency(dependency, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHubDependencies.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateDependencyRequest actualRequest = ((UpdateDependencyRequest) actualRequests.get(0)); + + Assert.assertEquals(dependency, actualRequest.getDependency()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateDependencyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHubDependencies.addException(exception); + + try { + Dependency dependency = Dependency.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateDependency(dependency, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDependencyTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockApiHubDependencies.addResponse(expectedResponse); + + DependencyName name = DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]"); + + client.deleteDependency(name); + + List actualRequests = mockApiHubDependencies.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteDependencyRequest actualRequest = ((DeleteDependencyRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteDependencyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHubDependencies.addException(exception); + + try { + DependencyName name = DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]"); + client.deleteDependency(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDependencyTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockApiHubDependencies.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteDependency(name); + + List actualRequests = mockApiHubDependencies.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteDependencyRequest actualRequest = ((DeleteDependencyRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteDependencyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHubDependencies.addException(exception); + + try { + String name = "name3373707"; + client.deleteDependency(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDependenciesTest() throws Exception { + Dependency responsesElement = Dependency.newBuilder().build(); + ListDependenciesResponse expectedResponse = + ListDependenciesResponse.newBuilder() + .setNextPageToken("") + .addAllDependencies(Arrays.asList(responsesElement)) + .build(); + mockApiHubDependencies.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListDependenciesPagedResponse pagedListResponse = client.listDependencies(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDependenciesList().get(0), resources.get(0)); + + List actualRequests = mockApiHubDependencies.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListDependenciesRequest actualRequest = ((ListDependenciesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listDependenciesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHubDependencies.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listDependencies(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDependenciesTest2() throws Exception { + Dependency responsesElement = Dependency.newBuilder().build(); + ListDependenciesResponse expectedResponse = + ListDependenciesResponse.newBuilder() + .setNextPageToken("") + .addAllDependencies(Arrays.asList(responsesElement)) + .build(); + mockApiHubDependencies.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListDependenciesPagedResponse pagedListResponse = client.listDependencies(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDependenciesList().get(0), resources.get(0)); + + List actualRequests = mockApiHubDependencies.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListDependenciesRequest actualRequest = ((ListDependenciesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listDependenciesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHubDependencies.addException(exception); + + try { + String parent = "parent-995424086"; + client.listDependencies(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ApiHubPluginClientHttpJsonTest.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ApiHubPluginClientHttpJsonTest.java new file mode 100644 index 000000000000..ab639e4096d7 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ApiHubPluginClientHttpJsonTest.java @@ -0,0 +1,481 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import static com.google.cloud.apihub.v1.ApiHubPluginClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.apihub.v1.stub.HttpJsonApiHubPluginStub; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.protobuf.Any; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +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 ApiHubPluginClientHttpJsonTest { + private static MockHttpService mockService; + private static ApiHubPluginClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonApiHubPluginStub.getMethodDescriptors(), + ApiHubPluginSettings.getDefaultEndpoint()); + ApiHubPluginSettings settings = + ApiHubPluginSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + ApiHubPluginSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ApiHubPluginClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void getPluginTest() throws Exception { + Plugin expectedResponse = + Plugin.newBuilder() + .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .setDisplayName("displayName1714148973") + .setType(AttributeValues.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + mockService.addResponse(expectedResponse); + + PluginName name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]"); + + Plugin actualResponse = client.getPlugin(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getPluginExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PluginName name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]"); + client.getPlugin(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPluginTest2() throws Exception { + Plugin expectedResponse = + Plugin.newBuilder() + .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .setDisplayName("displayName1714148973") + .setType(AttributeValues.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-1258/locations/location-1258/plugins/plugin-1258"; + + Plugin actualResponse = client.getPlugin(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getPluginExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-1258/locations/location-1258/plugins/plugin-1258"; + client.getPlugin(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void enablePluginTest() throws Exception { + Plugin expectedResponse = + Plugin.newBuilder() + .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .setDisplayName("displayName1714148973") + .setType(AttributeValues.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + mockService.addResponse(expectedResponse); + + PluginName name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]"); + + Plugin actualResponse = client.enablePlugin(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void enablePluginExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PluginName name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]"); + client.enablePlugin(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void enablePluginTest2() throws Exception { + Plugin expectedResponse = + Plugin.newBuilder() + .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .setDisplayName("displayName1714148973") + .setType(AttributeValues.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-1258/locations/location-1258/plugins/plugin-1258"; + + Plugin actualResponse = client.enablePlugin(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void enablePluginExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-1258/locations/location-1258/plugins/plugin-1258"; + client.enablePlugin(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void disablePluginTest() throws Exception { + Plugin expectedResponse = + Plugin.newBuilder() + .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .setDisplayName("displayName1714148973") + .setType(AttributeValues.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + mockService.addResponse(expectedResponse); + + PluginName name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]"); + + Plugin actualResponse = client.disablePlugin(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void disablePluginExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PluginName name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]"); + client.disablePlugin(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void disablePluginTest2() throws Exception { + Plugin expectedResponse = + Plugin.newBuilder() + .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .setDisplayName("displayName1714148973") + .setType(AttributeValues.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-1258/locations/location-1258/plugins/plugin-1258"; + + Plugin actualResponse = client.disablePlugin(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void disablePluginExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-1258/locations/location-1258/plugins/plugin-1258"; + client.disablePlugin(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ApiHubPluginClientTest.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ApiHubPluginClientTest.java new file mode 100644 index 000000000000..77d0024aa8d0 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ApiHubPluginClientTest.java @@ -0,0 +1,436 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import static com.google.cloud.apihub.v1.ApiHubPluginClient.ListLocationsPagedResponse; + +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +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 ApiHubPluginClientTest { + private static MockApiHubPlugin mockApiHubPlugin; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private ApiHubPluginClient client; + + @BeforeClass + public static void startStaticServer() { + mockApiHubPlugin = new MockApiHubPlugin(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockApiHubPlugin, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + ApiHubPluginSettings settings = + ApiHubPluginSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ApiHubPluginClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void getPluginTest() throws Exception { + Plugin expectedResponse = + Plugin.newBuilder() + .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .setDisplayName("displayName1714148973") + .setType(AttributeValues.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + mockApiHubPlugin.addResponse(expectedResponse); + + PluginName name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]"); + + Plugin actualResponse = client.getPlugin(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHubPlugin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetPluginRequest actualRequest = ((GetPluginRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getPluginExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHubPlugin.addException(exception); + + try { + PluginName name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]"); + client.getPlugin(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPluginTest2() throws Exception { + Plugin expectedResponse = + Plugin.newBuilder() + .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .setDisplayName("displayName1714148973") + .setType(AttributeValues.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + mockApiHubPlugin.addResponse(expectedResponse); + + String name = "name3373707"; + + Plugin actualResponse = client.getPlugin(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHubPlugin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetPluginRequest actualRequest = ((GetPluginRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getPluginExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHubPlugin.addException(exception); + + try { + String name = "name3373707"; + client.getPlugin(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void enablePluginTest() throws Exception { + Plugin expectedResponse = + Plugin.newBuilder() + .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .setDisplayName("displayName1714148973") + .setType(AttributeValues.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + mockApiHubPlugin.addResponse(expectedResponse); + + PluginName name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]"); + + Plugin actualResponse = client.enablePlugin(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHubPlugin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + EnablePluginRequest actualRequest = ((EnablePluginRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void enablePluginExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHubPlugin.addException(exception); + + try { + PluginName name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]"); + client.enablePlugin(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void enablePluginTest2() throws Exception { + Plugin expectedResponse = + Plugin.newBuilder() + .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .setDisplayName("displayName1714148973") + .setType(AttributeValues.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + mockApiHubPlugin.addResponse(expectedResponse); + + String name = "name3373707"; + + Plugin actualResponse = client.enablePlugin(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHubPlugin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + EnablePluginRequest actualRequest = ((EnablePluginRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void enablePluginExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHubPlugin.addException(exception); + + try { + String name = "name3373707"; + client.enablePlugin(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void disablePluginTest() throws Exception { + Plugin expectedResponse = + Plugin.newBuilder() + .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .setDisplayName("displayName1714148973") + .setType(AttributeValues.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + mockApiHubPlugin.addResponse(expectedResponse); + + PluginName name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]"); + + Plugin actualResponse = client.disablePlugin(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHubPlugin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DisablePluginRequest actualRequest = ((DisablePluginRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void disablePluginExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHubPlugin.addException(exception); + + try { + PluginName name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]"); + client.disablePlugin(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void disablePluginTest2() throws Exception { + Plugin expectedResponse = + Plugin.newBuilder() + .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .setDisplayName("displayName1714148973") + .setType(AttributeValues.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + mockApiHubPlugin.addResponse(expectedResponse); + + String name = "name3373707"; + + Plugin actualResponse = client.disablePlugin(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockApiHubPlugin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DisablePluginRequest actualRequest = ((DisablePluginRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void disablePluginExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockApiHubPlugin.addException(exception); + + try { + String name = "name3373707"; + client.disablePlugin(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/HostProjectRegistrationServiceClientHttpJsonTest.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/HostProjectRegistrationServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..818d9fec4ac6 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/HostProjectRegistrationServiceClientHttpJsonTest.java @@ -0,0 +1,521 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import static com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient.ListHostProjectRegistrationsPagedResponse; +import static com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.apihub.v1.stub.HttpJsonHostProjectRegistrationServiceStub; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.protobuf.Any; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +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 HostProjectRegistrationServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static HostProjectRegistrationServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonHostProjectRegistrationServiceStub.getMethodDescriptors(), + HostProjectRegistrationServiceSettings.getDefaultEndpoint()); + HostProjectRegistrationServiceSettings settings = + HostProjectRegistrationServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + HostProjectRegistrationServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = HostProjectRegistrationServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createHostProjectRegistrationTest() throws Exception { + HostProjectRegistration expectedResponse = + HostProjectRegistration.newBuilder() + .setName( + HostProjectRegistrationName.of( + "[PROJECT]", "[LOCATION]", "[HOST_PROJECT_REGISTRATION]") + .toString()) + .setGcpProject("gcpProject1666184549") + .setCreateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + HostProjectRegistration hostProjectRegistration = HostProjectRegistration.newBuilder().build(); + String hostProjectRegistrationId = "hostProjectRegistrationId1352651365"; + + HostProjectRegistration actualResponse = + client.createHostProjectRegistration( + parent, hostProjectRegistration, hostProjectRegistrationId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createHostProjectRegistrationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + HostProjectRegistration hostProjectRegistration = + HostProjectRegistration.newBuilder().build(); + String hostProjectRegistrationId = "hostProjectRegistrationId1352651365"; + client.createHostProjectRegistration( + parent, hostProjectRegistration, hostProjectRegistrationId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createHostProjectRegistrationTest2() throws Exception { + HostProjectRegistration expectedResponse = + HostProjectRegistration.newBuilder() + .setName( + HostProjectRegistrationName.of( + "[PROJECT]", "[LOCATION]", "[HOST_PROJECT_REGISTRATION]") + .toString()) + .setGcpProject("gcpProject1666184549") + .setCreateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + HostProjectRegistration hostProjectRegistration = HostProjectRegistration.newBuilder().build(); + String hostProjectRegistrationId = "hostProjectRegistrationId1352651365"; + + HostProjectRegistration actualResponse = + client.createHostProjectRegistration( + parent, hostProjectRegistration, hostProjectRegistrationId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createHostProjectRegistrationExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + HostProjectRegistration hostProjectRegistration = + HostProjectRegistration.newBuilder().build(); + String hostProjectRegistrationId = "hostProjectRegistrationId1352651365"; + client.createHostProjectRegistration( + parent, hostProjectRegistration, hostProjectRegistrationId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getHostProjectRegistrationTest() throws Exception { + HostProjectRegistration expectedResponse = + HostProjectRegistration.newBuilder() + .setName( + HostProjectRegistrationName.of( + "[PROJECT]", "[LOCATION]", "[HOST_PROJECT_REGISTRATION]") + .toString()) + .setGcpProject("gcpProject1666184549") + .setCreateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + HostProjectRegistrationName name = + HostProjectRegistrationName.of("[PROJECT]", "[LOCATION]", "[HOST_PROJECT_REGISTRATION]"); + + HostProjectRegistration actualResponse = client.getHostProjectRegistration(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getHostProjectRegistrationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + HostProjectRegistrationName name = + HostProjectRegistrationName.of("[PROJECT]", "[LOCATION]", "[HOST_PROJECT_REGISTRATION]"); + client.getHostProjectRegistration(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getHostProjectRegistrationTest2() throws Exception { + HostProjectRegistration expectedResponse = + HostProjectRegistration.newBuilder() + .setName( + HostProjectRegistrationName.of( + "[PROJECT]", "[LOCATION]", "[HOST_PROJECT_REGISTRATION]") + .toString()) + .setGcpProject("gcpProject1666184549") + .setCreateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-9303/locations/location-9303/hostProjectRegistrations/hostProjectRegistration-9303"; + + HostProjectRegistration actualResponse = client.getHostProjectRegistration(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getHostProjectRegistrationExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-9303/locations/location-9303/hostProjectRegistrations/hostProjectRegistration-9303"; + client.getHostProjectRegistration(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listHostProjectRegistrationsTest() throws Exception { + HostProjectRegistration responsesElement = HostProjectRegistration.newBuilder().build(); + ListHostProjectRegistrationsResponse expectedResponse = + ListHostProjectRegistrationsResponse.newBuilder() + .setNextPageToken("") + .addAllHostProjectRegistrations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListHostProjectRegistrationsPagedResponse pagedListResponse = + client.listHostProjectRegistrations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals( + expectedResponse.getHostProjectRegistrationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listHostProjectRegistrationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listHostProjectRegistrations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listHostProjectRegistrationsTest2() throws Exception { + HostProjectRegistration responsesElement = HostProjectRegistration.newBuilder().build(); + ListHostProjectRegistrationsResponse expectedResponse = + ListHostProjectRegistrationsResponse.newBuilder() + .setNextPageToken("") + .addAllHostProjectRegistrations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListHostProjectRegistrationsPagedResponse pagedListResponse = + client.listHostProjectRegistrations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals( + expectedResponse.getHostProjectRegistrationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listHostProjectRegistrationsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listHostProjectRegistrations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/HostProjectRegistrationServiceClientTest.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/HostProjectRegistrationServiceClientTest.java new file mode 100644 index 000000000000..3d98b18548c2 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/HostProjectRegistrationServiceClientTest.java @@ -0,0 +1,484 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import static com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient.ListHostProjectRegistrationsPagedResponse; +import static com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient.ListLocationsPagedResponse; + +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +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 HostProjectRegistrationServiceClientTest { + private static MockHostProjectRegistrationService mockHostProjectRegistrationService; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private HostProjectRegistrationServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockHostProjectRegistrationService = new MockHostProjectRegistrationService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockHostProjectRegistrationService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + HostProjectRegistrationServiceSettings settings = + HostProjectRegistrationServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = HostProjectRegistrationServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createHostProjectRegistrationTest() throws Exception { + HostProjectRegistration expectedResponse = + HostProjectRegistration.newBuilder() + .setName( + HostProjectRegistrationName.of( + "[PROJECT]", "[LOCATION]", "[HOST_PROJECT_REGISTRATION]") + .toString()) + .setGcpProject("gcpProject1666184549") + .setCreateTime(Timestamp.newBuilder().build()) + .build(); + mockHostProjectRegistrationService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + HostProjectRegistration hostProjectRegistration = HostProjectRegistration.newBuilder().build(); + String hostProjectRegistrationId = "hostProjectRegistrationId1352651365"; + + HostProjectRegistration actualResponse = + client.createHostProjectRegistration( + parent, hostProjectRegistration, hostProjectRegistrationId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockHostProjectRegistrationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateHostProjectRegistrationRequest actualRequest = + ((CreateHostProjectRegistrationRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(hostProjectRegistration, actualRequest.getHostProjectRegistration()); + Assert.assertEquals(hostProjectRegistrationId, actualRequest.getHostProjectRegistrationId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createHostProjectRegistrationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHostProjectRegistrationService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + HostProjectRegistration hostProjectRegistration = + HostProjectRegistration.newBuilder().build(); + String hostProjectRegistrationId = "hostProjectRegistrationId1352651365"; + client.createHostProjectRegistration( + parent, hostProjectRegistration, hostProjectRegistrationId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createHostProjectRegistrationTest2() throws Exception { + HostProjectRegistration expectedResponse = + HostProjectRegistration.newBuilder() + .setName( + HostProjectRegistrationName.of( + "[PROJECT]", "[LOCATION]", "[HOST_PROJECT_REGISTRATION]") + .toString()) + .setGcpProject("gcpProject1666184549") + .setCreateTime(Timestamp.newBuilder().build()) + .build(); + mockHostProjectRegistrationService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + HostProjectRegistration hostProjectRegistration = HostProjectRegistration.newBuilder().build(); + String hostProjectRegistrationId = "hostProjectRegistrationId1352651365"; + + HostProjectRegistration actualResponse = + client.createHostProjectRegistration( + parent, hostProjectRegistration, hostProjectRegistrationId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockHostProjectRegistrationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateHostProjectRegistrationRequest actualRequest = + ((CreateHostProjectRegistrationRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(hostProjectRegistration, actualRequest.getHostProjectRegistration()); + Assert.assertEquals(hostProjectRegistrationId, actualRequest.getHostProjectRegistrationId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createHostProjectRegistrationExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHostProjectRegistrationService.addException(exception); + + try { + String parent = "parent-995424086"; + HostProjectRegistration hostProjectRegistration = + HostProjectRegistration.newBuilder().build(); + String hostProjectRegistrationId = "hostProjectRegistrationId1352651365"; + client.createHostProjectRegistration( + parent, hostProjectRegistration, hostProjectRegistrationId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getHostProjectRegistrationTest() throws Exception { + HostProjectRegistration expectedResponse = + HostProjectRegistration.newBuilder() + .setName( + HostProjectRegistrationName.of( + "[PROJECT]", "[LOCATION]", "[HOST_PROJECT_REGISTRATION]") + .toString()) + .setGcpProject("gcpProject1666184549") + .setCreateTime(Timestamp.newBuilder().build()) + .build(); + mockHostProjectRegistrationService.addResponse(expectedResponse); + + HostProjectRegistrationName name = + HostProjectRegistrationName.of("[PROJECT]", "[LOCATION]", "[HOST_PROJECT_REGISTRATION]"); + + HostProjectRegistration actualResponse = client.getHostProjectRegistration(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockHostProjectRegistrationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetHostProjectRegistrationRequest actualRequest = + ((GetHostProjectRegistrationRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getHostProjectRegistrationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHostProjectRegistrationService.addException(exception); + + try { + HostProjectRegistrationName name = + HostProjectRegistrationName.of("[PROJECT]", "[LOCATION]", "[HOST_PROJECT_REGISTRATION]"); + client.getHostProjectRegistration(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getHostProjectRegistrationTest2() throws Exception { + HostProjectRegistration expectedResponse = + HostProjectRegistration.newBuilder() + .setName( + HostProjectRegistrationName.of( + "[PROJECT]", "[LOCATION]", "[HOST_PROJECT_REGISTRATION]") + .toString()) + .setGcpProject("gcpProject1666184549") + .setCreateTime(Timestamp.newBuilder().build()) + .build(); + mockHostProjectRegistrationService.addResponse(expectedResponse); + + String name = "name3373707"; + + HostProjectRegistration actualResponse = client.getHostProjectRegistration(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockHostProjectRegistrationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetHostProjectRegistrationRequest actualRequest = + ((GetHostProjectRegistrationRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getHostProjectRegistrationExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHostProjectRegistrationService.addException(exception); + + try { + String name = "name3373707"; + client.getHostProjectRegistration(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listHostProjectRegistrationsTest() throws Exception { + HostProjectRegistration responsesElement = HostProjectRegistration.newBuilder().build(); + ListHostProjectRegistrationsResponse expectedResponse = + ListHostProjectRegistrationsResponse.newBuilder() + .setNextPageToken("") + .addAllHostProjectRegistrations(Arrays.asList(responsesElement)) + .build(); + mockHostProjectRegistrationService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListHostProjectRegistrationsPagedResponse pagedListResponse = + client.listHostProjectRegistrations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals( + expectedResponse.getHostProjectRegistrationsList().get(0), resources.get(0)); + + List actualRequests = mockHostProjectRegistrationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListHostProjectRegistrationsRequest actualRequest = + ((ListHostProjectRegistrationsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listHostProjectRegistrationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHostProjectRegistrationService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listHostProjectRegistrations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listHostProjectRegistrationsTest2() throws Exception { + HostProjectRegistration responsesElement = HostProjectRegistration.newBuilder().build(); + ListHostProjectRegistrationsResponse expectedResponse = + ListHostProjectRegistrationsResponse.newBuilder() + .setNextPageToken("") + .addAllHostProjectRegistrations(Arrays.asList(responsesElement)) + .build(); + mockHostProjectRegistrationService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListHostProjectRegistrationsPagedResponse pagedListResponse = + client.listHostProjectRegistrations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals( + expectedResponse.getHostProjectRegistrationsList().get(0), resources.get(0)); + + List actualRequests = mockHostProjectRegistrationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListHostProjectRegistrationsRequest actualRequest = + ((ListHostProjectRegistrationsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listHostProjectRegistrationsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHostProjectRegistrationService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listHostProjectRegistrations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/LintingServiceClientHttpJsonTest.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/LintingServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..c95ff4240476 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/LintingServiceClientHttpJsonTest.java @@ -0,0 +1,490 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import static com.google.cloud.apihub.v1.LintingServiceClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.apihub.v1.stub.HttpJsonLintingServiceStub; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +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 LintingServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static LintingServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonLintingServiceStub.getMethodDescriptors(), + LintingServiceSettings.getDefaultEndpoint()); + LintingServiceSettings settings = + LintingServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + LintingServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = LintingServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void getStyleGuideTest() throws Exception { + StyleGuide expectedResponse = + StyleGuide.newBuilder() + .setName(StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .setLinter(Linter.forNumber(0)) + .setContents(StyleGuideContents.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + StyleGuideName name = StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]"); + + StyleGuide actualResponse = client.getStyleGuide(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getStyleGuideExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + StyleGuideName name = StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]"); + client.getStyleGuide(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getStyleGuideTest2() throws Exception { + StyleGuide expectedResponse = + StyleGuide.newBuilder() + .setName(StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .setLinter(Linter.forNumber(0)) + .setContents(StyleGuideContents.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-6948/locations/location-6948/plugins/plugin-6948/styleGuide"; + + StyleGuide actualResponse = client.getStyleGuide(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getStyleGuideExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-6948/locations/location-6948/plugins/plugin-6948/styleGuide"; + client.getStyleGuide(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateStyleGuideTest() throws Exception { + StyleGuide expectedResponse = + StyleGuide.newBuilder() + .setName(StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .setLinter(Linter.forNumber(0)) + .setContents(StyleGuideContents.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + StyleGuide styleGuide = + StyleGuide.newBuilder() + .setName(StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .setLinter(Linter.forNumber(0)) + .setContents(StyleGuideContents.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + StyleGuide actualResponse = client.updateStyleGuide(styleGuide, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateStyleGuideExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + StyleGuide styleGuide = + StyleGuide.newBuilder() + .setName(StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .setLinter(Linter.forNumber(0)) + .setContents(StyleGuideContents.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateStyleGuide(styleGuide, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getStyleGuideContentsTest() throws Exception { + StyleGuideContents expectedResponse = + StyleGuideContents.newBuilder() + .setContents(ByteString.EMPTY) + .setMimeType("mimeType-1392120434") + .build(); + mockService.addResponse(expectedResponse); + + StyleGuideName name = StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]"); + + StyleGuideContents actualResponse = client.getStyleGuideContents(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getStyleGuideContentsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + StyleGuideName name = StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]"); + client.getStyleGuideContents(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getStyleGuideContentsTest2() throws Exception { + StyleGuideContents expectedResponse = + StyleGuideContents.newBuilder() + .setContents(ByteString.EMPTY) + .setMimeType("mimeType-1392120434") + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-6948/locations/location-6948/plugins/plugin-6948/styleGuide"; + + StyleGuideContents actualResponse = client.getStyleGuideContents(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getStyleGuideContentsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-6948/locations/location-6948/plugins/plugin-6948/styleGuide"; + client.getStyleGuideContents(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void lintSpecTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + LintSpecRequest request = + LintSpecRequest.newBuilder() + .setName( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .build(); + + client.lintSpec(request); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void lintSpecExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LintSpecRequest request = + LintSpecRequest.newBuilder() + .setName( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .build(); + client.lintSpec(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/LintingServiceClientTest.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/LintingServiceClientTest.java new file mode 100644 index 000000000000..2e498e62e419 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/LintingServiceClientTest.java @@ -0,0 +1,438 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import static com.google.cloud.apihub.v1.LintingServiceClient.ListLocationsPagedResponse; + +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +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 LintingServiceClientTest { + private static MockLintingService mockLintingService; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private LintingServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockLintingService = new MockLintingService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockLintingService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + LintingServiceSettings settings = + LintingServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = LintingServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void getStyleGuideTest() throws Exception { + StyleGuide expectedResponse = + StyleGuide.newBuilder() + .setName(StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .setLinter(Linter.forNumber(0)) + .setContents(StyleGuideContents.newBuilder().build()) + .build(); + mockLintingService.addResponse(expectedResponse); + + StyleGuideName name = StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]"); + + StyleGuide actualResponse = client.getStyleGuide(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLintingService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetStyleGuideRequest actualRequest = ((GetStyleGuideRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getStyleGuideExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLintingService.addException(exception); + + try { + StyleGuideName name = StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]"); + client.getStyleGuide(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getStyleGuideTest2() throws Exception { + StyleGuide expectedResponse = + StyleGuide.newBuilder() + .setName(StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .setLinter(Linter.forNumber(0)) + .setContents(StyleGuideContents.newBuilder().build()) + .build(); + mockLintingService.addResponse(expectedResponse); + + String name = "name3373707"; + + StyleGuide actualResponse = client.getStyleGuide(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLintingService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetStyleGuideRequest actualRequest = ((GetStyleGuideRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getStyleGuideExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLintingService.addException(exception); + + try { + String name = "name3373707"; + client.getStyleGuide(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateStyleGuideTest() throws Exception { + StyleGuide expectedResponse = + StyleGuide.newBuilder() + .setName(StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .setLinter(Linter.forNumber(0)) + .setContents(StyleGuideContents.newBuilder().build()) + .build(); + mockLintingService.addResponse(expectedResponse); + + StyleGuide styleGuide = StyleGuide.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + StyleGuide actualResponse = client.updateStyleGuide(styleGuide, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLintingService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateStyleGuideRequest actualRequest = ((UpdateStyleGuideRequest) actualRequests.get(0)); + + Assert.assertEquals(styleGuide, actualRequest.getStyleGuide()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateStyleGuideExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLintingService.addException(exception); + + try { + StyleGuide styleGuide = StyleGuide.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateStyleGuide(styleGuide, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getStyleGuideContentsTest() throws Exception { + StyleGuideContents expectedResponse = + StyleGuideContents.newBuilder() + .setContents(ByteString.EMPTY) + .setMimeType("mimeType-1392120434") + .build(); + mockLintingService.addResponse(expectedResponse); + + StyleGuideName name = StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]"); + + StyleGuideContents actualResponse = client.getStyleGuideContents(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLintingService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetStyleGuideContentsRequest actualRequest = + ((GetStyleGuideContentsRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getStyleGuideContentsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLintingService.addException(exception); + + try { + StyleGuideName name = StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]"); + client.getStyleGuideContents(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getStyleGuideContentsTest2() throws Exception { + StyleGuideContents expectedResponse = + StyleGuideContents.newBuilder() + .setContents(ByteString.EMPTY) + .setMimeType("mimeType-1392120434") + .build(); + mockLintingService.addResponse(expectedResponse); + + String name = "name3373707"; + + StyleGuideContents actualResponse = client.getStyleGuideContents(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLintingService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetStyleGuideContentsRequest actualRequest = + ((GetStyleGuideContentsRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getStyleGuideContentsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLintingService.addException(exception); + + try { + String name = "name3373707"; + client.getStyleGuideContents(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void lintSpecTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockLintingService.addResponse(expectedResponse); + + LintSpecRequest request = + LintSpecRequest.newBuilder() + .setName( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .build(); + + client.lintSpec(request); + + List actualRequests = mockLintingService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + LintSpecRequest actualRequest = ((LintSpecRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void lintSpecExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLintingService.addException(exception); + + try { + LintSpecRequest request = + LintSpecRequest.newBuilder() + .setName( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .build(); + client.lintSpec(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockApiHub.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockApiHub.java new file mode 100644 index 000000000000..bdee46ac4dd6 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockApiHub.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +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 MockApiHub implements MockGrpcService { + private final MockApiHubImpl serviceImpl; + + public MockApiHub() { + serviceImpl = new MockApiHubImpl(); + } + + @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-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockApiHubDependencies.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockApiHubDependencies.java new file mode 100644 index 000000000000..a3afbd4b2a64 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockApiHubDependencies.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +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 MockApiHubDependencies implements MockGrpcService { + private final MockApiHubDependenciesImpl serviceImpl; + + public MockApiHubDependencies() { + serviceImpl = new MockApiHubDependenciesImpl(); + } + + @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-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockApiHubDependenciesImpl.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockApiHubDependenciesImpl.java new file mode 100644 index 000000000000..6a354e0bf444 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockApiHubDependenciesImpl.java @@ -0,0 +1,166 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.apihub.v1.ApiHubDependenciesGrpc.ApiHubDependenciesImplBase; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +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 MockApiHubDependenciesImpl extends ApiHubDependenciesImplBase { + private List requests; + private Queue responses; + + public MockApiHubDependenciesImpl() { + 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 createDependency( + CreateDependencyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Dependency) { + requests.add(request); + responseObserver.onNext(((Dependency) 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 CreateDependency, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Dependency.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getDependency( + GetDependencyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Dependency) { + requests.add(request); + responseObserver.onNext(((Dependency) 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 GetDependency, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Dependency.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateDependency( + UpdateDependencyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Dependency) { + requests.add(request); + responseObserver.onNext(((Dependency) 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 UpdateDependency, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Dependency.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteDependency( + DeleteDependencyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) 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 DeleteDependency, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listDependencies( + ListDependenciesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListDependenciesResponse) { + requests.add(request); + responseObserver.onNext(((ListDependenciesResponse) 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 ListDependencies, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListDependenciesResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockApiHubImpl.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockApiHubImpl.java new file mode 100644 index 000000000000..c5f4d79e7442 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockApiHubImpl.java @@ -0,0 +1,786 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.apihub.v1.ApiHubGrpc.ApiHubImplBase; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +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 MockApiHubImpl extends ApiHubImplBase { + private List requests; + private Queue responses; + + public MockApiHubImpl() { + 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 createApi(CreateApiRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Api) { + requests.add(request); + responseObserver.onNext(((Api) 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 CreateApi, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Api.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getApi(GetApiRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Api) { + requests.add(request); + responseObserver.onNext(((Api) 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 GetApi, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Api.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listApis(ListApisRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListApisResponse) { + requests.add(request); + responseObserver.onNext(((ListApisResponse) 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 ListApis, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListApisResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateApi(UpdateApiRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Api) { + requests.add(request); + responseObserver.onNext(((Api) 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 UpdateApi, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Api.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteApi(DeleteApiRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) 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 DeleteApi, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createVersion( + CreateVersionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Version) { + requests.add(request); + responseObserver.onNext(((Version) 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 CreateVersion, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Version.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getVersion(GetVersionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Version) { + requests.add(request); + responseObserver.onNext(((Version) 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 GetVersion, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Version.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listVersions( + ListVersionsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListVersionsResponse) { + requests.add(request); + responseObserver.onNext(((ListVersionsResponse) 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 ListVersions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListVersionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateVersion( + UpdateVersionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Version) { + requests.add(request); + responseObserver.onNext(((Version) 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 UpdateVersion, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Version.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteVersion(DeleteVersionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) 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 DeleteVersion, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createSpec(CreateSpecRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Spec) { + requests.add(request); + responseObserver.onNext(((Spec) 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 CreateSpec, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Spec.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getSpec(GetSpecRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Spec) { + requests.add(request); + responseObserver.onNext(((Spec) 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 GetSpec, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Spec.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getSpecContents( + GetSpecContentsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SpecContents) { + requests.add(request); + responseObserver.onNext(((SpecContents) 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 GetSpecContents, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SpecContents.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listSpecs( + ListSpecsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListSpecsResponse) { + requests.add(request); + responseObserver.onNext(((ListSpecsResponse) 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 ListSpecs, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListSpecsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateSpec(UpdateSpecRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Spec) { + requests.add(request); + responseObserver.onNext(((Spec) 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 UpdateSpec, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Spec.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteSpec(DeleteSpecRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) 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 DeleteSpec, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getApiOperation( + GetApiOperationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ApiOperation) { + requests.add(request); + responseObserver.onNext(((ApiOperation) 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 GetApiOperation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ApiOperation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listApiOperations( + ListApiOperationsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListApiOperationsResponse) { + requests.add(request); + responseObserver.onNext(((ListApiOperationsResponse) 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 ListApiOperations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListApiOperationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getDefinition( + GetDefinitionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Definition) { + requests.add(request); + responseObserver.onNext(((Definition) 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 GetDefinition, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Definition.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createDeployment( + CreateDeploymentRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Deployment) { + requests.add(request); + responseObserver.onNext(((Deployment) 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 CreateDeployment, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Deployment.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getDeployment( + GetDeploymentRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Deployment) { + requests.add(request); + responseObserver.onNext(((Deployment) 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 GetDeployment, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Deployment.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listDeployments( + ListDeploymentsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListDeploymentsResponse) { + requests.add(request); + responseObserver.onNext(((ListDeploymentsResponse) 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 ListDeployments, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListDeploymentsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateDeployment( + UpdateDeploymentRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Deployment) { + requests.add(request); + responseObserver.onNext(((Deployment) 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 UpdateDeployment, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Deployment.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteDeployment( + DeleteDeploymentRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) 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 DeleteDeployment, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createAttribute( + CreateAttributeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Attribute) { + requests.add(request); + responseObserver.onNext(((Attribute) 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 CreateAttribute, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Attribute.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getAttribute( + GetAttributeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Attribute) { + requests.add(request); + responseObserver.onNext(((Attribute) 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 GetAttribute, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Attribute.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateAttribute( + UpdateAttributeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Attribute) { + requests.add(request); + responseObserver.onNext(((Attribute) 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 UpdateAttribute, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Attribute.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteAttribute( + DeleteAttributeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) 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 DeleteAttribute, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listAttributes( + ListAttributesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListAttributesResponse) { + requests.add(request); + responseObserver.onNext(((ListAttributesResponse) 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 ListAttributes, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListAttributesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void searchResources( + SearchResourcesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SearchResourcesResponse) { + requests.add(request); + responseObserver.onNext(((SearchResourcesResponse) 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 SearchResources, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SearchResourcesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createExternalApi( + CreateExternalApiRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ExternalApi) { + requests.add(request); + responseObserver.onNext(((ExternalApi) 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 CreateExternalApi, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ExternalApi.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getExternalApi( + GetExternalApiRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ExternalApi) { + requests.add(request); + responseObserver.onNext(((ExternalApi) 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 GetExternalApi, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ExternalApi.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateExternalApi( + UpdateExternalApiRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ExternalApi) { + requests.add(request); + responseObserver.onNext(((ExternalApi) 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 UpdateExternalApi, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ExternalApi.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteExternalApi( + DeleteExternalApiRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) 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 DeleteExternalApi, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listExternalApis( + ListExternalApisRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListExternalApisResponse) { + requests.add(request); + responseObserver.onNext(((ListExternalApisResponse) 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 ListExternalApis, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListExternalApisResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockApiHubPlugin.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockApiHubPlugin.java new file mode 100644 index 000000000000..48559929b6a9 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockApiHubPlugin.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +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 MockApiHubPlugin implements MockGrpcService { + private final MockApiHubPluginImpl serviceImpl; + + public MockApiHubPlugin() { + serviceImpl = new MockApiHubPluginImpl(); + } + + @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-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockApiHubPluginImpl.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockApiHubPluginImpl.java new file mode 100644 index 000000000000..e6d68f8dd50c --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockApiHubPluginImpl.java @@ -0,0 +1,120 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.apihub.v1.ApiHubPluginGrpc.ApiHubPluginImplBase; +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 MockApiHubPluginImpl extends ApiHubPluginImplBase { + private List requests; + private Queue responses; + + public MockApiHubPluginImpl() { + 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 getPlugin(GetPluginRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Plugin) { + requests.add(request); + responseObserver.onNext(((Plugin) 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 GetPlugin, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Plugin.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void enablePlugin(EnablePluginRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Plugin) { + requests.add(request); + responseObserver.onNext(((Plugin) 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 EnablePlugin, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Plugin.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void disablePlugin(DisablePluginRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Plugin) { + requests.add(request); + responseObserver.onNext(((Plugin) 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 DisablePlugin, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Plugin.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockHostProjectRegistrationService.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockHostProjectRegistrationService.java new file mode 100644 index 000000000000..9635084e69bd --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockHostProjectRegistrationService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +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 MockHostProjectRegistrationService implements MockGrpcService { + private final MockHostProjectRegistrationServiceImpl serviceImpl; + + public MockHostProjectRegistrationService() { + serviceImpl = new MockHostProjectRegistrationServiceImpl(); + } + + @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-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockHostProjectRegistrationServiceImpl.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockHostProjectRegistrationServiceImpl.java new file mode 100644 index 000000000000..a56f325e7dcf --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockHostProjectRegistrationServiceImpl.java @@ -0,0 +1,126 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.apihub.v1.HostProjectRegistrationServiceGrpc.HostProjectRegistrationServiceImplBase; +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 MockHostProjectRegistrationServiceImpl extends HostProjectRegistrationServiceImplBase { + private List requests; + private Queue responses; + + public MockHostProjectRegistrationServiceImpl() { + 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 createHostProjectRegistration( + CreateHostProjectRegistrationRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof HostProjectRegistration) { + requests.add(request); + responseObserver.onNext(((HostProjectRegistration) 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 CreateHostProjectRegistration, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + HostProjectRegistration.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getHostProjectRegistration( + GetHostProjectRegistrationRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof HostProjectRegistration) { + requests.add(request); + responseObserver.onNext(((HostProjectRegistration) 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 GetHostProjectRegistration, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + HostProjectRegistration.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listHostProjectRegistrations( + ListHostProjectRegistrationsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListHostProjectRegistrationsResponse) { + requests.add(request); + responseObserver.onNext(((ListHostProjectRegistrationsResponse) 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 ListHostProjectRegistrations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListHostProjectRegistrationsResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockLintingService.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockLintingService.java new file mode 100644 index 000000000000..42282bbd1a10 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockLintingService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +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 MockLintingService implements MockGrpcService { + private final MockLintingServiceImpl serviceImpl; + + public MockLintingService() { + serviceImpl = new MockLintingServiceImpl(); + } + + @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-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockLintingServiceImpl.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockLintingServiceImpl.java new file mode 100644 index 000000000000..0f6dd9666204 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockLintingServiceImpl.java @@ -0,0 +1,144 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.apihub.v1.LintingServiceGrpc.LintingServiceImplBase; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +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 MockLintingServiceImpl extends LintingServiceImplBase { + private List requests; + private Queue responses; + + public MockLintingServiceImpl() { + 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 getStyleGuide( + GetStyleGuideRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof StyleGuide) { + requests.add(request); + responseObserver.onNext(((StyleGuide) 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 GetStyleGuide, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + StyleGuide.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateStyleGuide( + UpdateStyleGuideRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof StyleGuide) { + requests.add(request); + responseObserver.onNext(((StyleGuide) 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 UpdateStyleGuide, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + StyleGuide.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getStyleGuideContents( + GetStyleGuideContentsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof StyleGuideContents) { + requests.add(request); + responseObserver.onNext(((StyleGuideContents) 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 GetStyleGuideContents, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + StyleGuideContents.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void lintSpec(LintSpecRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) 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 LintSpec, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockLocations.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockLocations.java new file mode 100644 index 000000000000..86eb840fd084 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockLocations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +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 MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @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-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockLocationsImpl.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockLocationsImpl.java new file mode 100644 index 000000000000..ff5fbfc6698b --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockLocationsImpl.java @@ -0,0 +1,105 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +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 MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + 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 listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) 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 ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLocation(GetLocationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Location) { + requests.add(request); + responseObserver.onNext(((Location) 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 GetLocation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Location.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockProvisioning.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockProvisioning.java new file mode 100644 index 000000000000..62c4ed27c0d9 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockProvisioning.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +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 MockProvisioning implements MockGrpcService { + private final MockProvisioningImpl serviceImpl; + + public MockProvisioning() { + serviceImpl = new MockProvisioningImpl(); + } + + @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-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockProvisioningImpl.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockProvisioningImpl.java new file mode 100644 index 000000000000..141818a31955 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockProvisioningImpl.java @@ -0,0 +1,125 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.apihub.v1.ProvisioningGrpc.ProvisioningImplBase; +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 MockProvisioningImpl extends ProvisioningImplBase { + private List requests; + private Queue responses; + + public MockProvisioningImpl() { + 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 createApiHubInstance( + CreateApiHubInstanceRequest 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 CreateApiHubInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getApiHubInstance( + GetApiHubInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ApiHubInstance) { + requests.add(request); + responseObserver.onNext(((ApiHubInstance) 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 GetApiHubInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ApiHubInstance.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void lookupApiHubInstance( + LookupApiHubInstanceRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof LookupApiHubInstanceResponse) { + requests.add(request); + responseObserver.onNext(((LookupApiHubInstanceResponse) 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 LookupApiHubInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + LookupApiHubInstanceResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockRuntimeProjectAttachmentService.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockRuntimeProjectAttachmentService.java new file mode 100644 index 000000000000..f89091309649 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockRuntimeProjectAttachmentService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +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 MockRuntimeProjectAttachmentService implements MockGrpcService { + private final MockRuntimeProjectAttachmentServiceImpl serviceImpl; + + public MockRuntimeProjectAttachmentService() { + serviceImpl = new MockRuntimeProjectAttachmentServiceImpl(); + } + + @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-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockRuntimeProjectAttachmentServiceImpl.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockRuntimeProjectAttachmentServiceImpl.java new file mode 100644 index 000000000000..92053dbce071 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/MockRuntimeProjectAttachmentServiceImpl.java @@ -0,0 +1,171 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceGrpc.RuntimeProjectAttachmentServiceImplBase; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +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 MockRuntimeProjectAttachmentServiceImpl + extends RuntimeProjectAttachmentServiceImplBase { + private List requests; + private Queue responses; + + public MockRuntimeProjectAttachmentServiceImpl() { + 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 createRuntimeProjectAttachment( + CreateRuntimeProjectAttachmentRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RuntimeProjectAttachment) { + requests.add(request); + responseObserver.onNext(((RuntimeProjectAttachment) 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 CreateRuntimeProjectAttachment, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RuntimeProjectAttachment.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getRuntimeProjectAttachment( + GetRuntimeProjectAttachmentRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RuntimeProjectAttachment) { + requests.add(request); + responseObserver.onNext(((RuntimeProjectAttachment) 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 GetRuntimeProjectAttachment, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RuntimeProjectAttachment.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listRuntimeProjectAttachments( + ListRuntimeProjectAttachmentsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListRuntimeProjectAttachmentsResponse) { + requests.add(request); + responseObserver.onNext(((ListRuntimeProjectAttachmentsResponse) 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 ListRuntimeProjectAttachments, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListRuntimeProjectAttachmentsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteRuntimeProjectAttachment( + DeleteRuntimeProjectAttachmentRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) 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 DeleteRuntimeProjectAttachment, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void lookupRuntimeProjectAttachment( + LookupRuntimeProjectAttachmentRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof LookupRuntimeProjectAttachmentResponse) { + requests.add(request); + responseObserver.onNext(((LookupRuntimeProjectAttachmentResponse) 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 LookupRuntimeProjectAttachment, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + LookupRuntimeProjectAttachmentResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ProvisioningClientHttpJsonTest.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ProvisioningClientHttpJsonTest.java new file mode 100644 index 000000000000..97c29a128d88 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ProvisioningClientHttpJsonTest.java @@ -0,0 +1,518 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import static com.google.cloud.apihub.v1.ProvisioningClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.apihub.v1.stub.HttpJsonProvisioningStub; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +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 ProvisioningClientHttpJsonTest { + private static MockHttpService mockService; + private static ProvisioningClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonProvisioningStub.getMethodDescriptors(), + ProvisioningSettings.getDefaultEndpoint()); + ProvisioningSettings settings = + ProvisioningSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + ProvisioningSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ProvisioningClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createApiHubInstanceTest() throws Exception { + ApiHubInstance expectedResponse = + ApiHubInstance.newBuilder() + .setName( + ApiHubInstanceName.of("[PROJECT]", "[LOCATION]", "[API_HUB_INSTANCE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setStateMessage("stateMessage1128185398") + .setConfig(ApiHubInstance.Config.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createApiHubInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ApiHubInstance apiHubInstance = ApiHubInstance.newBuilder().build(); + String apiHubInstanceId = "apiHubInstanceId-1318600853"; + + ApiHubInstance actualResponse = + client.createApiHubInstanceAsync(parent, apiHubInstance, apiHubInstanceId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createApiHubInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ApiHubInstance apiHubInstance = ApiHubInstance.newBuilder().build(); + String apiHubInstanceId = "apiHubInstanceId-1318600853"; + client.createApiHubInstanceAsync(parent, apiHubInstance, apiHubInstanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createApiHubInstanceTest2() throws Exception { + ApiHubInstance expectedResponse = + ApiHubInstance.newBuilder() + .setName( + ApiHubInstanceName.of("[PROJECT]", "[LOCATION]", "[API_HUB_INSTANCE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setStateMessage("stateMessage1128185398") + .setConfig(ApiHubInstance.Config.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createApiHubInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + ApiHubInstance apiHubInstance = ApiHubInstance.newBuilder().build(); + String apiHubInstanceId = "apiHubInstanceId-1318600853"; + + ApiHubInstance actualResponse = + client.createApiHubInstanceAsync(parent, apiHubInstance, apiHubInstanceId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createApiHubInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + ApiHubInstance apiHubInstance = ApiHubInstance.newBuilder().build(); + String apiHubInstanceId = "apiHubInstanceId-1318600853"; + client.createApiHubInstanceAsync(parent, apiHubInstance, apiHubInstanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void getApiHubInstanceTest() throws Exception { + ApiHubInstance expectedResponse = + ApiHubInstance.newBuilder() + .setName( + ApiHubInstanceName.of("[PROJECT]", "[LOCATION]", "[API_HUB_INSTANCE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setStateMessage("stateMessage1128185398") + .setConfig(ApiHubInstance.Config.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .build(); + mockService.addResponse(expectedResponse); + + ApiHubInstanceName name = + ApiHubInstanceName.of("[PROJECT]", "[LOCATION]", "[API_HUB_INSTANCE]"); + + ApiHubInstance actualResponse = client.getApiHubInstance(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getApiHubInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ApiHubInstanceName name = + ApiHubInstanceName.of("[PROJECT]", "[LOCATION]", "[API_HUB_INSTANCE]"); + client.getApiHubInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getApiHubInstanceTest2() throws Exception { + ApiHubInstance expectedResponse = + ApiHubInstance.newBuilder() + .setName( + ApiHubInstanceName.of("[PROJECT]", "[LOCATION]", "[API_HUB_INSTANCE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setStateMessage("stateMessage1128185398") + .setConfig(ApiHubInstance.Config.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-3113/locations/location-3113/apiHubInstances/apiHubInstance-3113"; + + ApiHubInstance actualResponse = client.getApiHubInstance(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getApiHubInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-3113/locations/location-3113/apiHubInstances/apiHubInstance-3113"; + client.getApiHubInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void lookupApiHubInstanceTest() throws Exception { + LookupApiHubInstanceResponse expectedResponse = + LookupApiHubInstanceResponse.newBuilder() + .setApiHubInstance(ApiHubInstance.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + LookupApiHubInstanceResponse actualResponse = client.lookupApiHubInstance(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void lookupApiHubInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.lookupApiHubInstance(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void lookupApiHubInstanceTest2() throws Exception { + LookupApiHubInstanceResponse expectedResponse = + LookupApiHubInstanceResponse.newBuilder() + .setApiHubInstance(ApiHubInstance.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + LookupApiHubInstanceResponse actualResponse = client.lookupApiHubInstance(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void lookupApiHubInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.lookupApiHubInstance(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ProvisioningClientTest.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ProvisioningClientTest.java new file mode 100644 index 000000000000..1be7aecc389b --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/ProvisioningClientTest.java @@ -0,0 +1,486 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import static com.google.cloud.apihub.v1.ProvisioningClient.ListLocationsPagedResponse; + +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +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 ProvisioningClientTest { + private static MockLocations mockLocations; + private static MockProvisioning mockProvisioning; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private ProvisioningClient client; + + @BeforeClass + public static void startStaticServer() { + mockProvisioning = new MockProvisioning(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockProvisioning, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + ProvisioningSettings settings = + ProvisioningSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ProvisioningClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createApiHubInstanceTest() throws Exception { + ApiHubInstance expectedResponse = + ApiHubInstance.newBuilder() + .setName( + ApiHubInstanceName.of("[PROJECT]", "[LOCATION]", "[API_HUB_INSTANCE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setStateMessage("stateMessage1128185398") + .setConfig(ApiHubInstance.Config.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createApiHubInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProvisioning.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ApiHubInstance apiHubInstance = ApiHubInstance.newBuilder().build(); + String apiHubInstanceId = "apiHubInstanceId-1318600853"; + + ApiHubInstance actualResponse = + client.createApiHubInstanceAsync(parent, apiHubInstance, apiHubInstanceId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProvisioning.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateApiHubInstanceRequest actualRequest = + ((CreateApiHubInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(apiHubInstance, actualRequest.getApiHubInstance()); + Assert.assertEquals(apiHubInstanceId, actualRequest.getApiHubInstanceId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createApiHubInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProvisioning.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ApiHubInstance apiHubInstance = ApiHubInstance.newBuilder().build(); + String apiHubInstanceId = "apiHubInstanceId-1318600853"; + client.createApiHubInstanceAsync(parent, apiHubInstance, apiHubInstanceId).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 createApiHubInstanceTest2() throws Exception { + ApiHubInstance expectedResponse = + ApiHubInstance.newBuilder() + .setName( + ApiHubInstanceName.of("[PROJECT]", "[LOCATION]", "[API_HUB_INSTANCE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setStateMessage("stateMessage1128185398") + .setConfig(ApiHubInstance.Config.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createApiHubInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProvisioning.addResponse(resultOperation); + + String parent = "parent-995424086"; + ApiHubInstance apiHubInstance = ApiHubInstance.newBuilder().build(); + String apiHubInstanceId = "apiHubInstanceId-1318600853"; + + ApiHubInstance actualResponse = + client.createApiHubInstanceAsync(parent, apiHubInstance, apiHubInstanceId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProvisioning.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateApiHubInstanceRequest actualRequest = + ((CreateApiHubInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(apiHubInstance, actualRequest.getApiHubInstance()); + Assert.assertEquals(apiHubInstanceId, actualRequest.getApiHubInstanceId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createApiHubInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProvisioning.addException(exception); + + try { + String parent = "parent-995424086"; + ApiHubInstance apiHubInstance = ApiHubInstance.newBuilder().build(); + String apiHubInstanceId = "apiHubInstanceId-1318600853"; + client.createApiHubInstanceAsync(parent, apiHubInstance, apiHubInstanceId).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 getApiHubInstanceTest() throws Exception { + ApiHubInstance expectedResponse = + ApiHubInstance.newBuilder() + .setName( + ApiHubInstanceName.of("[PROJECT]", "[LOCATION]", "[API_HUB_INSTANCE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setStateMessage("stateMessage1128185398") + .setConfig(ApiHubInstance.Config.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .build(); + mockProvisioning.addResponse(expectedResponse); + + ApiHubInstanceName name = + ApiHubInstanceName.of("[PROJECT]", "[LOCATION]", "[API_HUB_INSTANCE]"); + + ApiHubInstance actualResponse = client.getApiHubInstance(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProvisioning.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetApiHubInstanceRequest actualRequest = ((GetApiHubInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getApiHubInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProvisioning.addException(exception); + + try { + ApiHubInstanceName name = + ApiHubInstanceName.of("[PROJECT]", "[LOCATION]", "[API_HUB_INSTANCE]"); + client.getApiHubInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getApiHubInstanceTest2() throws Exception { + ApiHubInstance expectedResponse = + ApiHubInstance.newBuilder() + .setName( + ApiHubInstanceName.of("[PROJECT]", "[LOCATION]", "[API_HUB_INSTANCE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setStateMessage("stateMessage1128185398") + .setConfig(ApiHubInstance.Config.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .build(); + mockProvisioning.addResponse(expectedResponse); + + String name = "name3373707"; + + ApiHubInstance actualResponse = client.getApiHubInstance(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProvisioning.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetApiHubInstanceRequest actualRequest = ((GetApiHubInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getApiHubInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProvisioning.addException(exception); + + try { + String name = "name3373707"; + client.getApiHubInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void lookupApiHubInstanceTest() throws Exception { + LookupApiHubInstanceResponse expectedResponse = + LookupApiHubInstanceResponse.newBuilder() + .setApiHubInstance(ApiHubInstance.newBuilder().build()) + .build(); + mockProvisioning.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + LookupApiHubInstanceResponse actualResponse = client.lookupApiHubInstance(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProvisioning.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + LookupApiHubInstanceRequest actualRequest = + ((LookupApiHubInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void lookupApiHubInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProvisioning.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.lookupApiHubInstance(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void lookupApiHubInstanceTest2() throws Exception { + LookupApiHubInstanceResponse expectedResponse = + LookupApiHubInstanceResponse.newBuilder() + .setApiHubInstance(ApiHubInstance.newBuilder().build()) + .build(); + mockProvisioning.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + LookupApiHubInstanceResponse actualResponse = client.lookupApiHubInstance(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProvisioning.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + LookupApiHubInstanceRequest actualRequest = + ((LookupApiHubInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void lookupApiHubInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProvisioning.addException(exception); + + try { + String parent = "parent-995424086"; + client.lookupApiHubInstance(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentServiceClientHttpJsonTest.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..aefea3a7374b --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentServiceClientHttpJsonTest.java @@ -0,0 +1,700 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import static com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient.ListRuntimeProjectAttachmentsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.apihub.v1.stub.HttpJsonRuntimeProjectAttachmentServiceStub; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +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 RuntimeProjectAttachmentServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static RuntimeProjectAttachmentServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonRuntimeProjectAttachmentServiceStub.getMethodDescriptors(), + RuntimeProjectAttachmentServiceSettings.getDefaultEndpoint()); + RuntimeProjectAttachmentServiceSettings settings = + RuntimeProjectAttachmentServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + RuntimeProjectAttachmentServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RuntimeProjectAttachmentServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createRuntimeProjectAttachmentTest() throws Exception { + RuntimeProjectAttachment expectedResponse = + RuntimeProjectAttachment.newBuilder() + .setName( + RuntimeProjectAttachmentName.of( + "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]") + .toString()) + .setRuntimeProject("runtimeProject-58847199") + .setCreateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + RuntimeProjectAttachment runtimeProjectAttachment = + RuntimeProjectAttachment.newBuilder().build(); + String runtimeProjectAttachmentId = "runtimeProjectAttachmentId-753213345"; + + RuntimeProjectAttachment actualResponse = + client.createRuntimeProjectAttachment( + parent, runtimeProjectAttachment, runtimeProjectAttachmentId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createRuntimeProjectAttachmentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + RuntimeProjectAttachment runtimeProjectAttachment = + RuntimeProjectAttachment.newBuilder().build(); + String runtimeProjectAttachmentId = "runtimeProjectAttachmentId-753213345"; + client.createRuntimeProjectAttachment( + parent, runtimeProjectAttachment, runtimeProjectAttachmentId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createRuntimeProjectAttachmentTest2() throws Exception { + RuntimeProjectAttachment expectedResponse = + RuntimeProjectAttachment.newBuilder() + .setName( + RuntimeProjectAttachmentName.of( + "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]") + .toString()) + .setRuntimeProject("runtimeProject-58847199") + .setCreateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + RuntimeProjectAttachment runtimeProjectAttachment = + RuntimeProjectAttachment.newBuilder().build(); + String runtimeProjectAttachmentId = "runtimeProjectAttachmentId-753213345"; + + RuntimeProjectAttachment actualResponse = + client.createRuntimeProjectAttachment( + parent, runtimeProjectAttachment, runtimeProjectAttachmentId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createRuntimeProjectAttachmentExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + RuntimeProjectAttachment runtimeProjectAttachment = + RuntimeProjectAttachment.newBuilder().build(); + String runtimeProjectAttachmentId = "runtimeProjectAttachmentId-753213345"; + client.createRuntimeProjectAttachment( + parent, runtimeProjectAttachment, runtimeProjectAttachmentId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getRuntimeProjectAttachmentTest() throws Exception { + RuntimeProjectAttachment expectedResponse = + RuntimeProjectAttachment.newBuilder() + .setName( + RuntimeProjectAttachmentName.of( + "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]") + .toString()) + .setRuntimeProject("runtimeProject-58847199") + .setCreateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + RuntimeProjectAttachmentName name = + RuntimeProjectAttachmentName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]"); + + RuntimeProjectAttachment actualResponse = client.getRuntimeProjectAttachment(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getRuntimeProjectAttachmentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RuntimeProjectAttachmentName name = + RuntimeProjectAttachmentName.of( + "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]"); + client.getRuntimeProjectAttachment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getRuntimeProjectAttachmentTest2() throws Exception { + RuntimeProjectAttachment expectedResponse = + RuntimeProjectAttachment.newBuilder() + .setName( + RuntimeProjectAttachmentName.of( + "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]") + .toString()) + .setRuntimeProject("runtimeProject-58847199") + .setCreateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-2629/locations/location-2629/runtimeProjectAttachments/runtimeProjectAttachment-2629"; + + RuntimeProjectAttachment actualResponse = client.getRuntimeProjectAttachment(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getRuntimeProjectAttachmentExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-2629/locations/location-2629/runtimeProjectAttachments/runtimeProjectAttachment-2629"; + client.getRuntimeProjectAttachment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRuntimeProjectAttachmentsTest() throws Exception { + RuntimeProjectAttachment responsesElement = RuntimeProjectAttachment.newBuilder().build(); + ListRuntimeProjectAttachmentsResponse expectedResponse = + ListRuntimeProjectAttachmentsResponse.newBuilder() + .setNextPageToken("") + .addAllRuntimeProjectAttachments(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListRuntimeProjectAttachmentsPagedResponse pagedListResponse = + client.listRuntimeProjectAttachments(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals( + expectedResponse.getRuntimeProjectAttachmentsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listRuntimeProjectAttachmentsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listRuntimeProjectAttachments(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRuntimeProjectAttachmentsTest2() throws Exception { + RuntimeProjectAttachment responsesElement = RuntimeProjectAttachment.newBuilder().build(); + ListRuntimeProjectAttachmentsResponse expectedResponse = + ListRuntimeProjectAttachmentsResponse.newBuilder() + .setNextPageToken("") + .addAllRuntimeProjectAttachments(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListRuntimeProjectAttachmentsPagedResponse pagedListResponse = + client.listRuntimeProjectAttachments(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals( + expectedResponse.getRuntimeProjectAttachmentsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listRuntimeProjectAttachmentsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listRuntimeProjectAttachments(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRuntimeProjectAttachmentTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + RuntimeProjectAttachmentName name = + RuntimeProjectAttachmentName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]"); + + client.deleteRuntimeProjectAttachment(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteRuntimeProjectAttachmentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RuntimeProjectAttachmentName name = + RuntimeProjectAttachmentName.of( + "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]"); + client.deleteRuntimeProjectAttachment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRuntimeProjectAttachmentTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-2629/locations/location-2629/runtimeProjectAttachments/runtimeProjectAttachment-2629"; + + client.deleteRuntimeProjectAttachment(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteRuntimeProjectAttachmentExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-2629/locations/location-2629/runtimeProjectAttachments/runtimeProjectAttachment-2629"; + client.deleteRuntimeProjectAttachment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void lookupRuntimeProjectAttachmentTest() throws Exception { + LookupRuntimeProjectAttachmentResponse expectedResponse = + LookupRuntimeProjectAttachmentResponse.newBuilder() + .setRuntimeProjectAttachment(RuntimeProjectAttachment.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + LocationName name = LocationName.of("[PROJECT]", "[LOCATION]"); + + LookupRuntimeProjectAttachmentResponse actualResponse = + client.lookupRuntimeProjectAttachment(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void lookupRuntimeProjectAttachmentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName name = LocationName.of("[PROJECT]", "[LOCATION]"); + client.lookupRuntimeProjectAttachment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void lookupRuntimeProjectAttachmentTest2() throws Exception { + LookupRuntimeProjectAttachmentResponse expectedResponse = + LookupRuntimeProjectAttachmentResponse.newBuilder() + .setRuntimeProjectAttachment(RuntimeProjectAttachment.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-9062/locations/location-9062"; + + LookupRuntimeProjectAttachmentResponse actualResponse = + client.lookupRuntimeProjectAttachment(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void lookupRuntimeProjectAttachmentExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-9062/locations/location-9062"; + client.lookupRuntimeProjectAttachment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentServiceClientTest.java b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentServiceClientTest.java new file mode 100644 index 000000000000..f40cc8942b96 --- /dev/null +++ b/java-apihub/google-cloud-apihub/src/test/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentServiceClientTest.java @@ -0,0 +1,641 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import static com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient.ListRuntimeProjectAttachmentsPagedResponse; + +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +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 RuntimeProjectAttachmentServiceClientTest { + private static MockLocations mockLocations; + private static MockRuntimeProjectAttachmentService mockRuntimeProjectAttachmentService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private RuntimeProjectAttachmentServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockRuntimeProjectAttachmentService = new MockRuntimeProjectAttachmentService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockRuntimeProjectAttachmentService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + RuntimeProjectAttachmentServiceSettings settings = + RuntimeProjectAttachmentServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RuntimeProjectAttachmentServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createRuntimeProjectAttachmentTest() throws Exception { + RuntimeProjectAttachment expectedResponse = + RuntimeProjectAttachment.newBuilder() + .setName( + RuntimeProjectAttachmentName.of( + "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]") + .toString()) + .setRuntimeProject("runtimeProject-58847199") + .setCreateTime(Timestamp.newBuilder().build()) + .build(); + mockRuntimeProjectAttachmentService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + RuntimeProjectAttachment runtimeProjectAttachment = + RuntimeProjectAttachment.newBuilder().build(); + String runtimeProjectAttachmentId = "runtimeProjectAttachmentId-753213345"; + + RuntimeProjectAttachment actualResponse = + client.createRuntimeProjectAttachment( + parent, runtimeProjectAttachment, runtimeProjectAttachmentId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRuntimeProjectAttachmentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateRuntimeProjectAttachmentRequest actualRequest = + ((CreateRuntimeProjectAttachmentRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(runtimeProjectAttachment, actualRequest.getRuntimeProjectAttachment()); + Assert.assertEquals(runtimeProjectAttachmentId, actualRequest.getRuntimeProjectAttachmentId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createRuntimeProjectAttachmentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRuntimeProjectAttachmentService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + RuntimeProjectAttachment runtimeProjectAttachment = + RuntimeProjectAttachment.newBuilder().build(); + String runtimeProjectAttachmentId = "runtimeProjectAttachmentId-753213345"; + client.createRuntimeProjectAttachment( + parent, runtimeProjectAttachment, runtimeProjectAttachmentId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createRuntimeProjectAttachmentTest2() throws Exception { + RuntimeProjectAttachment expectedResponse = + RuntimeProjectAttachment.newBuilder() + .setName( + RuntimeProjectAttachmentName.of( + "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]") + .toString()) + .setRuntimeProject("runtimeProject-58847199") + .setCreateTime(Timestamp.newBuilder().build()) + .build(); + mockRuntimeProjectAttachmentService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + RuntimeProjectAttachment runtimeProjectAttachment = + RuntimeProjectAttachment.newBuilder().build(); + String runtimeProjectAttachmentId = "runtimeProjectAttachmentId-753213345"; + + RuntimeProjectAttachment actualResponse = + client.createRuntimeProjectAttachment( + parent, runtimeProjectAttachment, runtimeProjectAttachmentId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRuntimeProjectAttachmentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateRuntimeProjectAttachmentRequest actualRequest = + ((CreateRuntimeProjectAttachmentRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(runtimeProjectAttachment, actualRequest.getRuntimeProjectAttachment()); + Assert.assertEquals(runtimeProjectAttachmentId, actualRequest.getRuntimeProjectAttachmentId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createRuntimeProjectAttachmentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRuntimeProjectAttachmentService.addException(exception); + + try { + String parent = "parent-995424086"; + RuntimeProjectAttachment runtimeProjectAttachment = + RuntimeProjectAttachment.newBuilder().build(); + String runtimeProjectAttachmentId = "runtimeProjectAttachmentId-753213345"; + client.createRuntimeProjectAttachment( + parent, runtimeProjectAttachment, runtimeProjectAttachmentId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getRuntimeProjectAttachmentTest() throws Exception { + RuntimeProjectAttachment expectedResponse = + RuntimeProjectAttachment.newBuilder() + .setName( + RuntimeProjectAttachmentName.of( + "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]") + .toString()) + .setRuntimeProject("runtimeProject-58847199") + .setCreateTime(Timestamp.newBuilder().build()) + .build(); + mockRuntimeProjectAttachmentService.addResponse(expectedResponse); + + RuntimeProjectAttachmentName name = + RuntimeProjectAttachmentName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]"); + + RuntimeProjectAttachment actualResponse = client.getRuntimeProjectAttachment(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRuntimeProjectAttachmentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetRuntimeProjectAttachmentRequest actualRequest = + ((GetRuntimeProjectAttachmentRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getRuntimeProjectAttachmentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRuntimeProjectAttachmentService.addException(exception); + + try { + RuntimeProjectAttachmentName name = + RuntimeProjectAttachmentName.of( + "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]"); + client.getRuntimeProjectAttachment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getRuntimeProjectAttachmentTest2() throws Exception { + RuntimeProjectAttachment expectedResponse = + RuntimeProjectAttachment.newBuilder() + .setName( + RuntimeProjectAttachmentName.of( + "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]") + .toString()) + .setRuntimeProject("runtimeProject-58847199") + .setCreateTime(Timestamp.newBuilder().build()) + .build(); + mockRuntimeProjectAttachmentService.addResponse(expectedResponse); + + String name = "name3373707"; + + RuntimeProjectAttachment actualResponse = client.getRuntimeProjectAttachment(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRuntimeProjectAttachmentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetRuntimeProjectAttachmentRequest actualRequest = + ((GetRuntimeProjectAttachmentRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getRuntimeProjectAttachmentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRuntimeProjectAttachmentService.addException(exception); + + try { + String name = "name3373707"; + client.getRuntimeProjectAttachment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRuntimeProjectAttachmentsTest() throws Exception { + RuntimeProjectAttachment responsesElement = RuntimeProjectAttachment.newBuilder().build(); + ListRuntimeProjectAttachmentsResponse expectedResponse = + ListRuntimeProjectAttachmentsResponse.newBuilder() + .setNextPageToken("") + .addAllRuntimeProjectAttachments(Arrays.asList(responsesElement)) + .build(); + mockRuntimeProjectAttachmentService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListRuntimeProjectAttachmentsPagedResponse pagedListResponse = + client.listRuntimeProjectAttachments(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals( + expectedResponse.getRuntimeProjectAttachmentsList().get(0), resources.get(0)); + + List actualRequests = mockRuntimeProjectAttachmentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListRuntimeProjectAttachmentsRequest actualRequest = + ((ListRuntimeProjectAttachmentsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listRuntimeProjectAttachmentsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRuntimeProjectAttachmentService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listRuntimeProjectAttachments(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRuntimeProjectAttachmentsTest2() throws Exception { + RuntimeProjectAttachment responsesElement = RuntimeProjectAttachment.newBuilder().build(); + ListRuntimeProjectAttachmentsResponse expectedResponse = + ListRuntimeProjectAttachmentsResponse.newBuilder() + .setNextPageToken("") + .addAllRuntimeProjectAttachments(Arrays.asList(responsesElement)) + .build(); + mockRuntimeProjectAttachmentService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListRuntimeProjectAttachmentsPagedResponse pagedListResponse = + client.listRuntimeProjectAttachments(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals( + expectedResponse.getRuntimeProjectAttachmentsList().get(0), resources.get(0)); + + List actualRequests = mockRuntimeProjectAttachmentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListRuntimeProjectAttachmentsRequest actualRequest = + ((ListRuntimeProjectAttachmentsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listRuntimeProjectAttachmentsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRuntimeProjectAttachmentService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listRuntimeProjectAttachments(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRuntimeProjectAttachmentTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockRuntimeProjectAttachmentService.addResponse(expectedResponse); + + RuntimeProjectAttachmentName name = + RuntimeProjectAttachmentName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]"); + + client.deleteRuntimeProjectAttachment(name); + + List actualRequests = mockRuntimeProjectAttachmentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteRuntimeProjectAttachmentRequest actualRequest = + ((DeleteRuntimeProjectAttachmentRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteRuntimeProjectAttachmentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRuntimeProjectAttachmentService.addException(exception); + + try { + RuntimeProjectAttachmentName name = + RuntimeProjectAttachmentName.of( + "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]"); + client.deleteRuntimeProjectAttachment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRuntimeProjectAttachmentTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockRuntimeProjectAttachmentService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteRuntimeProjectAttachment(name); + + List actualRequests = mockRuntimeProjectAttachmentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteRuntimeProjectAttachmentRequest actualRequest = + ((DeleteRuntimeProjectAttachmentRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteRuntimeProjectAttachmentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRuntimeProjectAttachmentService.addException(exception); + + try { + String name = "name3373707"; + client.deleteRuntimeProjectAttachment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void lookupRuntimeProjectAttachmentTest() throws Exception { + LookupRuntimeProjectAttachmentResponse expectedResponse = + LookupRuntimeProjectAttachmentResponse.newBuilder() + .setRuntimeProjectAttachment(RuntimeProjectAttachment.newBuilder().build()) + .build(); + mockRuntimeProjectAttachmentService.addResponse(expectedResponse); + + LocationName name = LocationName.of("[PROJECT]", "[LOCATION]"); + + LookupRuntimeProjectAttachmentResponse actualResponse = + client.lookupRuntimeProjectAttachment(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRuntimeProjectAttachmentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + LookupRuntimeProjectAttachmentRequest actualRequest = + ((LookupRuntimeProjectAttachmentRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void lookupRuntimeProjectAttachmentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRuntimeProjectAttachmentService.addException(exception); + + try { + LocationName name = LocationName.of("[PROJECT]", "[LOCATION]"); + client.lookupRuntimeProjectAttachment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void lookupRuntimeProjectAttachmentTest2() throws Exception { + LookupRuntimeProjectAttachmentResponse expectedResponse = + LookupRuntimeProjectAttachmentResponse.newBuilder() + .setRuntimeProjectAttachment(RuntimeProjectAttachment.newBuilder().build()) + .build(); + mockRuntimeProjectAttachmentService.addResponse(expectedResponse); + + String name = "name3373707"; + + LookupRuntimeProjectAttachmentResponse actualResponse = + client.lookupRuntimeProjectAttachment(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRuntimeProjectAttachmentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + LookupRuntimeProjectAttachmentRequest actualRequest = + ((LookupRuntimeProjectAttachmentRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void lookupRuntimeProjectAttachmentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRuntimeProjectAttachmentService.addException(exception); + + try { + String name = "name3373707"; + client.lookupRuntimeProjectAttachment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-apihub/grpc-google-cloud-apihub-v1/pom.xml b/java-apihub/grpc-google-cloud-apihub-v1/pom.xml new file mode 100644 index 000000000000..99f8bb4a9100 --- /dev/null +++ b/java-apihub/grpc-google-cloud-apihub-v1/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-apihub-v1 + 0.0.1-SNAPSHOT + grpc-google-cloud-apihub-v1 + GRPC library for google-cloud-apihub + + com.google.cloud + google-cloud-apihub-parent + 0.0.1-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-cloud-apihub-v1 + + + com.google.guava + guava + + + diff --git a/java-apihub/grpc-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubDependenciesGrpc.java b/java-apihub/grpc-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubDependenciesGrpc.java new file mode 100644 index 000000000000..70b76abb66eb --- /dev/null +++ b/java-apihub/grpc-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubDependenciesGrpc.java @@ -0,0 +1,862 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * This service provides methods for various operations related to a
+ * [Dependency][google.cloud.apihub.v1.Dependency] in the API hub.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/apihub/v1/apihub_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class ApiHubDependenciesGrpc { + + private ApiHubDependenciesGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.apihub.v1.ApiHubDependencies"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateDependencyRequest, com.google.cloud.apihub.v1.Dependency> + getCreateDependencyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateDependency", + requestType = com.google.cloud.apihub.v1.CreateDependencyRequest.class, + responseType = com.google.cloud.apihub.v1.Dependency.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateDependencyRequest, com.google.cloud.apihub.v1.Dependency> + getCreateDependencyMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateDependencyRequest, + com.google.cloud.apihub.v1.Dependency> + getCreateDependencyMethod; + if ((getCreateDependencyMethod = ApiHubDependenciesGrpc.getCreateDependencyMethod) == null) { + synchronized (ApiHubDependenciesGrpc.class) { + if ((getCreateDependencyMethod = ApiHubDependenciesGrpc.getCreateDependencyMethod) + == null) { + ApiHubDependenciesGrpc.getCreateDependencyMethod = + getCreateDependencyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateDependency")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.CreateDependencyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.Dependency.getDefaultInstance())) + .setSchemaDescriptor( + new ApiHubDependenciesMethodDescriptorSupplier("CreateDependency")) + .build(); + } + } + } + return getCreateDependencyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetDependencyRequest, com.google.cloud.apihub.v1.Dependency> + getGetDependencyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetDependency", + requestType = com.google.cloud.apihub.v1.GetDependencyRequest.class, + responseType = com.google.cloud.apihub.v1.Dependency.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetDependencyRequest, com.google.cloud.apihub.v1.Dependency> + getGetDependencyMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetDependencyRequest, com.google.cloud.apihub.v1.Dependency> + getGetDependencyMethod; + if ((getGetDependencyMethod = ApiHubDependenciesGrpc.getGetDependencyMethod) == null) { + synchronized (ApiHubDependenciesGrpc.class) { + if ((getGetDependencyMethod = ApiHubDependenciesGrpc.getGetDependencyMethod) == null) { + ApiHubDependenciesGrpc.getGetDependencyMethod = + getGetDependencyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetDependency")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.GetDependencyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.Dependency.getDefaultInstance())) + .setSchemaDescriptor( + new ApiHubDependenciesMethodDescriptorSupplier("GetDependency")) + .build(); + } + } + } + return getGetDependencyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.UpdateDependencyRequest, com.google.cloud.apihub.v1.Dependency> + getUpdateDependencyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateDependency", + requestType = com.google.cloud.apihub.v1.UpdateDependencyRequest.class, + responseType = com.google.cloud.apihub.v1.Dependency.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.UpdateDependencyRequest, com.google.cloud.apihub.v1.Dependency> + getUpdateDependencyMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.UpdateDependencyRequest, + com.google.cloud.apihub.v1.Dependency> + getUpdateDependencyMethod; + if ((getUpdateDependencyMethod = ApiHubDependenciesGrpc.getUpdateDependencyMethod) == null) { + synchronized (ApiHubDependenciesGrpc.class) { + if ((getUpdateDependencyMethod = ApiHubDependenciesGrpc.getUpdateDependencyMethod) + == null) { + ApiHubDependenciesGrpc.getUpdateDependencyMethod = + getUpdateDependencyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateDependency")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.UpdateDependencyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.Dependency.getDefaultInstance())) + .setSchemaDescriptor( + new ApiHubDependenciesMethodDescriptorSupplier("UpdateDependency")) + .build(); + } + } + } + return getUpdateDependencyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.DeleteDependencyRequest, com.google.protobuf.Empty> + getDeleteDependencyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteDependency", + requestType = com.google.cloud.apihub.v1.DeleteDependencyRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.DeleteDependencyRequest, com.google.protobuf.Empty> + getDeleteDependencyMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.DeleteDependencyRequest, com.google.protobuf.Empty> + getDeleteDependencyMethod; + if ((getDeleteDependencyMethod = ApiHubDependenciesGrpc.getDeleteDependencyMethod) == null) { + synchronized (ApiHubDependenciesGrpc.class) { + if ((getDeleteDependencyMethod = ApiHubDependenciesGrpc.getDeleteDependencyMethod) + == null) { + ApiHubDependenciesGrpc.getDeleteDependencyMethod = + getDeleteDependencyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteDependency")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.DeleteDependencyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new ApiHubDependenciesMethodDescriptorSupplier("DeleteDependency")) + .build(); + } + } + } + return getDeleteDependencyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListDependenciesRequest, + com.google.cloud.apihub.v1.ListDependenciesResponse> + getListDependenciesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListDependencies", + requestType = com.google.cloud.apihub.v1.ListDependenciesRequest.class, + responseType = com.google.cloud.apihub.v1.ListDependenciesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListDependenciesRequest, + com.google.cloud.apihub.v1.ListDependenciesResponse> + getListDependenciesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListDependenciesRequest, + com.google.cloud.apihub.v1.ListDependenciesResponse> + getListDependenciesMethod; + if ((getListDependenciesMethod = ApiHubDependenciesGrpc.getListDependenciesMethod) == null) { + synchronized (ApiHubDependenciesGrpc.class) { + if ((getListDependenciesMethod = ApiHubDependenciesGrpc.getListDependenciesMethod) + == null) { + ApiHubDependenciesGrpc.getListDependenciesMethod = + getListDependenciesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListDependencies")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.ListDependenciesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.ListDependenciesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new ApiHubDependenciesMethodDescriptorSupplier("ListDependencies")) + .build(); + } + } + } + return getListDependenciesMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ApiHubDependenciesStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ApiHubDependenciesStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ApiHubDependenciesStub(channel, callOptions); + } + }; + return ApiHubDependenciesStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ApiHubDependenciesBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ApiHubDependenciesBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ApiHubDependenciesBlockingStub(channel, callOptions); + } + }; + return ApiHubDependenciesBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ApiHubDependenciesFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ApiHubDependenciesFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ApiHubDependenciesFutureStub(channel, callOptions); + } + }; + return ApiHubDependenciesFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * This service provides methods for various operations related to a
+   * [Dependency][google.cloud.apihub.v1.Dependency] in the API hub.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Create a dependency between two entities in the API hub.
+     * 
+ */ + default void createDependency( + com.google.cloud.apihub.v1.CreateDependencyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateDependencyMethod(), responseObserver); + } + + /** + * + * + *
+     * Get details about a dependency resource in the API hub.
+     * 
+ */ + default void getDependency( + com.google.cloud.apihub.v1.GetDependencyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetDependencyMethod(), responseObserver); + } + + /** + * + * + *
+     * Update a dependency based on the
+     * [update_mask][google.cloud.apihub.v1.UpdateDependencyRequest.update_mask]
+     * provided in the request.
+     * The following fields in the [dependency][google.cloud.apihub.v1.Dependency]
+     * can be updated:
+     * * [description][google.cloud.apihub.v1.Dependency.description]
+     * 
+ */ + default void updateDependency( + com.google.cloud.apihub.v1.UpdateDependencyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateDependencyMethod(), responseObserver); + } + + /** + * + * + *
+     * Delete the dependency resource.
+     * 
+ */ + default void deleteDependency( + com.google.cloud.apihub.v1.DeleteDependencyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteDependencyMethod(), responseObserver); + } + + /** + * + * + *
+     * List dependencies based on the provided filter and pagination parameters.
+     * 
+ */ + default void listDependencies( + com.google.cloud.apihub.v1.ListDependenciesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListDependenciesMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service ApiHubDependencies. + * + *
+   * This service provides methods for various operations related to a
+   * [Dependency][google.cloud.apihub.v1.Dependency] in the API hub.
+   * 
+ */ + public abstract static class ApiHubDependenciesImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return ApiHubDependenciesGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service ApiHubDependencies. + * + *
+   * This service provides methods for various operations related to a
+   * [Dependency][google.cloud.apihub.v1.Dependency] in the API hub.
+   * 
+ */ + public static final class ApiHubDependenciesStub + extends io.grpc.stub.AbstractAsyncStub { + private ApiHubDependenciesStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ApiHubDependenciesStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ApiHubDependenciesStub(channel, callOptions); + } + + /** + * + * + *
+     * Create a dependency between two entities in the API hub.
+     * 
+ */ + public void createDependency( + com.google.cloud.apihub.v1.CreateDependencyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateDependencyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Get details about a dependency resource in the API hub.
+     * 
+ */ + public void getDependency( + com.google.cloud.apihub.v1.GetDependencyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetDependencyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Update a dependency based on the
+     * [update_mask][google.cloud.apihub.v1.UpdateDependencyRequest.update_mask]
+     * provided in the request.
+     * The following fields in the [dependency][google.cloud.apihub.v1.Dependency]
+     * can be updated:
+     * * [description][google.cloud.apihub.v1.Dependency.description]
+     * 
+ */ + public void updateDependency( + com.google.cloud.apihub.v1.UpdateDependencyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateDependencyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Delete the dependency resource.
+     * 
+ */ + public void deleteDependency( + com.google.cloud.apihub.v1.DeleteDependencyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteDependencyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * List dependencies based on the provided filter and pagination parameters.
+     * 
+ */ + public void listDependencies( + com.google.cloud.apihub.v1.ListDependenciesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListDependenciesMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service ApiHubDependencies. + * + *
+   * This service provides methods for various operations related to a
+   * [Dependency][google.cloud.apihub.v1.Dependency] in the API hub.
+   * 
+ */ + public static final class ApiHubDependenciesBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private ApiHubDependenciesBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ApiHubDependenciesBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ApiHubDependenciesBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Create a dependency between two entities in the API hub.
+     * 
+ */ + public com.google.cloud.apihub.v1.Dependency createDependency( + com.google.cloud.apihub.v1.CreateDependencyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateDependencyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get details about a dependency resource in the API hub.
+     * 
+ */ + public com.google.cloud.apihub.v1.Dependency getDependency( + com.google.cloud.apihub.v1.GetDependencyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetDependencyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Update a dependency based on the
+     * [update_mask][google.cloud.apihub.v1.UpdateDependencyRequest.update_mask]
+     * provided in the request.
+     * The following fields in the [dependency][google.cloud.apihub.v1.Dependency]
+     * can be updated:
+     * * [description][google.cloud.apihub.v1.Dependency.description]
+     * 
+ */ + public com.google.cloud.apihub.v1.Dependency updateDependency( + com.google.cloud.apihub.v1.UpdateDependencyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateDependencyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Delete the dependency resource.
+     * 
+ */ + public com.google.protobuf.Empty deleteDependency( + com.google.cloud.apihub.v1.DeleteDependencyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteDependencyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * List dependencies based on the provided filter and pagination parameters.
+     * 
+ */ + public com.google.cloud.apihub.v1.ListDependenciesResponse listDependencies( + com.google.cloud.apihub.v1.ListDependenciesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListDependenciesMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service ApiHubDependencies. + * + *
+   * This service provides methods for various operations related to a
+   * [Dependency][google.cloud.apihub.v1.Dependency] in the API hub.
+   * 
+ */ + public static final class ApiHubDependenciesFutureStub + extends io.grpc.stub.AbstractFutureStub { + private ApiHubDependenciesFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ApiHubDependenciesFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ApiHubDependenciesFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Create a dependency between two entities in the API hub.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createDependency(com.google.cloud.apihub.v1.CreateDependencyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateDependencyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Get details about a dependency resource in the API hub.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getDependency(com.google.cloud.apihub.v1.GetDependencyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetDependencyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Update a dependency based on the
+     * [update_mask][google.cloud.apihub.v1.UpdateDependencyRequest.update_mask]
+     * provided in the request.
+     * The following fields in the [dependency][google.cloud.apihub.v1.Dependency]
+     * can be updated:
+     * * [description][google.cloud.apihub.v1.Dependency.description]
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateDependency(com.google.cloud.apihub.v1.UpdateDependencyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateDependencyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Delete the dependency resource.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteDependency(com.google.cloud.apihub.v1.DeleteDependencyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteDependencyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * List dependencies based on the provided filter and pagination parameters.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.apihub.v1.ListDependenciesResponse> + listDependencies(com.google.cloud.apihub.v1.ListDependenciesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListDependenciesMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_DEPENDENCY = 0; + private static final int METHODID_GET_DEPENDENCY = 1; + private static final int METHODID_UPDATE_DEPENDENCY = 2; + private static final int METHODID_DELETE_DEPENDENCY = 3; + private static final int METHODID_LIST_DEPENDENCIES = 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 AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService 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_CREATE_DEPENDENCY: + serviceImpl.createDependency( + (com.google.cloud.apihub.v1.CreateDependencyRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_DEPENDENCY: + serviceImpl.getDependency( + (com.google.cloud.apihub.v1.GetDependencyRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_DEPENDENCY: + serviceImpl.updateDependency( + (com.google.cloud.apihub.v1.UpdateDependencyRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_DEPENDENCY: + serviceImpl.deleteDependency( + (com.google.cloud.apihub.v1.DeleteDependencyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_DEPENDENCIES: + serviceImpl.listDependencies( + (com.google.cloud.apihub.v1.ListDependenciesRequest) 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(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateDependencyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.CreateDependencyRequest, + com.google.cloud.apihub.v1.Dependency>(service, METHODID_CREATE_DEPENDENCY))) + .addMethod( + getGetDependencyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.GetDependencyRequest, + com.google.cloud.apihub.v1.Dependency>(service, METHODID_GET_DEPENDENCY))) + .addMethod( + getUpdateDependencyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.UpdateDependencyRequest, + com.google.cloud.apihub.v1.Dependency>(service, METHODID_UPDATE_DEPENDENCY))) + .addMethod( + getDeleteDependencyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.DeleteDependencyRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_DEPENDENCY))) + .addMethod( + getListDependenciesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.ListDependenciesRequest, + com.google.cloud.apihub.v1.ListDependenciesResponse>( + service, METHODID_LIST_DEPENDENCIES))) + .build(); + } + + private abstract static class ApiHubDependenciesBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ApiHubDependenciesBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ApiHubDependencies"); + } + } + + private static final class ApiHubDependenciesFileDescriptorSupplier + extends ApiHubDependenciesBaseDescriptorSupplier { + ApiHubDependenciesFileDescriptorSupplier() {} + } + + private static final class ApiHubDependenciesMethodDescriptorSupplier + extends ApiHubDependenciesBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + ApiHubDependenciesMethodDescriptorSupplier(java.lang.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 (ApiHubDependenciesGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ApiHubDependenciesFileDescriptorSupplier()) + .addMethod(getCreateDependencyMethod()) + .addMethod(getGetDependencyMethod()) + .addMethod(getUpdateDependencyMethod()) + .addMethod(getDeleteDependencyMethod()) + .addMethod(getListDependenciesMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-apihub/grpc-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubGrpc.java b/java-apihub/grpc-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubGrpc.java new file mode 100644 index 000000000000..79e8a7ab17f8 --- /dev/null +++ b/java-apihub/grpc-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubGrpc.java @@ -0,0 +1,4664 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * This service provides all methods related to the API hub.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/apihub/v1/apihub_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class ApiHubGrpc { + + private ApiHubGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.apihub.v1.ApiHub"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateApiRequest, com.google.cloud.apihub.v1.Api> + getCreateApiMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateApi", + requestType = com.google.cloud.apihub.v1.CreateApiRequest.class, + responseType = com.google.cloud.apihub.v1.Api.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateApiRequest, com.google.cloud.apihub.v1.Api> + getCreateApiMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateApiRequest, com.google.cloud.apihub.v1.Api> + getCreateApiMethod; + if ((getCreateApiMethod = ApiHubGrpc.getCreateApiMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getCreateApiMethod = ApiHubGrpc.getCreateApiMethod) == null) { + ApiHubGrpc.getCreateApiMethod = + getCreateApiMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateApi")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.CreateApiRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.Api.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("CreateApi")) + .build(); + } + } + } + return getCreateApiMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetApiRequest, com.google.cloud.apihub.v1.Api> + getGetApiMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetApi", + requestType = com.google.cloud.apihub.v1.GetApiRequest.class, + responseType = com.google.cloud.apihub.v1.Api.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetApiRequest, com.google.cloud.apihub.v1.Api> + getGetApiMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetApiRequest, com.google.cloud.apihub.v1.Api> + getGetApiMethod; + if ((getGetApiMethod = ApiHubGrpc.getGetApiMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getGetApiMethod = ApiHubGrpc.getGetApiMethod) == null) { + ApiHubGrpc.getGetApiMethod = + getGetApiMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetApi")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.GetApiRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.Api.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("GetApi")) + .build(); + } + } + } + return getGetApiMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListApisRequest, com.google.cloud.apihub.v1.ListApisResponse> + getListApisMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListApis", + requestType = com.google.cloud.apihub.v1.ListApisRequest.class, + responseType = com.google.cloud.apihub.v1.ListApisResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListApisRequest, com.google.cloud.apihub.v1.ListApisResponse> + getListApisMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListApisRequest, com.google.cloud.apihub.v1.ListApisResponse> + getListApisMethod; + if ((getListApisMethod = ApiHubGrpc.getListApisMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getListApisMethod = ApiHubGrpc.getListApisMethod) == null) { + ApiHubGrpc.getListApisMethod = + getListApisMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListApis")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.ListApisRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.ListApisResponse.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("ListApis")) + .build(); + } + } + } + return getListApisMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.UpdateApiRequest, com.google.cloud.apihub.v1.Api> + getUpdateApiMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateApi", + requestType = com.google.cloud.apihub.v1.UpdateApiRequest.class, + responseType = com.google.cloud.apihub.v1.Api.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.UpdateApiRequest, com.google.cloud.apihub.v1.Api> + getUpdateApiMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.UpdateApiRequest, com.google.cloud.apihub.v1.Api> + getUpdateApiMethod; + if ((getUpdateApiMethod = ApiHubGrpc.getUpdateApiMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getUpdateApiMethod = ApiHubGrpc.getUpdateApiMethod) == null) { + ApiHubGrpc.getUpdateApiMethod = + getUpdateApiMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateApi")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.UpdateApiRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.Api.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("UpdateApi")) + .build(); + } + } + } + return getUpdateApiMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.DeleteApiRequest, com.google.protobuf.Empty> + getDeleteApiMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteApi", + requestType = com.google.cloud.apihub.v1.DeleteApiRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.DeleteApiRequest, com.google.protobuf.Empty> + getDeleteApiMethod() { + io.grpc.MethodDescriptor + getDeleteApiMethod; + if ((getDeleteApiMethod = ApiHubGrpc.getDeleteApiMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getDeleteApiMethod = ApiHubGrpc.getDeleteApiMethod) == null) { + ApiHubGrpc.getDeleteApiMethod = + getDeleteApiMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteApi")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.DeleteApiRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("DeleteApi")) + .build(); + } + } + } + return getDeleteApiMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateVersionRequest, com.google.cloud.apihub.v1.Version> + getCreateVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateVersion", + requestType = com.google.cloud.apihub.v1.CreateVersionRequest.class, + responseType = com.google.cloud.apihub.v1.Version.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateVersionRequest, com.google.cloud.apihub.v1.Version> + getCreateVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateVersionRequest, com.google.cloud.apihub.v1.Version> + getCreateVersionMethod; + if ((getCreateVersionMethod = ApiHubGrpc.getCreateVersionMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getCreateVersionMethod = ApiHubGrpc.getCreateVersionMethod) == null) { + ApiHubGrpc.getCreateVersionMethod = + getCreateVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.CreateVersionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.Version.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("CreateVersion")) + .build(); + } + } + } + return getCreateVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetVersionRequest, com.google.cloud.apihub.v1.Version> + getGetVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetVersion", + requestType = com.google.cloud.apihub.v1.GetVersionRequest.class, + responseType = com.google.cloud.apihub.v1.Version.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetVersionRequest, com.google.cloud.apihub.v1.Version> + getGetVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetVersionRequest, com.google.cloud.apihub.v1.Version> + getGetVersionMethod; + if ((getGetVersionMethod = ApiHubGrpc.getGetVersionMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getGetVersionMethod = ApiHubGrpc.getGetVersionMethod) == null) { + ApiHubGrpc.getGetVersionMethod = + getGetVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.GetVersionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.Version.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("GetVersion")) + .build(); + } + } + } + return getGetVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListVersionsRequest, + com.google.cloud.apihub.v1.ListVersionsResponse> + getListVersionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListVersions", + requestType = com.google.cloud.apihub.v1.ListVersionsRequest.class, + responseType = com.google.cloud.apihub.v1.ListVersionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListVersionsRequest, + com.google.cloud.apihub.v1.ListVersionsResponse> + getListVersionsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListVersionsRequest, + com.google.cloud.apihub.v1.ListVersionsResponse> + getListVersionsMethod; + if ((getListVersionsMethod = ApiHubGrpc.getListVersionsMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getListVersionsMethod = ApiHubGrpc.getListVersionsMethod) == null) { + ApiHubGrpc.getListVersionsMethod = + getListVersionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListVersions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.ListVersionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.ListVersionsResponse.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("ListVersions")) + .build(); + } + } + } + return getListVersionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.UpdateVersionRequest, com.google.cloud.apihub.v1.Version> + getUpdateVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateVersion", + requestType = com.google.cloud.apihub.v1.UpdateVersionRequest.class, + responseType = com.google.cloud.apihub.v1.Version.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.UpdateVersionRequest, com.google.cloud.apihub.v1.Version> + getUpdateVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.UpdateVersionRequest, com.google.cloud.apihub.v1.Version> + getUpdateVersionMethod; + if ((getUpdateVersionMethod = ApiHubGrpc.getUpdateVersionMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getUpdateVersionMethod = ApiHubGrpc.getUpdateVersionMethod) == null) { + ApiHubGrpc.getUpdateVersionMethod = + getUpdateVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.UpdateVersionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.Version.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("UpdateVersion")) + .build(); + } + } + } + return getUpdateVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.DeleteVersionRequest, com.google.protobuf.Empty> + getDeleteVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteVersion", + requestType = com.google.cloud.apihub.v1.DeleteVersionRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.DeleteVersionRequest, com.google.protobuf.Empty> + getDeleteVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.DeleteVersionRequest, com.google.protobuf.Empty> + getDeleteVersionMethod; + if ((getDeleteVersionMethod = ApiHubGrpc.getDeleteVersionMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getDeleteVersionMethod = ApiHubGrpc.getDeleteVersionMethod) == null) { + ApiHubGrpc.getDeleteVersionMethod = + getDeleteVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.DeleteVersionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("DeleteVersion")) + .build(); + } + } + } + return getDeleteVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateSpecRequest, com.google.cloud.apihub.v1.Spec> + getCreateSpecMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateSpec", + requestType = com.google.cloud.apihub.v1.CreateSpecRequest.class, + responseType = com.google.cloud.apihub.v1.Spec.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateSpecRequest, com.google.cloud.apihub.v1.Spec> + getCreateSpecMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateSpecRequest, com.google.cloud.apihub.v1.Spec> + getCreateSpecMethod; + if ((getCreateSpecMethod = ApiHubGrpc.getCreateSpecMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getCreateSpecMethod = ApiHubGrpc.getCreateSpecMethod) == null) { + ApiHubGrpc.getCreateSpecMethod = + getCreateSpecMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSpec")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.CreateSpecRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.Spec.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("CreateSpec")) + .build(); + } + } + } + return getCreateSpecMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetSpecRequest, com.google.cloud.apihub.v1.Spec> + getGetSpecMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSpec", + requestType = com.google.cloud.apihub.v1.GetSpecRequest.class, + responseType = com.google.cloud.apihub.v1.Spec.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetSpecRequest, com.google.cloud.apihub.v1.Spec> + getGetSpecMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetSpecRequest, com.google.cloud.apihub.v1.Spec> + getGetSpecMethod; + if ((getGetSpecMethod = ApiHubGrpc.getGetSpecMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getGetSpecMethod = ApiHubGrpc.getGetSpecMethod) == null) { + ApiHubGrpc.getGetSpecMethod = + getGetSpecMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSpec")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.GetSpecRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.Spec.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("GetSpec")) + .build(); + } + } + } + return getGetSpecMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetSpecContentsRequest, + com.google.cloud.apihub.v1.SpecContents> + getGetSpecContentsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSpecContents", + requestType = com.google.cloud.apihub.v1.GetSpecContentsRequest.class, + responseType = com.google.cloud.apihub.v1.SpecContents.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetSpecContentsRequest, + com.google.cloud.apihub.v1.SpecContents> + getGetSpecContentsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetSpecContentsRequest, + com.google.cloud.apihub.v1.SpecContents> + getGetSpecContentsMethod; + if ((getGetSpecContentsMethod = ApiHubGrpc.getGetSpecContentsMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getGetSpecContentsMethod = ApiHubGrpc.getGetSpecContentsMethod) == null) { + ApiHubGrpc.getGetSpecContentsMethod = + getGetSpecContentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSpecContents")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.GetSpecContentsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.SpecContents.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("GetSpecContents")) + .build(); + } + } + } + return getGetSpecContentsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListSpecsRequest, com.google.cloud.apihub.v1.ListSpecsResponse> + getListSpecsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSpecs", + requestType = com.google.cloud.apihub.v1.ListSpecsRequest.class, + responseType = com.google.cloud.apihub.v1.ListSpecsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListSpecsRequest, com.google.cloud.apihub.v1.ListSpecsResponse> + getListSpecsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListSpecsRequest, + com.google.cloud.apihub.v1.ListSpecsResponse> + getListSpecsMethod; + if ((getListSpecsMethod = ApiHubGrpc.getListSpecsMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getListSpecsMethod = ApiHubGrpc.getListSpecsMethod) == null) { + ApiHubGrpc.getListSpecsMethod = + getListSpecsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSpecs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.ListSpecsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.ListSpecsResponse.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("ListSpecs")) + .build(); + } + } + } + return getListSpecsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.UpdateSpecRequest, com.google.cloud.apihub.v1.Spec> + getUpdateSpecMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateSpec", + requestType = com.google.cloud.apihub.v1.UpdateSpecRequest.class, + responseType = com.google.cloud.apihub.v1.Spec.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.UpdateSpecRequest, com.google.cloud.apihub.v1.Spec> + getUpdateSpecMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.UpdateSpecRequest, com.google.cloud.apihub.v1.Spec> + getUpdateSpecMethod; + if ((getUpdateSpecMethod = ApiHubGrpc.getUpdateSpecMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getUpdateSpecMethod = ApiHubGrpc.getUpdateSpecMethod) == null) { + ApiHubGrpc.getUpdateSpecMethod = + getUpdateSpecMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateSpec")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.UpdateSpecRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.Spec.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("UpdateSpec")) + .build(); + } + } + } + return getUpdateSpecMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.DeleteSpecRequest, com.google.protobuf.Empty> + getDeleteSpecMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteSpec", + requestType = com.google.cloud.apihub.v1.DeleteSpecRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.DeleteSpecRequest, com.google.protobuf.Empty> + getDeleteSpecMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.DeleteSpecRequest, com.google.protobuf.Empty> + getDeleteSpecMethod; + if ((getDeleteSpecMethod = ApiHubGrpc.getDeleteSpecMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getDeleteSpecMethod = ApiHubGrpc.getDeleteSpecMethod) == null) { + ApiHubGrpc.getDeleteSpecMethod = + getDeleteSpecMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteSpec")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.DeleteSpecRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("DeleteSpec")) + .build(); + } + } + } + return getDeleteSpecMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetApiOperationRequest, + com.google.cloud.apihub.v1.ApiOperation> + getGetApiOperationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetApiOperation", + requestType = com.google.cloud.apihub.v1.GetApiOperationRequest.class, + responseType = com.google.cloud.apihub.v1.ApiOperation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetApiOperationRequest, + com.google.cloud.apihub.v1.ApiOperation> + getGetApiOperationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetApiOperationRequest, + com.google.cloud.apihub.v1.ApiOperation> + getGetApiOperationMethod; + if ((getGetApiOperationMethod = ApiHubGrpc.getGetApiOperationMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getGetApiOperationMethod = ApiHubGrpc.getGetApiOperationMethod) == null) { + ApiHubGrpc.getGetApiOperationMethod = + getGetApiOperationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetApiOperation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.GetApiOperationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.ApiOperation.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("GetApiOperation")) + .build(); + } + } + } + return getGetApiOperationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListApiOperationsRequest, + com.google.cloud.apihub.v1.ListApiOperationsResponse> + getListApiOperationsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListApiOperations", + requestType = com.google.cloud.apihub.v1.ListApiOperationsRequest.class, + responseType = com.google.cloud.apihub.v1.ListApiOperationsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListApiOperationsRequest, + com.google.cloud.apihub.v1.ListApiOperationsResponse> + getListApiOperationsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListApiOperationsRequest, + com.google.cloud.apihub.v1.ListApiOperationsResponse> + getListApiOperationsMethod; + if ((getListApiOperationsMethod = ApiHubGrpc.getListApiOperationsMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getListApiOperationsMethod = ApiHubGrpc.getListApiOperationsMethod) == null) { + ApiHubGrpc.getListApiOperationsMethod = + getListApiOperationsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListApiOperations")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.ListApiOperationsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.ListApiOperationsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("ListApiOperations")) + .build(); + } + } + } + return getListApiOperationsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetDefinitionRequest, com.google.cloud.apihub.v1.Definition> + getGetDefinitionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetDefinition", + requestType = com.google.cloud.apihub.v1.GetDefinitionRequest.class, + responseType = com.google.cloud.apihub.v1.Definition.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetDefinitionRequest, com.google.cloud.apihub.v1.Definition> + getGetDefinitionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetDefinitionRequest, com.google.cloud.apihub.v1.Definition> + getGetDefinitionMethod; + if ((getGetDefinitionMethod = ApiHubGrpc.getGetDefinitionMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getGetDefinitionMethod = ApiHubGrpc.getGetDefinitionMethod) == null) { + ApiHubGrpc.getGetDefinitionMethod = + getGetDefinitionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetDefinition")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.GetDefinitionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.Definition.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("GetDefinition")) + .build(); + } + } + } + return getGetDefinitionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateDeploymentRequest, com.google.cloud.apihub.v1.Deployment> + getCreateDeploymentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateDeployment", + requestType = com.google.cloud.apihub.v1.CreateDeploymentRequest.class, + responseType = com.google.cloud.apihub.v1.Deployment.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateDeploymentRequest, com.google.cloud.apihub.v1.Deployment> + getCreateDeploymentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateDeploymentRequest, + com.google.cloud.apihub.v1.Deployment> + getCreateDeploymentMethod; + if ((getCreateDeploymentMethod = ApiHubGrpc.getCreateDeploymentMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getCreateDeploymentMethod = ApiHubGrpc.getCreateDeploymentMethod) == null) { + ApiHubGrpc.getCreateDeploymentMethod = + getCreateDeploymentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateDeployment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.CreateDeploymentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.Deployment.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("CreateDeployment")) + .build(); + } + } + } + return getCreateDeploymentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetDeploymentRequest, com.google.cloud.apihub.v1.Deployment> + getGetDeploymentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetDeployment", + requestType = com.google.cloud.apihub.v1.GetDeploymentRequest.class, + responseType = com.google.cloud.apihub.v1.Deployment.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetDeploymentRequest, com.google.cloud.apihub.v1.Deployment> + getGetDeploymentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetDeploymentRequest, com.google.cloud.apihub.v1.Deployment> + getGetDeploymentMethod; + if ((getGetDeploymentMethod = ApiHubGrpc.getGetDeploymentMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getGetDeploymentMethod = ApiHubGrpc.getGetDeploymentMethod) == null) { + ApiHubGrpc.getGetDeploymentMethod = + getGetDeploymentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetDeployment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.GetDeploymentRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.Deployment.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("GetDeployment")) + .build(); + } + } + } + return getGetDeploymentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListDeploymentsRequest, + com.google.cloud.apihub.v1.ListDeploymentsResponse> + getListDeploymentsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListDeployments", + requestType = com.google.cloud.apihub.v1.ListDeploymentsRequest.class, + responseType = com.google.cloud.apihub.v1.ListDeploymentsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListDeploymentsRequest, + com.google.cloud.apihub.v1.ListDeploymentsResponse> + getListDeploymentsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListDeploymentsRequest, + com.google.cloud.apihub.v1.ListDeploymentsResponse> + getListDeploymentsMethod; + if ((getListDeploymentsMethod = ApiHubGrpc.getListDeploymentsMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getListDeploymentsMethod = ApiHubGrpc.getListDeploymentsMethod) == null) { + ApiHubGrpc.getListDeploymentsMethod = + getListDeploymentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListDeployments")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.ListDeploymentsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.ListDeploymentsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("ListDeployments")) + .build(); + } + } + } + return getListDeploymentsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.UpdateDeploymentRequest, com.google.cloud.apihub.v1.Deployment> + getUpdateDeploymentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateDeployment", + requestType = com.google.cloud.apihub.v1.UpdateDeploymentRequest.class, + responseType = com.google.cloud.apihub.v1.Deployment.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.UpdateDeploymentRequest, com.google.cloud.apihub.v1.Deployment> + getUpdateDeploymentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.UpdateDeploymentRequest, + com.google.cloud.apihub.v1.Deployment> + getUpdateDeploymentMethod; + if ((getUpdateDeploymentMethod = ApiHubGrpc.getUpdateDeploymentMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getUpdateDeploymentMethod = ApiHubGrpc.getUpdateDeploymentMethod) == null) { + ApiHubGrpc.getUpdateDeploymentMethod = + getUpdateDeploymentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateDeployment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.UpdateDeploymentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.Deployment.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("UpdateDeployment")) + .build(); + } + } + } + return getUpdateDeploymentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.DeleteDeploymentRequest, com.google.protobuf.Empty> + getDeleteDeploymentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteDeployment", + requestType = com.google.cloud.apihub.v1.DeleteDeploymentRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.DeleteDeploymentRequest, com.google.protobuf.Empty> + getDeleteDeploymentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.DeleteDeploymentRequest, com.google.protobuf.Empty> + getDeleteDeploymentMethod; + if ((getDeleteDeploymentMethod = ApiHubGrpc.getDeleteDeploymentMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getDeleteDeploymentMethod = ApiHubGrpc.getDeleteDeploymentMethod) == null) { + ApiHubGrpc.getDeleteDeploymentMethod = + getDeleteDeploymentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteDeployment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.DeleteDeploymentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("DeleteDeployment")) + .build(); + } + } + } + return getDeleteDeploymentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateAttributeRequest, com.google.cloud.apihub.v1.Attribute> + getCreateAttributeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateAttribute", + requestType = com.google.cloud.apihub.v1.CreateAttributeRequest.class, + responseType = com.google.cloud.apihub.v1.Attribute.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateAttributeRequest, com.google.cloud.apihub.v1.Attribute> + getCreateAttributeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateAttributeRequest, com.google.cloud.apihub.v1.Attribute> + getCreateAttributeMethod; + if ((getCreateAttributeMethod = ApiHubGrpc.getCreateAttributeMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getCreateAttributeMethod = ApiHubGrpc.getCreateAttributeMethod) == null) { + ApiHubGrpc.getCreateAttributeMethod = + getCreateAttributeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateAttribute")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.CreateAttributeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.Attribute.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("CreateAttribute")) + .build(); + } + } + } + return getCreateAttributeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetAttributeRequest, com.google.cloud.apihub.v1.Attribute> + getGetAttributeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetAttribute", + requestType = com.google.cloud.apihub.v1.GetAttributeRequest.class, + responseType = com.google.cloud.apihub.v1.Attribute.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetAttributeRequest, com.google.cloud.apihub.v1.Attribute> + getGetAttributeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetAttributeRequest, com.google.cloud.apihub.v1.Attribute> + getGetAttributeMethod; + if ((getGetAttributeMethod = ApiHubGrpc.getGetAttributeMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getGetAttributeMethod = ApiHubGrpc.getGetAttributeMethod) == null) { + ApiHubGrpc.getGetAttributeMethod = + getGetAttributeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetAttribute")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.GetAttributeRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.Attribute.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("GetAttribute")) + .build(); + } + } + } + return getGetAttributeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.UpdateAttributeRequest, com.google.cloud.apihub.v1.Attribute> + getUpdateAttributeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateAttribute", + requestType = com.google.cloud.apihub.v1.UpdateAttributeRequest.class, + responseType = com.google.cloud.apihub.v1.Attribute.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.UpdateAttributeRequest, com.google.cloud.apihub.v1.Attribute> + getUpdateAttributeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.UpdateAttributeRequest, com.google.cloud.apihub.v1.Attribute> + getUpdateAttributeMethod; + if ((getUpdateAttributeMethod = ApiHubGrpc.getUpdateAttributeMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getUpdateAttributeMethod = ApiHubGrpc.getUpdateAttributeMethod) == null) { + ApiHubGrpc.getUpdateAttributeMethod = + getUpdateAttributeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateAttribute")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.UpdateAttributeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.Attribute.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("UpdateAttribute")) + .build(); + } + } + } + return getUpdateAttributeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.DeleteAttributeRequest, com.google.protobuf.Empty> + getDeleteAttributeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteAttribute", + requestType = com.google.cloud.apihub.v1.DeleteAttributeRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.DeleteAttributeRequest, com.google.protobuf.Empty> + getDeleteAttributeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.DeleteAttributeRequest, com.google.protobuf.Empty> + getDeleteAttributeMethod; + if ((getDeleteAttributeMethod = ApiHubGrpc.getDeleteAttributeMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getDeleteAttributeMethod = ApiHubGrpc.getDeleteAttributeMethod) == null) { + ApiHubGrpc.getDeleteAttributeMethod = + getDeleteAttributeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteAttribute")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.DeleteAttributeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("DeleteAttribute")) + .build(); + } + } + } + return getDeleteAttributeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListAttributesRequest, + com.google.cloud.apihub.v1.ListAttributesResponse> + getListAttributesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListAttributes", + requestType = com.google.cloud.apihub.v1.ListAttributesRequest.class, + responseType = com.google.cloud.apihub.v1.ListAttributesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListAttributesRequest, + com.google.cloud.apihub.v1.ListAttributesResponse> + getListAttributesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListAttributesRequest, + com.google.cloud.apihub.v1.ListAttributesResponse> + getListAttributesMethod; + if ((getListAttributesMethod = ApiHubGrpc.getListAttributesMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getListAttributesMethod = ApiHubGrpc.getListAttributesMethod) == null) { + ApiHubGrpc.getListAttributesMethod = + getListAttributesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListAttributes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.ListAttributesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.ListAttributesResponse + .getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("ListAttributes")) + .build(); + } + } + } + return getListAttributesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.SearchResourcesRequest, + com.google.cloud.apihub.v1.SearchResourcesResponse> + getSearchResourcesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SearchResources", + requestType = com.google.cloud.apihub.v1.SearchResourcesRequest.class, + responseType = com.google.cloud.apihub.v1.SearchResourcesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.SearchResourcesRequest, + com.google.cloud.apihub.v1.SearchResourcesResponse> + getSearchResourcesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.SearchResourcesRequest, + com.google.cloud.apihub.v1.SearchResourcesResponse> + getSearchResourcesMethod; + if ((getSearchResourcesMethod = ApiHubGrpc.getSearchResourcesMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getSearchResourcesMethod = ApiHubGrpc.getSearchResourcesMethod) == null) { + ApiHubGrpc.getSearchResourcesMethod = + getSearchResourcesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SearchResources")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.SearchResourcesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.SearchResourcesResponse + .getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("SearchResources")) + .build(); + } + } + } + return getSearchResourcesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateExternalApiRequest, + com.google.cloud.apihub.v1.ExternalApi> + getCreateExternalApiMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateExternalApi", + requestType = com.google.cloud.apihub.v1.CreateExternalApiRequest.class, + responseType = com.google.cloud.apihub.v1.ExternalApi.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateExternalApiRequest, + com.google.cloud.apihub.v1.ExternalApi> + getCreateExternalApiMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateExternalApiRequest, + com.google.cloud.apihub.v1.ExternalApi> + getCreateExternalApiMethod; + if ((getCreateExternalApiMethod = ApiHubGrpc.getCreateExternalApiMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getCreateExternalApiMethod = ApiHubGrpc.getCreateExternalApiMethod) == null) { + ApiHubGrpc.getCreateExternalApiMethod = + getCreateExternalApiMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateExternalApi")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.CreateExternalApiRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.ExternalApi.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("CreateExternalApi")) + .build(); + } + } + } + return getCreateExternalApiMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetExternalApiRequest, com.google.cloud.apihub.v1.ExternalApi> + getGetExternalApiMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetExternalApi", + requestType = com.google.cloud.apihub.v1.GetExternalApiRequest.class, + responseType = com.google.cloud.apihub.v1.ExternalApi.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetExternalApiRequest, com.google.cloud.apihub.v1.ExternalApi> + getGetExternalApiMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetExternalApiRequest, + com.google.cloud.apihub.v1.ExternalApi> + getGetExternalApiMethod; + if ((getGetExternalApiMethod = ApiHubGrpc.getGetExternalApiMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getGetExternalApiMethod = ApiHubGrpc.getGetExternalApiMethod) == null) { + ApiHubGrpc.getGetExternalApiMethod = + getGetExternalApiMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetExternalApi")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.GetExternalApiRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.ExternalApi.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("GetExternalApi")) + .build(); + } + } + } + return getGetExternalApiMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.UpdateExternalApiRequest, + com.google.cloud.apihub.v1.ExternalApi> + getUpdateExternalApiMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateExternalApi", + requestType = com.google.cloud.apihub.v1.UpdateExternalApiRequest.class, + responseType = com.google.cloud.apihub.v1.ExternalApi.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.UpdateExternalApiRequest, + com.google.cloud.apihub.v1.ExternalApi> + getUpdateExternalApiMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.UpdateExternalApiRequest, + com.google.cloud.apihub.v1.ExternalApi> + getUpdateExternalApiMethod; + if ((getUpdateExternalApiMethod = ApiHubGrpc.getUpdateExternalApiMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getUpdateExternalApiMethod = ApiHubGrpc.getUpdateExternalApiMethod) == null) { + ApiHubGrpc.getUpdateExternalApiMethod = + getUpdateExternalApiMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateExternalApi")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.UpdateExternalApiRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.ExternalApi.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("UpdateExternalApi")) + .build(); + } + } + } + return getUpdateExternalApiMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.DeleteExternalApiRequest, com.google.protobuf.Empty> + getDeleteExternalApiMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteExternalApi", + requestType = com.google.cloud.apihub.v1.DeleteExternalApiRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.DeleteExternalApiRequest, com.google.protobuf.Empty> + getDeleteExternalApiMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.DeleteExternalApiRequest, com.google.protobuf.Empty> + getDeleteExternalApiMethod; + if ((getDeleteExternalApiMethod = ApiHubGrpc.getDeleteExternalApiMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getDeleteExternalApiMethod = ApiHubGrpc.getDeleteExternalApiMethod) == null) { + ApiHubGrpc.getDeleteExternalApiMethod = + getDeleteExternalApiMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteExternalApi")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.DeleteExternalApiRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("DeleteExternalApi")) + .build(); + } + } + } + return getDeleteExternalApiMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListExternalApisRequest, + com.google.cloud.apihub.v1.ListExternalApisResponse> + getListExternalApisMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListExternalApis", + requestType = com.google.cloud.apihub.v1.ListExternalApisRequest.class, + responseType = com.google.cloud.apihub.v1.ListExternalApisResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListExternalApisRequest, + com.google.cloud.apihub.v1.ListExternalApisResponse> + getListExternalApisMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListExternalApisRequest, + com.google.cloud.apihub.v1.ListExternalApisResponse> + getListExternalApisMethod; + if ((getListExternalApisMethod = ApiHubGrpc.getListExternalApisMethod) == null) { + synchronized (ApiHubGrpc.class) { + if ((getListExternalApisMethod = ApiHubGrpc.getListExternalApisMethod) == null) { + ApiHubGrpc.getListExternalApisMethod = + getListExternalApisMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListExternalApis")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.ListExternalApisRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.ListExternalApisResponse + .getDefaultInstance())) + .setSchemaDescriptor(new ApiHubMethodDescriptorSupplier("ListExternalApis")) + .build(); + } + } + } + return getListExternalApisMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ApiHubStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ApiHubStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ApiHubStub(channel, callOptions); + } + }; + return ApiHubStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ApiHubBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ApiHubBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ApiHubBlockingStub(channel, callOptions); + } + }; + return ApiHubBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ApiHubFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ApiHubFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ApiHubFutureStub(channel, callOptions); + } + }; + return ApiHubFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * This service provides all methods related to the API hub.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Create an API resource in the API hub.
+     * Once an API resource is created, versions can be added to it.
+     * 
+ */ + default void createApi( + com.google.cloud.apihub.v1.CreateApiRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateApiMethod(), responseObserver); + } + + /** + * + * + *
+     * Get API resource details including the API versions contained in it.
+     * 
+ */ + default void getApi( + com.google.cloud.apihub.v1.GetApiRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetApiMethod(), responseObserver); + } + + /** + * + * + *
+     * List API resources in the API hub.
+     * 
+ */ + default void listApis( + com.google.cloud.apihub.v1.ListApisRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListApisMethod(), responseObserver); + } + + /** + * + * + *
+     * Update an API resource in the API hub. The following fields in the
+     * [API][] can be updated:
+     * * [display_name][google.cloud.apihub.v1.Api.display_name]
+     * * [description][google.cloud.apihub.v1.Api.description]
+     * * [owner][google.cloud.apihub.v1.Api.owner]
+     * * [documentation][google.cloud.apihub.v1.Api.documentation]
+     * * [target_user][google.cloud.apihub.v1.Api.target_user]
+     * * [team][google.cloud.apihub.v1.Api.team]
+     * * [business_unit][google.cloud.apihub.v1.Api.business_unit]
+     * * [maturity_level][google.cloud.apihub.v1.Api.maturity_level]
+     * * [attributes][google.cloud.apihub.v1.Api.attributes]
+     * The
+     * [update_mask][google.cloud.apihub.v1.UpdateApiRequest.update_mask]
+     * should be used to specify the fields being updated.
+     * Updating the owner field requires complete owner message
+     * and updates both owner and email fields.
+     * 
+ */ + default void updateApi( + com.google.cloud.apihub.v1.UpdateApiRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateApiMethod(), responseObserver); + } + + /** + * + * + *
+     * Delete an API resource in the API hub. API can only be deleted if all
+     * underlying versions are deleted.
+     * 
+ */ + default void deleteApi( + com.google.cloud.apihub.v1.DeleteApiRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteApiMethod(), responseObserver); + } + + /** + * + * + *
+     * Create an API version for an API resource in the API hub.
+     * 
+ */ + default void createVersion( + com.google.cloud.apihub.v1.CreateVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Get details about the API version of an API resource. This will include
+     * information about the specs and operations present in the API
+     * version as well as the deployments linked to it.
+     * 
+ */ + default void getVersion( + com.google.cloud.apihub.v1.GetVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * List API versions of an API resource in the API hub.
+     * 
+ */ + default void listVersions( + com.google.cloud.apihub.v1.ListVersionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListVersionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Update API version. The following fields in the
+     * [version][google.cloud.apihub.v1.Version] can be updated currently:
+     * * [display_name][google.cloud.apihub.v1.Version.display_name]
+     * * [description][google.cloud.apihub.v1.Version.description]
+     * * [documentation][google.cloud.apihub.v1.Version.documentation]
+     * * [deployments][google.cloud.apihub.v1.Version.deployments]
+     * * [lifecycle][google.cloud.apihub.v1.Version.lifecycle]
+     * * [compliance][google.cloud.apihub.v1.Version.compliance]
+     * * [accreditation][google.cloud.apihub.v1.Version.accreditation]
+     * * [attributes][google.cloud.apihub.v1.Version.attributes]
+     * The
+     * [update_mask][google.cloud.apihub.v1.UpdateVersionRequest.update_mask]
+     * should be used to specify the fields being updated.
+     * 
+ */ + default void updateVersion( + com.google.cloud.apihub.v1.UpdateVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Delete an API version. Version can only be deleted if all underlying specs,
+     * operations, definitions and linked deployments are deleted.
+     * 
+ */ + default void deleteVersion( + com.google.cloud.apihub.v1.DeleteVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Add a spec to an API version in the API hub.
+     * Multiple specs can be added to an API version.
+     * Note, while adding a spec, at least one of `contents` or `source_uri` must
+     * be provided. If `contents` is provided, then `spec_type` must also be
+     * provided.
+     * On adding a spec with contents to the version, the operations present in it
+     * will be added to the version.Note that the file contents in the spec should
+     * be of the same type as defined in the
+     * `projects/{project}/locations/{location}/attributes/system-spec-type`
+     * attribute associated with spec resource. Note that specs of various types
+     * can be uploaded, however parsing of details is supported for OpenAPI spec
+     * currently.
+     * In order to access the information parsed from the spec, use the
+     * [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method.
+     * In order to access the raw contents for a particular spec, use the
+     * [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method.
+     * In order to access the operations parsed from the spec, use the
+     * [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
+     * method.
+     * 
+ */ + default void createSpec( + com.google.cloud.apihub.v1.CreateSpecRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateSpecMethod(), responseObserver); + } + + /** + * + * + *
+     * Get details about the information parsed from a spec.
+     * Note that this method does not return the raw spec contents.
+     * Use [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method
+     * to retrieve the same.
+     * 
+ */ + default void getSpec( + com.google.cloud.apihub.v1.GetSpecRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSpecMethod(), responseObserver); + } + + /** + * + * + *
+     * Get spec contents.
+     * 
+ */ + default void getSpecContents( + com.google.cloud.apihub.v1.GetSpecContentsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetSpecContentsMethod(), responseObserver); + } + + /** + * + * + *
+     * List specs corresponding to a particular API resource.
+     * 
+ */ + default void listSpecs( + com.google.cloud.apihub.v1.ListSpecsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListSpecsMethod(), responseObserver); + } + + /** + * + * + *
+     * Update spec. The following fields in the
+     * [spec][google.cloud.apihub.v1.Spec] can be updated:
+     * * [display_name][google.cloud.apihub.v1.Spec.display_name]
+     * * [source_uri][google.cloud.apihub.v1.Spec.source_uri]
+     * * [lint_response][google.cloud.apihub.v1.Spec.lint_response]
+     * * [attributes][google.cloud.apihub.v1.Spec.attributes]
+     * * [contents][google.cloud.apihub.v1.Spec.contents]
+     * * [spec_type][google.cloud.apihub.v1.Spec.spec_type]
+     * In case of an OAS spec, updating spec contents can lead to:
+     * 1. Creation, deletion and update of operations.
+     * 2. Creation, deletion and update of definitions.
+     * 3. Update of other info parsed out from the new spec.
+     * In case of contents or source_uri being present in update mask, spec_type
+     * must also be present. Also, spec_type can not be present in update mask if
+     * contents or source_uri is not present.
+     * The
+     * [update_mask][google.cloud.apihub.v1.UpdateSpecRequest.update_mask]
+     * should be used to specify the fields being updated.
+     * 
+ */ + default void updateSpec( + com.google.cloud.apihub.v1.UpdateSpecRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateSpecMethod(), responseObserver); + } + + /** + * + * + *
+     * Delete a spec.
+     * Deleting a spec will also delete the associated operations from the
+     * version.
+     * 
+ */ + default void deleteSpec( + com.google.cloud.apihub.v1.DeleteSpecRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteSpecMethod(), responseObserver); + } + + /** + * + * + *
+     * Get details about a particular operation in API version.
+     * 
+ */ + default void getApiOperation( + com.google.cloud.apihub.v1.GetApiOperationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetApiOperationMethod(), responseObserver); + } + + /** + * + * + *
+     * List operations in an API version.
+     * 
+ */ + default void listApiOperations( + com.google.cloud.apihub.v1.ListApiOperationsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListApiOperationsMethod(), responseObserver); + } + + /** + * + * + *
+     * Get details about a definition in an API version.
+     * 
+ */ + default void getDefinition( + com.google.cloud.apihub.v1.GetDefinitionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetDefinitionMethod(), responseObserver); + } + + /** + * + * + *
+     * Create a deployment resource in the API hub.
+     * Once a deployment resource is created, it can be associated with API
+     * versions.
+     * 
+ */ + default void createDeployment( + com.google.cloud.apihub.v1.CreateDeploymentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateDeploymentMethod(), responseObserver); + } + + /** + * + * + *
+     * Get details about a deployment and the API versions linked to it.
+     * 
+ */ + default void getDeployment( + com.google.cloud.apihub.v1.GetDeploymentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetDeploymentMethod(), responseObserver); + } + + /** + * + * + *
+     * List deployment resources in the API hub.
+     * 
+ */ + default void listDeployments( + com.google.cloud.apihub.v1.ListDeploymentsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListDeploymentsMethod(), responseObserver); + } + + /** + * + * + *
+     * Update a deployment resource in the API hub. The following fields in the
+     * [deployment resource][google.cloud.apihub.v1.Deployment] can be
+     * updated:
+     * * [display_name][google.cloud.apihub.v1.Deployment.display_name]
+     * * [description][google.cloud.apihub.v1.Deployment.description]
+     * * [documentation][google.cloud.apihub.v1.Deployment.documentation]
+     * * [deployment_type][google.cloud.apihub.v1.Deployment.deployment_type]
+     * * [resource_uri][google.cloud.apihub.v1.Deployment.resource_uri]
+     * * [endpoints][google.cloud.apihub.v1.Deployment.endpoints]
+     * * [slo][google.cloud.apihub.v1.Deployment.slo]
+     * * [environment][google.cloud.apihub.v1.Deployment.environment]
+     * * [attributes][google.cloud.apihub.v1.Deployment.attributes]
+     * The
+     * [update_mask][google.cloud.apihub.v1.UpdateDeploymentRequest.update_mask]
+     * should be used to specify the fields being updated.
+     * 
+ */ + default void updateDeployment( + com.google.cloud.apihub.v1.UpdateDeploymentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateDeploymentMethod(), responseObserver); + } + + /** + * + * + *
+     * Delete a deployment resource in the API hub.
+     * 
+ */ + default void deleteDeployment( + com.google.cloud.apihub.v1.DeleteDeploymentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteDeploymentMethod(), responseObserver); + } + + /** + * + * + *
+     * Create a user defined attribute.
+     * Certain pre defined attributes are already created by the API hub. These
+     * attributes will have type as `SYSTEM_DEFINED` and can be listed via
+     * [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method.
+     * Allowed values for the same can be updated via
+     * [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] method.
+     * 
+ */ + default void createAttribute( + com.google.cloud.apihub.v1.CreateAttributeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateAttributeMethod(), responseObserver); + } + + /** + * + * + *
+     * Get details about the attribute.
+     * 
+ */ + default void getAttribute( + com.google.cloud.apihub.v1.GetAttributeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetAttributeMethod(), responseObserver); + } + + /** + * + * + *
+     * Update the attribute.  The following fields in the
+     * [Attribute resource][google.cloud.apihub.v1.Attribute] can be updated:
+     * * [display_name][google.cloud.apihub.v1.Attribute.display_name]
+     * The display name can be updated for user defined attributes only.
+     * * [description][google.cloud.apihub.v1.Attribute.description]
+     * The description can be updated for user defined attributes only.
+     * * [allowed_values][google.cloud.apihub.v1.Attribute.allowed_values]
+     * To update the list of allowed values, clients need to use the fetched list
+     * of allowed values and add or remove values to or from the same list.
+     * The mutable allowed values can be updated for both user defined and System
+     * defined attributes. The immutable allowed values cannot be updated or
+     * deleted. The updated list of allowed values cannot be empty. If an allowed
+     * value that is already used by some resource's attribute is deleted, then
+     * the association between the resource and the attribute value will also be
+     * deleted.
+     * * [cardinality][google.cloud.apihub.v1.Attribute.cardinality]
+     * The cardinality can be updated for user defined attributes only.
+     * Cardinality can only be increased during an update.
+     * The
+     * [update_mask][google.cloud.apihub.v1.UpdateAttributeRequest.update_mask]
+     * should be used to specify the fields being updated.
+     * 
+ */ + default void updateAttribute( + com.google.cloud.apihub.v1.UpdateAttributeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateAttributeMethod(), responseObserver); + } + + /** + * + * + *
+     * Delete an attribute.
+     * Note: System defined attributes cannot be deleted. All
+     * associations of the attribute being deleted with any API hub resource will
+     * also get deleted.
+     * 
+ */ + default void deleteAttribute( + com.google.cloud.apihub.v1.DeleteAttributeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteAttributeMethod(), responseObserver); + } + + /** + * + * + *
+     * List all attributes.
+     * 
+ */ + default void listAttributes( + com.google.cloud.apihub.v1.ListAttributesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListAttributesMethod(), responseObserver); + } + + /** + * + * + *
+     * Search across API-Hub resources.
+     * 
+ */ + default void searchResources( + com.google.cloud.apihub.v1.SearchResourcesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSearchResourcesMethod(), responseObserver); + } + + /** + * + * + *
+     * Create an External API resource in the API hub.
+     * 
+ */ + default void createExternalApi( + com.google.cloud.apihub.v1.CreateExternalApiRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateExternalApiMethod(), responseObserver); + } + + /** + * + * + *
+     * Get details about an External API resource in the API hub.
+     * 
+ */ + default void getExternalApi( + com.google.cloud.apihub.v1.GetExternalApiRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetExternalApiMethod(), responseObserver); + } + + /** + * + * + *
+     * Update an External API resource in the API hub. The following fields can be
+     * updated:
+     * * [display_name][google.cloud.apihub.v1.ExternalApi.display_name]
+     * * [description][google.cloud.apihub.v1.ExternalApi.description]
+     * * [documentation][google.cloud.apihub.v1.ExternalApi.documentation]
+     * * [endpoints][google.cloud.apihub.v1.ExternalApi.endpoints]
+     * * [paths][google.cloud.apihub.v1.ExternalApi.paths]
+     * The
+     * [update_mask][google.cloud.apihub.v1.UpdateExternalApiRequest.update_mask]
+     * should be used to specify the fields being updated.
+     * 
+ */ + default void updateExternalApi( + com.google.cloud.apihub.v1.UpdateExternalApiRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateExternalApiMethod(), responseObserver); + } + + /** + * + * + *
+     * Delete an External API resource in the API hub.
+     * 
+ */ + default void deleteExternalApi( + com.google.cloud.apihub.v1.DeleteExternalApiRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteExternalApiMethod(), responseObserver); + } + + /** + * + * + *
+     * List External API resources in the API hub.
+     * 
+ */ + default void listExternalApis( + com.google.cloud.apihub.v1.ListExternalApisRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListExternalApisMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service ApiHub. + * + *
+   * This service provides all methods related to the API hub.
+   * 
+ */ + public abstract static class ApiHubImplBase implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return ApiHubGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service ApiHub. + * + *
+   * This service provides all methods related to the API hub.
+   * 
+ */ + public static final class ApiHubStub extends io.grpc.stub.AbstractAsyncStub { + private ApiHubStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ApiHubStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ApiHubStub(channel, callOptions); + } + + /** + * + * + *
+     * Create an API resource in the API hub.
+     * Once an API resource is created, versions can be added to it.
+     * 
+ */ + public void createApi( + com.google.cloud.apihub.v1.CreateApiRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateApiMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Get API resource details including the API versions contained in it.
+     * 
+ */ + public void getApi( + com.google.cloud.apihub.v1.GetApiRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetApiMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * List API resources in the API hub.
+     * 
+ */ + public void listApis( + com.google.cloud.apihub.v1.ListApisRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListApisMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Update an API resource in the API hub. The following fields in the
+     * [API][] can be updated:
+     * * [display_name][google.cloud.apihub.v1.Api.display_name]
+     * * [description][google.cloud.apihub.v1.Api.description]
+     * * [owner][google.cloud.apihub.v1.Api.owner]
+     * * [documentation][google.cloud.apihub.v1.Api.documentation]
+     * * [target_user][google.cloud.apihub.v1.Api.target_user]
+     * * [team][google.cloud.apihub.v1.Api.team]
+     * * [business_unit][google.cloud.apihub.v1.Api.business_unit]
+     * * [maturity_level][google.cloud.apihub.v1.Api.maturity_level]
+     * * [attributes][google.cloud.apihub.v1.Api.attributes]
+     * The
+     * [update_mask][google.cloud.apihub.v1.UpdateApiRequest.update_mask]
+     * should be used to specify the fields being updated.
+     * Updating the owner field requires complete owner message
+     * and updates both owner and email fields.
+     * 
+ */ + public void updateApi( + com.google.cloud.apihub.v1.UpdateApiRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateApiMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Delete an API resource in the API hub. API can only be deleted if all
+     * underlying versions are deleted.
+     * 
+ */ + public void deleteApi( + com.google.cloud.apihub.v1.DeleteApiRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteApiMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Create an API version for an API resource in the API hub.
+     * 
+ */ + public void createVersion( + com.google.cloud.apihub.v1.CreateVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateVersionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Get details about the API version of an API resource. This will include
+     * information about the specs and operations present in the API
+     * version as well as the deployments linked to it.
+     * 
+ */ + public void getVersion( + com.google.cloud.apihub.v1.GetVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetVersionMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * List API versions of an API resource in the API hub.
+     * 
+ */ + public void listVersions( + com.google.cloud.apihub.v1.ListVersionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListVersionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Update API version. The following fields in the
+     * [version][google.cloud.apihub.v1.Version] can be updated currently:
+     * * [display_name][google.cloud.apihub.v1.Version.display_name]
+     * * [description][google.cloud.apihub.v1.Version.description]
+     * * [documentation][google.cloud.apihub.v1.Version.documentation]
+     * * [deployments][google.cloud.apihub.v1.Version.deployments]
+     * * [lifecycle][google.cloud.apihub.v1.Version.lifecycle]
+     * * [compliance][google.cloud.apihub.v1.Version.compliance]
+     * * [accreditation][google.cloud.apihub.v1.Version.accreditation]
+     * * [attributes][google.cloud.apihub.v1.Version.attributes]
+     * The
+     * [update_mask][google.cloud.apihub.v1.UpdateVersionRequest.update_mask]
+     * should be used to specify the fields being updated.
+     * 
+ */ + public void updateVersion( + com.google.cloud.apihub.v1.UpdateVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateVersionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Delete an API version. Version can only be deleted if all underlying specs,
+     * operations, definitions and linked deployments are deleted.
+     * 
+ */ + public void deleteVersion( + com.google.cloud.apihub.v1.DeleteVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteVersionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Add a spec to an API version in the API hub.
+     * Multiple specs can be added to an API version.
+     * Note, while adding a spec, at least one of `contents` or `source_uri` must
+     * be provided. If `contents` is provided, then `spec_type` must also be
+     * provided.
+     * On adding a spec with contents to the version, the operations present in it
+     * will be added to the version.Note that the file contents in the spec should
+     * be of the same type as defined in the
+     * `projects/{project}/locations/{location}/attributes/system-spec-type`
+     * attribute associated with spec resource. Note that specs of various types
+     * can be uploaded, however parsing of details is supported for OpenAPI spec
+     * currently.
+     * In order to access the information parsed from the spec, use the
+     * [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method.
+     * In order to access the raw contents for a particular spec, use the
+     * [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method.
+     * In order to access the operations parsed from the spec, use the
+     * [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
+     * method.
+     * 
+ */ + public void createSpec( + com.google.cloud.apihub.v1.CreateSpecRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateSpecMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Get details about the information parsed from a spec.
+     * Note that this method does not return the raw spec contents.
+     * Use [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method
+     * to retrieve the same.
+     * 
+ */ + public void getSpec( + com.google.cloud.apihub.v1.GetSpecRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSpecMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Get spec contents.
+     * 
+ */ + public void getSpecContents( + com.google.cloud.apihub.v1.GetSpecContentsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSpecContentsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * List specs corresponding to a particular API resource.
+     * 
+ */ + public void listSpecs( + com.google.cloud.apihub.v1.ListSpecsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSpecsMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Update spec. The following fields in the
+     * [spec][google.cloud.apihub.v1.Spec] can be updated:
+     * * [display_name][google.cloud.apihub.v1.Spec.display_name]
+     * * [source_uri][google.cloud.apihub.v1.Spec.source_uri]
+     * * [lint_response][google.cloud.apihub.v1.Spec.lint_response]
+     * * [attributes][google.cloud.apihub.v1.Spec.attributes]
+     * * [contents][google.cloud.apihub.v1.Spec.contents]
+     * * [spec_type][google.cloud.apihub.v1.Spec.spec_type]
+     * In case of an OAS spec, updating spec contents can lead to:
+     * 1. Creation, deletion and update of operations.
+     * 2. Creation, deletion and update of definitions.
+     * 3. Update of other info parsed out from the new spec.
+     * In case of contents or source_uri being present in update mask, spec_type
+     * must also be present. Also, spec_type can not be present in update mask if
+     * contents or source_uri is not present.
+     * The
+     * [update_mask][google.cloud.apihub.v1.UpdateSpecRequest.update_mask]
+     * should be used to specify the fields being updated.
+     * 
+ */ + public void updateSpec( + com.google.cloud.apihub.v1.UpdateSpecRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateSpecMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Delete a spec.
+     * Deleting a spec will also delete the associated operations from the
+     * version.
+     * 
+ */ + public void deleteSpec( + com.google.cloud.apihub.v1.DeleteSpecRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteSpecMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Get details about a particular operation in API version.
+     * 
+ */ + public void getApiOperation( + com.google.cloud.apihub.v1.GetApiOperationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetApiOperationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * List operations in an API version.
+     * 
+ */ + public void listApiOperations( + com.google.cloud.apihub.v1.ListApiOperationsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListApiOperationsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Get details about a definition in an API version.
+     * 
+ */ + public void getDefinition( + com.google.cloud.apihub.v1.GetDefinitionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetDefinitionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Create a deployment resource in the API hub.
+     * Once a deployment resource is created, it can be associated with API
+     * versions.
+     * 
+ */ + public void createDeployment( + com.google.cloud.apihub.v1.CreateDeploymentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateDeploymentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Get details about a deployment and the API versions linked to it.
+     * 
+ */ + public void getDeployment( + com.google.cloud.apihub.v1.GetDeploymentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetDeploymentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * List deployment resources in the API hub.
+     * 
+ */ + public void listDeployments( + com.google.cloud.apihub.v1.ListDeploymentsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListDeploymentsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Update a deployment resource in the API hub. The following fields in the
+     * [deployment resource][google.cloud.apihub.v1.Deployment] can be
+     * updated:
+     * * [display_name][google.cloud.apihub.v1.Deployment.display_name]
+     * * [description][google.cloud.apihub.v1.Deployment.description]
+     * * [documentation][google.cloud.apihub.v1.Deployment.documentation]
+     * * [deployment_type][google.cloud.apihub.v1.Deployment.deployment_type]
+     * * [resource_uri][google.cloud.apihub.v1.Deployment.resource_uri]
+     * * [endpoints][google.cloud.apihub.v1.Deployment.endpoints]
+     * * [slo][google.cloud.apihub.v1.Deployment.slo]
+     * * [environment][google.cloud.apihub.v1.Deployment.environment]
+     * * [attributes][google.cloud.apihub.v1.Deployment.attributes]
+     * The
+     * [update_mask][google.cloud.apihub.v1.UpdateDeploymentRequest.update_mask]
+     * should be used to specify the fields being updated.
+     * 
+ */ + public void updateDeployment( + com.google.cloud.apihub.v1.UpdateDeploymentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateDeploymentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Delete a deployment resource in the API hub.
+     * 
+ */ + public void deleteDeployment( + com.google.cloud.apihub.v1.DeleteDeploymentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteDeploymentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Create a user defined attribute.
+     * Certain pre defined attributes are already created by the API hub. These
+     * attributes will have type as `SYSTEM_DEFINED` and can be listed via
+     * [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method.
+     * Allowed values for the same can be updated via
+     * [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] method.
+     * 
+ */ + public void createAttribute( + com.google.cloud.apihub.v1.CreateAttributeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateAttributeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Get details about the attribute.
+     * 
+ */ + public void getAttribute( + com.google.cloud.apihub.v1.GetAttributeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetAttributeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Update the attribute.  The following fields in the
+     * [Attribute resource][google.cloud.apihub.v1.Attribute] can be updated:
+     * * [display_name][google.cloud.apihub.v1.Attribute.display_name]
+     * The display name can be updated for user defined attributes only.
+     * * [description][google.cloud.apihub.v1.Attribute.description]
+     * The description can be updated for user defined attributes only.
+     * * [allowed_values][google.cloud.apihub.v1.Attribute.allowed_values]
+     * To update the list of allowed values, clients need to use the fetched list
+     * of allowed values and add or remove values to or from the same list.
+     * The mutable allowed values can be updated for both user defined and System
+     * defined attributes. The immutable allowed values cannot be updated or
+     * deleted. The updated list of allowed values cannot be empty. If an allowed
+     * value that is already used by some resource's attribute is deleted, then
+     * the association between the resource and the attribute value will also be
+     * deleted.
+     * * [cardinality][google.cloud.apihub.v1.Attribute.cardinality]
+     * The cardinality can be updated for user defined attributes only.
+     * Cardinality can only be increased during an update.
+     * The
+     * [update_mask][google.cloud.apihub.v1.UpdateAttributeRequest.update_mask]
+     * should be used to specify the fields being updated.
+     * 
+ */ + public void updateAttribute( + com.google.cloud.apihub.v1.UpdateAttributeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateAttributeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Delete an attribute.
+     * Note: System defined attributes cannot be deleted. All
+     * associations of the attribute being deleted with any API hub resource will
+     * also get deleted.
+     * 
+ */ + public void deleteAttribute( + com.google.cloud.apihub.v1.DeleteAttributeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteAttributeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * List all attributes.
+     * 
+ */ + public void listAttributes( + com.google.cloud.apihub.v1.ListAttributesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListAttributesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Search across API-Hub resources.
+     * 
+ */ + public void searchResources( + com.google.cloud.apihub.v1.SearchResourcesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSearchResourcesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Create an External API resource in the API hub.
+     * 
+ */ + public void createExternalApi( + com.google.cloud.apihub.v1.CreateExternalApiRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateExternalApiMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Get details about an External API resource in the API hub.
+     * 
+ */ + public void getExternalApi( + com.google.cloud.apihub.v1.GetExternalApiRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetExternalApiMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Update an External API resource in the API hub. The following fields can be
+     * updated:
+     * * [display_name][google.cloud.apihub.v1.ExternalApi.display_name]
+     * * [description][google.cloud.apihub.v1.ExternalApi.description]
+     * * [documentation][google.cloud.apihub.v1.ExternalApi.documentation]
+     * * [endpoints][google.cloud.apihub.v1.ExternalApi.endpoints]
+     * * [paths][google.cloud.apihub.v1.ExternalApi.paths]
+     * The
+     * [update_mask][google.cloud.apihub.v1.UpdateExternalApiRequest.update_mask]
+     * should be used to specify the fields being updated.
+     * 
+ */ + public void updateExternalApi( + com.google.cloud.apihub.v1.UpdateExternalApiRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateExternalApiMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Delete an External API resource in the API hub.
+     * 
+ */ + public void deleteExternalApi( + com.google.cloud.apihub.v1.DeleteExternalApiRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteExternalApiMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * List External API resources in the API hub.
+     * 
+ */ + public void listExternalApis( + com.google.cloud.apihub.v1.ListExternalApisRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListExternalApisMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service ApiHub. + * + *
+   * This service provides all methods related to the API hub.
+   * 
+ */ + public static final class ApiHubBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private ApiHubBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ApiHubBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ApiHubBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Create an API resource in the API hub.
+     * Once an API resource is created, versions can be added to it.
+     * 
+ */ + public com.google.cloud.apihub.v1.Api createApi( + com.google.cloud.apihub.v1.CreateApiRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateApiMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get API resource details including the API versions contained in it.
+     * 
+ */ + public com.google.cloud.apihub.v1.Api getApi(com.google.cloud.apihub.v1.GetApiRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetApiMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * List API resources in the API hub.
+     * 
+ */ + public com.google.cloud.apihub.v1.ListApisResponse listApis( + com.google.cloud.apihub.v1.ListApisRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListApisMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Update an API resource in the API hub. The following fields in the
+     * [API][] can be updated:
+     * * [display_name][google.cloud.apihub.v1.Api.display_name]
+     * * [description][google.cloud.apihub.v1.Api.description]
+     * * [owner][google.cloud.apihub.v1.Api.owner]
+     * * [documentation][google.cloud.apihub.v1.Api.documentation]
+     * * [target_user][google.cloud.apihub.v1.Api.target_user]
+     * * [team][google.cloud.apihub.v1.Api.team]
+     * * [business_unit][google.cloud.apihub.v1.Api.business_unit]
+     * * [maturity_level][google.cloud.apihub.v1.Api.maturity_level]
+     * * [attributes][google.cloud.apihub.v1.Api.attributes]
+     * The
+     * [update_mask][google.cloud.apihub.v1.UpdateApiRequest.update_mask]
+     * should be used to specify the fields being updated.
+     * Updating the owner field requires complete owner message
+     * and updates both owner and email fields.
+     * 
+ */ + public com.google.cloud.apihub.v1.Api updateApi( + com.google.cloud.apihub.v1.UpdateApiRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateApiMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Delete an API resource in the API hub. API can only be deleted if all
+     * underlying versions are deleted.
+     * 
+ */ + public com.google.protobuf.Empty deleteApi( + com.google.cloud.apihub.v1.DeleteApiRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteApiMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Create an API version for an API resource in the API hub.
+     * 
+ */ + public com.google.cloud.apihub.v1.Version createVersion( + com.google.cloud.apihub.v1.CreateVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get details about the API version of an API resource. This will include
+     * information about the specs and operations present in the API
+     * version as well as the deployments linked to it.
+     * 
+ */ + public com.google.cloud.apihub.v1.Version getVersion( + com.google.cloud.apihub.v1.GetVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * List API versions of an API resource in the API hub.
+     * 
+ */ + public com.google.cloud.apihub.v1.ListVersionsResponse listVersions( + com.google.cloud.apihub.v1.ListVersionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListVersionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Update API version. The following fields in the
+     * [version][google.cloud.apihub.v1.Version] can be updated currently:
+     * * [display_name][google.cloud.apihub.v1.Version.display_name]
+     * * [description][google.cloud.apihub.v1.Version.description]
+     * * [documentation][google.cloud.apihub.v1.Version.documentation]
+     * * [deployments][google.cloud.apihub.v1.Version.deployments]
+     * * [lifecycle][google.cloud.apihub.v1.Version.lifecycle]
+     * * [compliance][google.cloud.apihub.v1.Version.compliance]
+     * * [accreditation][google.cloud.apihub.v1.Version.accreditation]
+     * * [attributes][google.cloud.apihub.v1.Version.attributes]
+     * The
+     * [update_mask][google.cloud.apihub.v1.UpdateVersionRequest.update_mask]
+     * should be used to specify the fields being updated.
+     * 
+ */ + public com.google.cloud.apihub.v1.Version updateVersion( + com.google.cloud.apihub.v1.UpdateVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Delete an API version. Version can only be deleted if all underlying specs,
+     * operations, definitions and linked deployments are deleted.
+     * 
+ */ + public com.google.protobuf.Empty deleteVersion( + com.google.cloud.apihub.v1.DeleteVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Add a spec to an API version in the API hub.
+     * Multiple specs can be added to an API version.
+     * Note, while adding a spec, at least one of `contents` or `source_uri` must
+     * be provided. If `contents` is provided, then `spec_type` must also be
+     * provided.
+     * On adding a spec with contents to the version, the operations present in it
+     * will be added to the version.Note that the file contents in the spec should
+     * be of the same type as defined in the
+     * `projects/{project}/locations/{location}/attributes/system-spec-type`
+     * attribute associated with spec resource. Note that specs of various types
+     * can be uploaded, however parsing of details is supported for OpenAPI spec
+     * currently.
+     * In order to access the information parsed from the spec, use the
+     * [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method.
+     * In order to access the raw contents for a particular spec, use the
+     * [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method.
+     * In order to access the operations parsed from the spec, use the
+     * [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
+     * method.
+     * 
+ */ + public com.google.cloud.apihub.v1.Spec createSpec( + com.google.cloud.apihub.v1.CreateSpecRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSpecMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get details about the information parsed from a spec.
+     * Note that this method does not return the raw spec contents.
+     * Use [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method
+     * to retrieve the same.
+     * 
+ */ + public com.google.cloud.apihub.v1.Spec getSpec( + com.google.cloud.apihub.v1.GetSpecRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSpecMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get spec contents.
+     * 
+ */ + public com.google.cloud.apihub.v1.SpecContents getSpecContents( + com.google.cloud.apihub.v1.GetSpecContentsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSpecContentsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * List specs corresponding to a particular API resource.
+     * 
+ */ + public com.google.cloud.apihub.v1.ListSpecsResponse listSpecs( + com.google.cloud.apihub.v1.ListSpecsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSpecsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Update spec. The following fields in the
+     * [spec][google.cloud.apihub.v1.Spec] can be updated:
+     * * [display_name][google.cloud.apihub.v1.Spec.display_name]
+     * * [source_uri][google.cloud.apihub.v1.Spec.source_uri]
+     * * [lint_response][google.cloud.apihub.v1.Spec.lint_response]
+     * * [attributes][google.cloud.apihub.v1.Spec.attributes]
+     * * [contents][google.cloud.apihub.v1.Spec.contents]
+     * * [spec_type][google.cloud.apihub.v1.Spec.spec_type]
+     * In case of an OAS spec, updating spec contents can lead to:
+     * 1. Creation, deletion and update of operations.
+     * 2. Creation, deletion and update of definitions.
+     * 3. Update of other info parsed out from the new spec.
+     * In case of contents or source_uri being present in update mask, spec_type
+     * must also be present. Also, spec_type can not be present in update mask if
+     * contents or source_uri is not present.
+     * The
+     * [update_mask][google.cloud.apihub.v1.UpdateSpecRequest.update_mask]
+     * should be used to specify the fields being updated.
+     * 
+ */ + public com.google.cloud.apihub.v1.Spec updateSpec( + com.google.cloud.apihub.v1.UpdateSpecRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateSpecMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Delete a spec.
+     * Deleting a spec will also delete the associated operations from the
+     * version.
+     * 
+ */ + public com.google.protobuf.Empty deleteSpec( + com.google.cloud.apihub.v1.DeleteSpecRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteSpecMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get details about a particular operation in API version.
+     * 
+ */ + public com.google.cloud.apihub.v1.ApiOperation getApiOperation( + com.google.cloud.apihub.v1.GetApiOperationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetApiOperationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * List operations in an API version.
+     * 
+ */ + public com.google.cloud.apihub.v1.ListApiOperationsResponse listApiOperations( + com.google.cloud.apihub.v1.ListApiOperationsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListApiOperationsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get details about a definition in an API version.
+     * 
+ */ + public com.google.cloud.apihub.v1.Definition getDefinition( + com.google.cloud.apihub.v1.GetDefinitionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetDefinitionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Create a deployment resource in the API hub.
+     * Once a deployment resource is created, it can be associated with API
+     * versions.
+     * 
+ */ + public com.google.cloud.apihub.v1.Deployment createDeployment( + com.google.cloud.apihub.v1.CreateDeploymentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateDeploymentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get details about a deployment and the API versions linked to it.
+     * 
+ */ + public com.google.cloud.apihub.v1.Deployment getDeployment( + com.google.cloud.apihub.v1.GetDeploymentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetDeploymentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * List deployment resources in the API hub.
+     * 
+ */ + public com.google.cloud.apihub.v1.ListDeploymentsResponse listDeployments( + com.google.cloud.apihub.v1.ListDeploymentsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListDeploymentsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Update a deployment resource in the API hub. The following fields in the
+     * [deployment resource][google.cloud.apihub.v1.Deployment] can be
+     * updated:
+     * * [display_name][google.cloud.apihub.v1.Deployment.display_name]
+     * * [description][google.cloud.apihub.v1.Deployment.description]
+     * * [documentation][google.cloud.apihub.v1.Deployment.documentation]
+     * * [deployment_type][google.cloud.apihub.v1.Deployment.deployment_type]
+     * * [resource_uri][google.cloud.apihub.v1.Deployment.resource_uri]
+     * * [endpoints][google.cloud.apihub.v1.Deployment.endpoints]
+     * * [slo][google.cloud.apihub.v1.Deployment.slo]
+     * * [environment][google.cloud.apihub.v1.Deployment.environment]
+     * * [attributes][google.cloud.apihub.v1.Deployment.attributes]
+     * The
+     * [update_mask][google.cloud.apihub.v1.UpdateDeploymentRequest.update_mask]
+     * should be used to specify the fields being updated.
+     * 
+ */ + public com.google.cloud.apihub.v1.Deployment updateDeployment( + com.google.cloud.apihub.v1.UpdateDeploymentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateDeploymentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Delete a deployment resource in the API hub.
+     * 
+ */ + public com.google.protobuf.Empty deleteDeployment( + com.google.cloud.apihub.v1.DeleteDeploymentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteDeploymentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Create a user defined attribute.
+     * Certain pre defined attributes are already created by the API hub. These
+     * attributes will have type as `SYSTEM_DEFINED` and can be listed via
+     * [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method.
+     * Allowed values for the same can be updated via
+     * [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] method.
+     * 
+ */ + public com.google.cloud.apihub.v1.Attribute createAttribute( + com.google.cloud.apihub.v1.CreateAttributeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateAttributeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get details about the attribute.
+     * 
+ */ + public com.google.cloud.apihub.v1.Attribute getAttribute( + com.google.cloud.apihub.v1.GetAttributeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetAttributeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Update the attribute.  The following fields in the
+     * [Attribute resource][google.cloud.apihub.v1.Attribute] can be updated:
+     * * [display_name][google.cloud.apihub.v1.Attribute.display_name]
+     * The display name can be updated for user defined attributes only.
+     * * [description][google.cloud.apihub.v1.Attribute.description]
+     * The description can be updated for user defined attributes only.
+     * * [allowed_values][google.cloud.apihub.v1.Attribute.allowed_values]
+     * To update the list of allowed values, clients need to use the fetched list
+     * of allowed values and add or remove values to or from the same list.
+     * The mutable allowed values can be updated for both user defined and System
+     * defined attributes. The immutable allowed values cannot be updated or
+     * deleted. The updated list of allowed values cannot be empty. If an allowed
+     * value that is already used by some resource's attribute is deleted, then
+     * the association between the resource and the attribute value will also be
+     * deleted.
+     * * [cardinality][google.cloud.apihub.v1.Attribute.cardinality]
+     * The cardinality can be updated for user defined attributes only.
+     * Cardinality can only be increased during an update.
+     * The
+     * [update_mask][google.cloud.apihub.v1.UpdateAttributeRequest.update_mask]
+     * should be used to specify the fields being updated.
+     * 
+ */ + public com.google.cloud.apihub.v1.Attribute updateAttribute( + com.google.cloud.apihub.v1.UpdateAttributeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateAttributeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Delete an attribute.
+     * Note: System defined attributes cannot be deleted. All
+     * associations of the attribute being deleted with any API hub resource will
+     * also get deleted.
+     * 
+ */ + public com.google.protobuf.Empty deleteAttribute( + com.google.cloud.apihub.v1.DeleteAttributeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteAttributeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * List all attributes.
+     * 
+ */ + public com.google.cloud.apihub.v1.ListAttributesResponse listAttributes( + com.google.cloud.apihub.v1.ListAttributesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListAttributesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Search across API-Hub resources.
+     * 
+ */ + public com.google.cloud.apihub.v1.SearchResourcesResponse searchResources( + com.google.cloud.apihub.v1.SearchResourcesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSearchResourcesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Create an External API resource in the API hub.
+     * 
+ */ + public com.google.cloud.apihub.v1.ExternalApi createExternalApi( + com.google.cloud.apihub.v1.CreateExternalApiRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateExternalApiMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get details about an External API resource in the API hub.
+     * 
+ */ + public com.google.cloud.apihub.v1.ExternalApi getExternalApi( + com.google.cloud.apihub.v1.GetExternalApiRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetExternalApiMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Update an External API resource in the API hub. The following fields can be
+     * updated:
+     * * [display_name][google.cloud.apihub.v1.ExternalApi.display_name]
+     * * [description][google.cloud.apihub.v1.ExternalApi.description]
+     * * [documentation][google.cloud.apihub.v1.ExternalApi.documentation]
+     * * [endpoints][google.cloud.apihub.v1.ExternalApi.endpoints]
+     * * [paths][google.cloud.apihub.v1.ExternalApi.paths]
+     * The
+     * [update_mask][google.cloud.apihub.v1.UpdateExternalApiRequest.update_mask]
+     * should be used to specify the fields being updated.
+     * 
+ */ + public com.google.cloud.apihub.v1.ExternalApi updateExternalApi( + com.google.cloud.apihub.v1.UpdateExternalApiRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateExternalApiMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Delete an External API resource in the API hub.
+     * 
+ */ + public com.google.protobuf.Empty deleteExternalApi( + com.google.cloud.apihub.v1.DeleteExternalApiRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteExternalApiMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * List External API resources in the API hub.
+     * 
+ */ + public com.google.cloud.apihub.v1.ListExternalApisResponse listExternalApis( + com.google.cloud.apihub.v1.ListExternalApisRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListExternalApisMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service ApiHub. + * + *
+   * This service provides all methods related to the API hub.
+   * 
+ */ + public static final class ApiHubFutureStub + extends io.grpc.stub.AbstractFutureStub { + private ApiHubFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ApiHubFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ApiHubFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Create an API resource in the API hub.
+     * Once an API resource is created, versions can be added to it.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createApi(com.google.cloud.apihub.v1.CreateApiRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateApiMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Get API resource details including the API versions contained in it.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getApi(com.google.cloud.apihub.v1.GetApiRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetApiMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * List API resources in the API hub.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.apihub.v1.ListApisResponse> + listApis(com.google.cloud.apihub.v1.ListApisRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListApisMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Update an API resource in the API hub. The following fields in the
+     * [API][] can be updated:
+     * * [display_name][google.cloud.apihub.v1.Api.display_name]
+     * * [description][google.cloud.apihub.v1.Api.description]
+     * * [owner][google.cloud.apihub.v1.Api.owner]
+     * * [documentation][google.cloud.apihub.v1.Api.documentation]
+     * * [target_user][google.cloud.apihub.v1.Api.target_user]
+     * * [team][google.cloud.apihub.v1.Api.team]
+     * * [business_unit][google.cloud.apihub.v1.Api.business_unit]
+     * * [maturity_level][google.cloud.apihub.v1.Api.maturity_level]
+     * * [attributes][google.cloud.apihub.v1.Api.attributes]
+     * The
+     * [update_mask][google.cloud.apihub.v1.UpdateApiRequest.update_mask]
+     * should be used to specify the fields being updated.
+     * Updating the owner field requires complete owner message
+     * and updates both owner and email fields.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateApi(com.google.cloud.apihub.v1.UpdateApiRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateApiMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Delete an API resource in the API hub. API can only be deleted if all
+     * underlying versions are deleted.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteApi( + com.google.cloud.apihub.v1.DeleteApiRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteApiMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Create an API version for an API resource in the API hub.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createVersion(com.google.cloud.apihub.v1.CreateVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Get details about the API version of an API resource. This will include
+     * information about the specs and operations present in the API
+     * version as well as the deployments linked to it.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getVersion(com.google.cloud.apihub.v1.GetVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * List API versions of an API resource in the API hub.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.apihub.v1.ListVersionsResponse> + listVersions(com.google.cloud.apihub.v1.ListVersionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListVersionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Update API version. The following fields in the
+     * [version][google.cloud.apihub.v1.Version] can be updated currently:
+     * * [display_name][google.cloud.apihub.v1.Version.display_name]
+     * * [description][google.cloud.apihub.v1.Version.description]
+     * * [documentation][google.cloud.apihub.v1.Version.documentation]
+     * * [deployments][google.cloud.apihub.v1.Version.deployments]
+     * * [lifecycle][google.cloud.apihub.v1.Version.lifecycle]
+     * * [compliance][google.cloud.apihub.v1.Version.compliance]
+     * * [accreditation][google.cloud.apihub.v1.Version.accreditation]
+     * * [attributes][google.cloud.apihub.v1.Version.attributes]
+     * The
+     * [update_mask][google.cloud.apihub.v1.UpdateVersionRequest.update_mask]
+     * should be used to specify the fields being updated.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateVersion(com.google.cloud.apihub.v1.UpdateVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Delete an API version. Version can only be deleted if all underlying specs,
+     * operations, definitions and linked deployments are deleted.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteVersion(com.google.cloud.apihub.v1.DeleteVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Add a spec to an API version in the API hub.
+     * Multiple specs can be added to an API version.
+     * Note, while adding a spec, at least one of `contents` or `source_uri` must
+     * be provided. If `contents` is provided, then `spec_type` must also be
+     * provided.
+     * On adding a spec with contents to the version, the operations present in it
+     * will be added to the version.Note that the file contents in the spec should
+     * be of the same type as defined in the
+     * `projects/{project}/locations/{location}/attributes/system-spec-type`
+     * attribute associated with spec resource. Note that specs of various types
+     * can be uploaded, however parsing of details is supported for OpenAPI spec
+     * currently.
+     * In order to access the information parsed from the spec, use the
+     * [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method.
+     * In order to access the raw contents for a particular spec, use the
+     * [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method.
+     * In order to access the operations parsed from the spec, use the
+     * [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
+     * method.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createSpec(com.google.cloud.apihub.v1.CreateSpecRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateSpecMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Get details about the information parsed from a spec.
+     * Note that this method does not return the raw spec contents.
+     * Use [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method
+     * to retrieve the same.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getSpec(com.google.cloud.apihub.v1.GetSpecRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSpecMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Get spec contents.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.apihub.v1.SpecContents> + getSpecContents(com.google.cloud.apihub.v1.GetSpecContentsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSpecContentsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * List specs corresponding to a particular API resource.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.apihub.v1.ListSpecsResponse> + listSpecs(com.google.cloud.apihub.v1.ListSpecsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSpecsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Update spec. The following fields in the
+     * [spec][google.cloud.apihub.v1.Spec] can be updated:
+     * * [display_name][google.cloud.apihub.v1.Spec.display_name]
+     * * [source_uri][google.cloud.apihub.v1.Spec.source_uri]
+     * * [lint_response][google.cloud.apihub.v1.Spec.lint_response]
+     * * [attributes][google.cloud.apihub.v1.Spec.attributes]
+     * * [contents][google.cloud.apihub.v1.Spec.contents]
+     * * [spec_type][google.cloud.apihub.v1.Spec.spec_type]
+     * In case of an OAS spec, updating spec contents can lead to:
+     * 1. Creation, deletion and update of operations.
+     * 2. Creation, deletion and update of definitions.
+     * 3. Update of other info parsed out from the new spec.
+     * In case of contents or source_uri being present in update mask, spec_type
+     * must also be present. Also, spec_type can not be present in update mask if
+     * contents or source_uri is not present.
+     * The
+     * [update_mask][google.cloud.apihub.v1.UpdateSpecRequest.update_mask]
+     * should be used to specify the fields being updated.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateSpec(com.google.cloud.apihub.v1.UpdateSpecRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateSpecMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Delete a spec.
+     * Deleting a spec will also delete the associated operations from the
+     * version.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteSpec( + com.google.cloud.apihub.v1.DeleteSpecRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteSpecMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Get details about a particular operation in API version.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.apihub.v1.ApiOperation> + getApiOperation(com.google.cloud.apihub.v1.GetApiOperationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetApiOperationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * List operations in an API version.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.apihub.v1.ListApiOperationsResponse> + listApiOperations(com.google.cloud.apihub.v1.ListApiOperationsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListApiOperationsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Get details about a definition in an API version.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getDefinition(com.google.cloud.apihub.v1.GetDefinitionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetDefinitionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Create a deployment resource in the API hub.
+     * Once a deployment resource is created, it can be associated with API
+     * versions.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createDeployment(com.google.cloud.apihub.v1.CreateDeploymentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateDeploymentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Get details about a deployment and the API versions linked to it.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getDeployment(com.google.cloud.apihub.v1.GetDeploymentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetDeploymentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * List deployment resources in the API hub.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.apihub.v1.ListDeploymentsResponse> + listDeployments(com.google.cloud.apihub.v1.ListDeploymentsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListDeploymentsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Update a deployment resource in the API hub. The following fields in the
+     * [deployment resource][google.cloud.apihub.v1.Deployment] can be
+     * updated:
+     * * [display_name][google.cloud.apihub.v1.Deployment.display_name]
+     * * [description][google.cloud.apihub.v1.Deployment.description]
+     * * [documentation][google.cloud.apihub.v1.Deployment.documentation]
+     * * [deployment_type][google.cloud.apihub.v1.Deployment.deployment_type]
+     * * [resource_uri][google.cloud.apihub.v1.Deployment.resource_uri]
+     * * [endpoints][google.cloud.apihub.v1.Deployment.endpoints]
+     * * [slo][google.cloud.apihub.v1.Deployment.slo]
+     * * [environment][google.cloud.apihub.v1.Deployment.environment]
+     * * [attributes][google.cloud.apihub.v1.Deployment.attributes]
+     * The
+     * [update_mask][google.cloud.apihub.v1.UpdateDeploymentRequest.update_mask]
+     * should be used to specify the fields being updated.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateDeployment(com.google.cloud.apihub.v1.UpdateDeploymentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateDeploymentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Delete a deployment resource in the API hub.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteDeployment(com.google.cloud.apihub.v1.DeleteDeploymentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteDeploymentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Create a user defined attribute.
+     * Certain pre defined attributes are already created by the API hub. These
+     * attributes will have type as `SYSTEM_DEFINED` and can be listed via
+     * [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method.
+     * Allowed values for the same can be updated via
+     * [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] method.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createAttribute(com.google.cloud.apihub.v1.CreateAttributeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateAttributeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Get details about the attribute.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getAttribute(com.google.cloud.apihub.v1.GetAttributeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetAttributeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Update the attribute.  The following fields in the
+     * [Attribute resource][google.cloud.apihub.v1.Attribute] can be updated:
+     * * [display_name][google.cloud.apihub.v1.Attribute.display_name]
+     * The display name can be updated for user defined attributes only.
+     * * [description][google.cloud.apihub.v1.Attribute.description]
+     * The description can be updated for user defined attributes only.
+     * * [allowed_values][google.cloud.apihub.v1.Attribute.allowed_values]
+     * To update the list of allowed values, clients need to use the fetched list
+     * of allowed values and add or remove values to or from the same list.
+     * The mutable allowed values can be updated for both user defined and System
+     * defined attributes. The immutable allowed values cannot be updated or
+     * deleted. The updated list of allowed values cannot be empty. If an allowed
+     * value that is already used by some resource's attribute is deleted, then
+     * the association between the resource and the attribute value will also be
+     * deleted.
+     * * [cardinality][google.cloud.apihub.v1.Attribute.cardinality]
+     * The cardinality can be updated for user defined attributes only.
+     * Cardinality can only be increased during an update.
+     * The
+     * [update_mask][google.cloud.apihub.v1.UpdateAttributeRequest.update_mask]
+     * should be used to specify the fields being updated.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateAttribute(com.google.cloud.apihub.v1.UpdateAttributeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateAttributeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Delete an attribute.
+     * Note: System defined attributes cannot be deleted. All
+     * associations of the attribute being deleted with any API hub resource will
+     * also get deleted.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteAttribute(com.google.cloud.apihub.v1.DeleteAttributeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteAttributeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * List all attributes.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.apihub.v1.ListAttributesResponse> + listAttributes(com.google.cloud.apihub.v1.ListAttributesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListAttributesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Search across API-Hub resources.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.apihub.v1.SearchResourcesResponse> + searchResources(com.google.cloud.apihub.v1.SearchResourcesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSearchResourcesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Create an External API resource in the API hub.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.apihub.v1.ExternalApi> + createExternalApi(com.google.cloud.apihub.v1.CreateExternalApiRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateExternalApiMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Get details about an External API resource in the API hub.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.apihub.v1.ExternalApi> + getExternalApi(com.google.cloud.apihub.v1.GetExternalApiRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetExternalApiMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Update an External API resource in the API hub. The following fields can be
+     * updated:
+     * * [display_name][google.cloud.apihub.v1.ExternalApi.display_name]
+     * * [description][google.cloud.apihub.v1.ExternalApi.description]
+     * * [documentation][google.cloud.apihub.v1.ExternalApi.documentation]
+     * * [endpoints][google.cloud.apihub.v1.ExternalApi.endpoints]
+     * * [paths][google.cloud.apihub.v1.ExternalApi.paths]
+     * The
+     * [update_mask][google.cloud.apihub.v1.UpdateExternalApiRequest.update_mask]
+     * should be used to specify the fields being updated.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.apihub.v1.ExternalApi> + updateExternalApi(com.google.cloud.apihub.v1.UpdateExternalApiRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateExternalApiMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Delete an External API resource in the API hub.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteExternalApi(com.google.cloud.apihub.v1.DeleteExternalApiRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteExternalApiMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * List External API resources in the API hub.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.apihub.v1.ListExternalApisResponse> + listExternalApis(com.google.cloud.apihub.v1.ListExternalApisRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListExternalApisMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_API = 0; + private static final int METHODID_GET_API = 1; + private static final int METHODID_LIST_APIS = 2; + private static final int METHODID_UPDATE_API = 3; + private static final int METHODID_DELETE_API = 4; + private static final int METHODID_CREATE_VERSION = 5; + private static final int METHODID_GET_VERSION = 6; + private static final int METHODID_LIST_VERSIONS = 7; + private static final int METHODID_UPDATE_VERSION = 8; + private static final int METHODID_DELETE_VERSION = 9; + private static final int METHODID_CREATE_SPEC = 10; + private static final int METHODID_GET_SPEC = 11; + private static final int METHODID_GET_SPEC_CONTENTS = 12; + private static final int METHODID_LIST_SPECS = 13; + private static final int METHODID_UPDATE_SPEC = 14; + private static final int METHODID_DELETE_SPEC = 15; + private static final int METHODID_GET_API_OPERATION = 16; + private static final int METHODID_LIST_API_OPERATIONS = 17; + private static final int METHODID_GET_DEFINITION = 18; + private static final int METHODID_CREATE_DEPLOYMENT = 19; + private static final int METHODID_GET_DEPLOYMENT = 20; + private static final int METHODID_LIST_DEPLOYMENTS = 21; + private static final int METHODID_UPDATE_DEPLOYMENT = 22; + private static final int METHODID_DELETE_DEPLOYMENT = 23; + private static final int METHODID_CREATE_ATTRIBUTE = 24; + private static final int METHODID_GET_ATTRIBUTE = 25; + private static final int METHODID_UPDATE_ATTRIBUTE = 26; + private static final int METHODID_DELETE_ATTRIBUTE = 27; + private static final int METHODID_LIST_ATTRIBUTES = 28; + private static final int METHODID_SEARCH_RESOURCES = 29; + private static final int METHODID_CREATE_EXTERNAL_API = 30; + private static final int METHODID_GET_EXTERNAL_API = 31; + private static final int METHODID_UPDATE_EXTERNAL_API = 32; + private static final int METHODID_DELETE_EXTERNAL_API = 33; + private static final int METHODID_LIST_EXTERNAL_APIS = 34; + + 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 AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService 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_CREATE_API: + serviceImpl.createApi( + (com.google.cloud.apihub.v1.CreateApiRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_API: + serviceImpl.getApi( + (com.google.cloud.apihub.v1.GetApiRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_APIS: + serviceImpl.listApis( + (com.google.cloud.apihub.v1.ListApisRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_API: + serviceImpl.updateApi( + (com.google.cloud.apihub.v1.UpdateApiRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_API: + serviceImpl.deleteApi( + (com.google.cloud.apihub.v1.DeleteApiRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_VERSION: + serviceImpl.createVersion( + (com.google.cloud.apihub.v1.CreateVersionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_VERSION: + serviceImpl.getVersion( + (com.google.cloud.apihub.v1.GetVersionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_VERSIONS: + serviceImpl.listVersions( + (com.google.cloud.apihub.v1.ListVersionsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_VERSION: + serviceImpl.updateVersion( + (com.google.cloud.apihub.v1.UpdateVersionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_VERSION: + serviceImpl.deleteVersion( + (com.google.cloud.apihub.v1.DeleteVersionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_SPEC: + serviceImpl.createSpec( + (com.google.cloud.apihub.v1.CreateSpecRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_SPEC: + serviceImpl.getSpec( + (com.google.cloud.apihub.v1.GetSpecRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_SPEC_CONTENTS: + serviceImpl.getSpecContents( + (com.google.cloud.apihub.v1.GetSpecContentsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_SPECS: + serviceImpl.listSpecs( + (com.google.cloud.apihub.v1.ListSpecsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_SPEC: + serviceImpl.updateSpec( + (com.google.cloud.apihub.v1.UpdateSpecRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_SPEC: + serviceImpl.deleteSpec( + (com.google.cloud.apihub.v1.DeleteSpecRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_API_OPERATION: + serviceImpl.getApiOperation( + (com.google.cloud.apihub.v1.GetApiOperationRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_API_OPERATIONS: + serviceImpl.listApiOperations( + (com.google.cloud.apihub.v1.ListApiOperationsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_DEFINITION: + serviceImpl.getDefinition( + (com.google.cloud.apihub.v1.GetDefinitionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_DEPLOYMENT: + serviceImpl.createDeployment( + (com.google.cloud.apihub.v1.CreateDeploymentRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_DEPLOYMENT: + serviceImpl.getDeployment( + (com.google.cloud.apihub.v1.GetDeploymentRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_DEPLOYMENTS: + serviceImpl.listDeployments( + (com.google.cloud.apihub.v1.ListDeploymentsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_DEPLOYMENT: + serviceImpl.updateDeployment( + (com.google.cloud.apihub.v1.UpdateDeploymentRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_DEPLOYMENT: + serviceImpl.deleteDeployment( + (com.google.cloud.apihub.v1.DeleteDeploymentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_ATTRIBUTE: + serviceImpl.createAttribute( + (com.google.cloud.apihub.v1.CreateAttributeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_ATTRIBUTE: + serviceImpl.getAttribute( + (com.google.cloud.apihub.v1.GetAttributeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_ATTRIBUTE: + serviceImpl.updateAttribute( + (com.google.cloud.apihub.v1.UpdateAttributeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_ATTRIBUTE: + serviceImpl.deleteAttribute( + (com.google.cloud.apihub.v1.DeleteAttributeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_ATTRIBUTES: + serviceImpl.listAttributes( + (com.google.cloud.apihub.v1.ListAttributesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_SEARCH_RESOURCES: + serviceImpl.searchResources( + (com.google.cloud.apihub.v1.SearchResourcesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_EXTERNAL_API: + serviceImpl.createExternalApi( + (com.google.cloud.apihub.v1.CreateExternalApiRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_EXTERNAL_API: + serviceImpl.getExternalApi( + (com.google.cloud.apihub.v1.GetExternalApiRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_EXTERNAL_API: + serviceImpl.updateExternalApi( + (com.google.cloud.apihub.v1.UpdateExternalApiRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_EXTERNAL_API: + serviceImpl.deleteExternalApi( + (com.google.cloud.apihub.v1.DeleteExternalApiRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_EXTERNAL_APIS: + serviceImpl.listExternalApis( + (com.google.cloud.apihub.v1.ListExternalApisRequest) 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(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateApiMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.CreateApiRequest, com.google.cloud.apihub.v1.Api>( + service, METHODID_CREATE_API))) + .addMethod( + getGetApiMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.GetApiRequest, com.google.cloud.apihub.v1.Api>( + service, METHODID_GET_API))) + .addMethod( + getListApisMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.ListApisRequest, + com.google.cloud.apihub.v1.ListApisResponse>(service, METHODID_LIST_APIS))) + .addMethod( + getUpdateApiMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.UpdateApiRequest, com.google.cloud.apihub.v1.Api>( + service, METHODID_UPDATE_API))) + .addMethod( + getDeleteApiMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.DeleteApiRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_API))) + .addMethod( + getCreateVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.CreateVersionRequest, + com.google.cloud.apihub.v1.Version>(service, METHODID_CREATE_VERSION))) + .addMethod( + getGetVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.GetVersionRequest, + com.google.cloud.apihub.v1.Version>(service, METHODID_GET_VERSION))) + .addMethod( + getListVersionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.ListVersionsRequest, + com.google.cloud.apihub.v1.ListVersionsResponse>( + service, METHODID_LIST_VERSIONS))) + .addMethod( + getUpdateVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.UpdateVersionRequest, + com.google.cloud.apihub.v1.Version>(service, METHODID_UPDATE_VERSION))) + .addMethod( + getDeleteVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.DeleteVersionRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_VERSION))) + .addMethod( + getCreateSpecMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.CreateSpecRequest, com.google.cloud.apihub.v1.Spec>( + service, METHODID_CREATE_SPEC))) + .addMethod( + getGetSpecMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.GetSpecRequest, com.google.cloud.apihub.v1.Spec>( + service, METHODID_GET_SPEC))) + .addMethod( + getGetSpecContentsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.GetSpecContentsRequest, + com.google.cloud.apihub.v1.SpecContents>(service, METHODID_GET_SPEC_CONTENTS))) + .addMethod( + getListSpecsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.ListSpecsRequest, + com.google.cloud.apihub.v1.ListSpecsResponse>(service, METHODID_LIST_SPECS))) + .addMethod( + getUpdateSpecMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.UpdateSpecRequest, com.google.cloud.apihub.v1.Spec>( + service, METHODID_UPDATE_SPEC))) + .addMethod( + getDeleteSpecMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.DeleteSpecRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_SPEC))) + .addMethod( + getGetApiOperationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.GetApiOperationRequest, + com.google.cloud.apihub.v1.ApiOperation>(service, METHODID_GET_API_OPERATION))) + .addMethod( + getListApiOperationsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.ListApiOperationsRequest, + com.google.cloud.apihub.v1.ListApiOperationsResponse>( + service, METHODID_LIST_API_OPERATIONS))) + .addMethod( + getGetDefinitionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.GetDefinitionRequest, + com.google.cloud.apihub.v1.Definition>(service, METHODID_GET_DEFINITION))) + .addMethod( + getCreateDeploymentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.CreateDeploymentRequest, + com.google.cloud.apihub.v1.Deployment>(service, METHODID_CREATE_DEPLOYMENT))) + .addMethod( + getGetDeploymentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.GetDeploymentRequest, + com.google.cloud.apihub.v1.Deployment>(service, METHODID_GET_DEPLOYMENT))) + .addMethod( + getListDeploymentsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.ListDeploymentsRequest, + com.google.cloud.apihub.v1.ListDeploymentsResponse>( + service, METHODID_LIST_DEPLOYMENTS))) + .addMethod( + getUpdateDeploymentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.UpdateDeploymentRequest, + com.google.cloud.apihub.v1.Deployment>(service, METHODID_UPDATE_DEPLOYMENT))) + .addMethod( + getDeleteDeploymentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.DeleteDeploymentRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_DEPLOYMENT))) + .addMethod( + getCreateAttributeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.CreateAttributeRequest, + com.google.cloud.apihub.v1.Attribute>(service, METHODID_CREATE_ATTRIBUTE))) + .addMethod( + getGetAttributeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.GetAttributeRequest, + com.google.cloud.apihub.v1.Attribute>(service, METHODID_GET_ATTRIBUTE))) + .addMethod( + getUpdateAttributeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.UpdateAttributeRequest, + com.google.cloud.apihub.v1.Attribute>(service, METHODID_UPDATE_ATTRIBUTE))) + .addMethod( + getDeleteAttributeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.DeleteAttributeRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_ATTRIBUTE))) + .addMethod( + getListAttributesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.ListAttributesRequest, + com.google.cloud.apihub.v1.ListAttributesResponse>( + service, METHODID_LIST_ATTRIBUTES))) + .addMethod( + getSearchResourcesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.SearchResourcesRequest, + com.google.cloud.apihub.v1.SearchResourcesResponse>( + service, METHODID_SEARCH_RESOURCES))) + .addMethod( + getCreateExternalApiMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.CreateExternalApiRequest, + com.google.cloud.apihub.v1.ExternalApi>(service, METHODID_CREATE_EXTERNAL_API))) + .addMethod( + getGetExternalApiMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.GetExternalApiRequest, + com.google.cloud.apihub.v1.ExternalApi>(service, METHODID_GET_EXTERNAL_API))) + .addMethod( + getUpdateExternalApiMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.UpdateExternalApiRequest, + com.google.cloud.apihub.v1.ExternalApi>(service, METHODID_UPDATE_EXTERNAL_API))) + .addMethod( + getDeleteExternalApiMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.DeleteExternalApiRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_EXTERNAL_API))) + .addMethod( + getListExternalApisMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.ListExternalApisRequest, + com.google.cloud.apihub.v1.ListExternalApisResponse>( + service, METHODID_LIST_EXTERNAL_APIS))) + .build(); + } + + private abstract static class ApiHubBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ApiHubBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ApiHub"); + } + } + + private static final class ApiHubFileDescriptorSupplier extends ApiHubBaseDescriptorSupplier { + ApiHubFileDescriptorSupplier() {} + } + + private static final class ApiHubMethodDescriptorSupplier extends ApiHubBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + ApiHubMethodDescriptorSupplier(java.lang.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 (ApiHubGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ApiHubFileDescriptorSupplier()) + .addMethod(getCreateApiMethod()) + .addMethod(getGetApiMethod()) + .addMethod(getListApisMethod()) + .addMethod(getUpdateApiMethod()) + .addMethod(getDeleteApiMethod()) + .addMethod(getCreateVersionMethod()) + .addMethod(getGetVersionMethod()) + .addMethod(getListVersionsMethod()) + .addMethod(getUpdateVersionMethod()) + .addMethod(getDeleteVersionMethod()) + .addMethod(getCreateSpecMethod()) + .addMethod(getGetSpecMethod()) + .addMethod(getGetSpecContentsMethod()) + .addMethod(getListSpecsMethod()) + .addMethod(getUpdateSpecMethod()) + .addMethod(getDeleteSpecMethod()) + .addMethod(getGetApiOperationMethod()) + .addMethod(getListApiOperationsMethod()) + .addMethod(getGetDefinitionMethod()) + .addMethod(getCreateDeploymentMethod()) + .addMethod(getGetDeploymentMethod()) + .addMethod(getListDeploymentsMethod()) + .addMethod(getUpdateDeploymentMethod()) + .addMethod(getDeleteDeploymentMethod()) + .addMethod(getCreateAttributeMethod()) + .addMethod(getGetAttributeMethod()) + .addMethod(getUpdateAttributeMethod()) + .addMethod(getDeleteAttributeMethod()) + .addMethod(getListAttributesMethod()) + .addMethod(getSearchResourcesMethod()) + .addMethod(getCreateExternalApiMethod()) + .addMethod(getGetExternalApiMethod()) + .addMethod(getUpdateExternalApiMethod()) + .addMethod(getDeleteExternalApiMethod()) + .addMethod(getListExternalApisMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-apihub/grpc-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubPluginGrpc.java b/java-apihub/grpc-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubPluginGrpc.java new file mode 100644 index 000000000000..ec24c42efc3b --- /dev/null +++ b/java-apihub/grpc-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubPluginGrpc.java @@ -0,0 +1,593 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * This service is used for managing plugins inside the API Hub.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/apihub/v1/plugin_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class ApiHubPluginGrpc { + + private ApiHubPluginGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.apihub.v1.ApiHubPlugin"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetPluginRequest, com.google.cloud.apihub.v1.Plugin> + getGetPluginMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetPlugin", + requestType = com.google.cloud.apihub.v1.GetPluginRequest.class, + responseType = com.google.cloud.apihub.v1.Plugin.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetPluginRequest, com.google.cloud.apihub.v1.Plugin> + getGetPluginMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetPluginRequest, com.google.cloud.apihub.v1.Plugin> + getGetPluginMethod; + if ((getGetPluginMethod = ApiHubPluginGrpc.getGetPluginMethod) == null) { + synchronized (ApiHubPluginGrpc.class) { + if ((getGetPluginMethod = ApiHubPluginGrpc.getGetPluginMethod) == null) { + ApiHubPluginGrpc.getGetPluginMethod = + getGetPluginMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetPlugin")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.GetPluginRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.Plugin.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubPluginMethodDescriptorSupplier("GetPlugin")) + .build(); + } + } + } + return getGetPluginMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.EnablePluginRequest, com.google.cloud.apihub.v1.Plugin> + getEnablePluginMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "EnablePlugin", + requestType = com.google.cloud.apihub.v1.EnablePluginRequest.class, + responseType = com.google.cloud.apihub.v1.Plugin.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.EnablePluginRequest, com.google.cloud.apihub.v1.Plugin> + getEnablePluginMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.EnablePluginRequest, com.google.cloud.apihub.v1.Plugin> + getEnablePluginMethod; + if ((getEnablePluginMethod = ApiHubPluginGrpc.getEnablePluginMethod) == null) { + synchronized (ApiHubPluginGrpc.class) { + if ((getEnablePluginMethod = ApiHubPluginGrpc.getEnablePluginMethod) == null) { + ApiHubPluginGrpc.getEnablePluginMethod = + getEnablePluginMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "EnablePlugin")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.EnablePluginRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.Plugin.getDefaultInstance())) + .setSchemaDescriptor(new ApiHubPluginMethodDescriptorSupplier("EnablePlugin")) + .build(); + } + } + } + return getEnablePluginMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.DisablePluginRequest, com.google.cloud.apihub.v1.Plugin> + getDisablePluginMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DisablePlugin", + requestType = com.google.cloud.apihub.v1.DisablePluginRequest.class, + responseType = com.google.cloud.apihub.v1.Plugin.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.DisablePluginRequest, com.google.cloud.apihub.v1.Plugin> + getDisablePluginMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.DisablePluginRequest, com.google.cloud.apihub.v1.Plugin> + getDisablePluginMethod; + if ((getDisablePluginMethod = ApiHubPluginGrpc.getDisablePluginMethod) == null) { + synchronized (ApiHubPluginGrpc.class) { + if ((getDisablePluginMethod = ApiHubPluginGrpc.getDisablePluginMethod) == null) { + ApiHubPluginGrpc.getDisablePluginMethod = + getDisablePluginMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DisablePlugin")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.DisablePluginRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.Plugin.getDefaultInstance())) + .setSchemaDescriptor( + new ApiHubPluginMethodDescriptorSupplier("DisablePlugin")) + .build(); + } + } + } + return getDisablePluginMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ApiHubPluginStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ApiHubPluginStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ApiHubPluginStub(channel, callOptions); + } + }; + return ApiHubPluginStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ApiHubPluginBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ApiHubPluginBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ApiHubPluginBlockingStub(channel, callOptions); + } + }; + return ApiHubPluginBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ApiHubPluginFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ApiHubPluginFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ApiHubPluginFutureStub(channel, callOptions); + } + }; + return ApiHubPluginFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * This service is used for managing plugins inside the API Hub.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Get details about an API Hub plugin.
+     * 
+ */ + default void getPlugin( + com.google.cloud.apihub.v1.GetPluginRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetPluginMethod(), responseObserver); + } + + /** + * + * + *
+     * Enables a plugin.
+     * The `state` of the plugin after enabling is `ENABLED`
+     * 
+ */ + default void enablePlugin( + com.google.cloud.apihub.v1.EnablePluginRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getEnablePluginMethod(), responseObserver); + } + + /** + * + * + *
+     * Disables a plugin.
+     * The `state` of the plugin after disabling is `DISABLED`
+     * 
+ */ + default void disablePlugin( + com.google.cloud.apihub.v1.DisablePluginRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDisablePluginMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service ApiHubPlugin. + * + *
+   * This service is used for managing plugins inside the API Hub.
+   * 
+ */ + public abstract static class ApiHubPluginImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return ApiHubPluginGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service ApiHubPlugin. + * + *
+   * This service is used for managing plugins inside the API Hub.
+   * 
+ */ + public static final class ApiHubPluginStub + extends io.grpc.stub.AbstractAsyncStub { + private ApiHubPluginStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ApiHubPluginStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ApiHubPluginStub(channel, callOptions); + } + + /** + * + * + *
+     * Get details about an API Hub plugin.
+     * 
+ */ + public void getPlugin( + com.google.cloud.apihub.v1.GetPluginRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetPluginMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Enables a plugin.
+     * The `state` of the plugin after enabling is `ENABLED`
+     * 
+ */ + public void enablePlugin( + com.google.cloud.apihub.v1.EnablePluginRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getEnablePluginMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Disables a plugin.
+     * The `state` of the plugin after disabling is `DISABLED`
+     * 
+ */ + public void disablePlugin( + com.google.cloud.apihub.v1.DisablePluginRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDisablePluginMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service ApiHubPlugin. + * + *
+   * This service is used for managing plugins inside the API Hub.
+   * 
+ */ + public static final class ApiHubPluginBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private ApiHubPluginBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ApiHubPluginBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ApiHubPluginBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Get details about an API Hub plugin.
+     * 
+ */ + public com.google.cloud.apihub.v1.Plugin getPlugin( + com.google.cloud.apihub.v1.GetPluginRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetPluginMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Enables a plugin.
+     * The `state` of the plugin after enabling is `ENABLED`
+     * 
+ */ + public com.google.cloud.apihub.v1.Plugin enablePlugin( + com.google.cloud.apihub.v1.EnablePluginRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getEnablePluginMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Disables a plugin.
+     * The `state` of the plugin after disabling is `DISABLED`
+     * 
+ */ + public com.google.cloud.apihub.v1.Plugin disablePlugin( + com.google.cloud.apihub.v1.DisablePluginRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDisablePluginMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service ApiHubPlugin. + * + *
+   * This service is used for managing plugins inside the API Hub.
+   * 
+ */ + public static final class ApiHubPluginFutureStub + extends io.grpc.stub.AbstractFutureStub { + private ApiHubPluginFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ApiHubPluginFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ApiHubPluginFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Get details about an API Hub plugin.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getPlugin(com.google.cloud.apihub.v1.GetPluginRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetPluginMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Enables a plugin.
+     * The `state` of the plugin after enabling is `ENABLED`
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + enablePlugin(com.google.cloud.apihub.v1.EnablePluginRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getEnablePluginMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Disables a plugin.
+     * The `state` of the plugin after disabling is `DISABLED`
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + disablePlugin(com.google.cloud.apihub.v1.DisablePluginRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDisablePluginMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_GET_PLUGIN = 0; + private static final int METHODID_ENABLE_PLUGIN = 1; + private static final int METHODID_DISABLE_PLUGIN = 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 AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService 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_PLUGIN: + serviceImpl.getPlugin( + (com.google.cloud.apihub.v1.GetPluginRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_ENABLE_PLUGIN: + serviceImpl.enablePlugin( + (com.google.cloud.apihub.v1.EnablePluginRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DISABLE_PLUGIN: + serviceImpl.disablePlugin( + (com.google.cloud.apihub.v1.DisablePluginRequest) 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(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetPluginMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.GetPluginRequest, com.google.cloud.apihub.v1.Plugin>( + service, METHODID_GET_PLUGIN))) + .addMethod( + getEnablePluginMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.EnablePluginRequest, + com.google.cloud.apihub.v1.Plugin>(service, METHODID_ENABLE_PLUGIN))) + .addMethod( + getDisablePluginMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.DisablePluginRequest, + com.google.cloud.apihub.v1.Plugin>(service, METHODID_DISABLE_PLUGIN))) + .build(); + } + + private abstract static class ApiHubPluginBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ApiHubPluginBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.apihub.v1.PluginServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ApiHubPlugin"); + } + } + + private static final class ApiHubPluginFileDescriptorSupplier + extends ApiHubPluginBaseDescriptorSupplier { + ApiHubPluginFileDescriptorSupplier() {} + } + + private static final class ApiHubPluginMethodDescriptorSupplier + extends ApiHubPluginBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + ApiHubPluginMethodDescriptorSupplier(java.lang.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 (ApiHubPluginGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ApiHubPluginFileDescriptorSupplier()) + .addMethod(getGetPluginMethod()) + .addMethod(getEnablePluginMethod()) + .addMethod(getDisablePluginMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-apihub/grpc-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/HostProjectRegistrationServiceGrpc.java b/java-apihub/grpc-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/HostProjectRegistrationServiceGrpc.java new file mode 100644 index 000000000000..3c2158c9a70a --- /dev/null +++ b/java-apihub/grpc-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/HostProjectRegistrationServiceGrpc.java @@ -0,0 +1,668 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * This service is used for managing the host project registrations.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/apihub/v1/host_project_registration_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class HostProjectRegistrationServiceGrpc { + + private HostProjectRegistrationServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.apihub.v1.HostProjectRegistrationService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest, + com.google.cloud.apihub.v1.HostProjectRegistration> + getCreateHostProjectRegistrationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateHostProjectRegistration", + requestType = com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest.class, + responseType = com.google.cloud.apihub.v1.HostProjectRegistration.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest, + com.google.cloud.apihub.v1.HostProjectRegistration> + getCreateHostProjectRegistrationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest, + com.google.cloud.apihub.v1.HostProjectRegistration> + getCreateHostProjectRegistrationMethod; + if ((getCreateHostProjectRegistrationMethod = + HostProjectRegistrationServiceGrpc.getCreateHostProjectRegistrationMethod) + == null) { + synchronized (HostProjectRegistrationServiceGrpc.class) { + if ((getCreateHostProjectRegistrationMethod = + HostProjectRegistrationServiceGrpc.getCreateHostProjectRegistrationMethod) + == null) { + HostProjectRegistrationServiceGrpc.getCreateHostProjectRegistrationMethod = + getCreateHostProjectRegistrationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateHostProjectRegistration")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.HostProjectRegistration + .getDefaultInstance())) + .setSchemaDescriptor( + new HostProjectRegistrationServiceMethodDescriptorSupplier( + "CreateHostProjectRegistration")) + .build(); + } + } + } + return getCreateHostProjectRegistrationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest, + com.google.cloud.apihub.v1.HostProjectRegistration> + getGetHostProjectRegistrationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetHostProjectRegistration", + requestType = com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest.class, + responseType = com.google.cloud.apihub.v1.HostProjectRegistration.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest, + com.google.cloud.apihub.v1.HostProjectRegistration> + getGetHostProjectRegistrationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest, + com.google.cloud.apihub.v1.HostProjectRegistration> + getGetHostProjectRegistrationMethod; + if ((getGetHostProjectRegistrationMethod = + HostProjectRegistrationServiceGrpc.getGetHostProjectRegistrationMethod) + == null) { + synchronized (HostProjectRegistrationServiceGrpc.class) { + if ((getGetHostProjectRegistrationMethod = + HostProjectRegistrationServiceGrpc.getGetHostProjectRegistrationMethod) + == null) { + HostProjectRegistrationServiceGrpc.getGetHostProjectRegistrationMethod = + getGetHostProjectRegistrationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetHostProjectRegistration")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.HostProjectRegistration + .getDefaultInstance())) + .setSchemaDescriptor( + new HostProjectRegistrationServiceMethodDescriptorSupplier( + "GetHostProjectRegistration")) + .build(); + } + } + } + return getGetHostProjectRegistrationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest, + com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse> + getListHostProjectRegistrationsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListHostProjectRegistrations", + requestType = com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest.class, + responseType = com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest, + com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse> + getListHostProjectRegistrationsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest, + com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse> + getListHostProjectRegistrationsMethod; + if ((getListHostProjectRegistrationsMethod = + HostProjectRegistrationServiceGrpc.getListHostProjectRegistrationsMethod) + == null) { + synchronized (HostProjectRegistrationServiceGrpc.class) { + if ((getListHostProjectRegistrationsMethod = + HostProjectRegistrationServiceGrpc.getListHostProjectRegistrationsMethod) + == null) { + HostProjectRegistrationServiceGrpc.getListHostProjectRegistrationsMethod = + getListHostProjectRegistrationsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListHostProjectRegistrations")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new HostProjectRegistrationServiceMethodDescriptorSupplier( + "ListHostProjectRegistrations")) + .build(); + } + } + } + return getListHostProjectRegistrationsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static HostProjectRegistrationServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public HostProjectRegistrationServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new HostProjectRegistrationServiceStub(channel, callOptions); + } + }; + return HostProjectRegistrationServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static HostProjectRegistrationServiceBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public HostProjectRegistrationServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new HostProjectRegistrationServiceBlockingStub(channel, callOptions); + } + }; + return HostProjectRegistrationServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static HostProjectRegistrationServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public HostProjectRegistrationServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new HostProjectRegistrationServiceFutureStub(channel, callOptions); + } + }; + return HostProjectRegistrationServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * This service is used for managing the host project registrations.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Create a host project registration.
+     * A Google cloud project can be registered as a host project if it is not
+     * attached as a runtime project to another host project.
+     * A project can be registered as a host project only once. Subsequent
+     * register calls for the same project will fail.
+     * 
+ */ + default void createHostProjectRegistration( + com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateHostProjectRegistrationMethod(), responseObserver); + } + + /** + * + * + *
+     * Get a host project registration.
+     * 
+ */ + default void getHostProjectRegistration( + com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetHostProjectRegistrationMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists host project registrations.
+     * 
+ */ + default void listHostProjectRegistrations( + com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListHostProjectRegistrationsMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service HostProjectRegistrationService. + * + *
+   * This service is used for managing the host project registrations.
+   * 
+ */ + public abstract static class HostProjectRegistrationServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return HostProjectRegistrationServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service HostProjectRegistrationService. + * + *
+   * This service is used for managing the host project registrations.
+   * 
+ */ + public static final class HostProjectRegistrationServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private HostProjectRegistrationServiceStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected HostProjectRegistrationServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new HostProjectRegistrationServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Create a host project registration.
+     * A Google cloud project can be registered as a host project if it is not
+     * attached as a runtime project to another host project.
+     * A project can be registered as a host project only once. Subsequent
+     * register calls for the same project will fail.
+     * 
+ */ + public void createHostProjectRegistration( + com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateHostProjectRegistrationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Get a host project registration.
+     * 
+ */ + public void getHostProjectRegistration( + com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetHostProjectRegistrationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists host project registrations.
+     * 
+ */ + public void listHostProjectRegistrations( + com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListHostProjectRegistrationsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service HostProjectRegistrationService. + * + *
+   * This service is used for managing the host project registrations.
+   * 
+ */ + public static final class HostProjectRegistrationServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private HostProjectRegistrationServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected HostProjectRegistrationServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new HostProjectRegistrationServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Create a host project registration.
+     * A Google cloud project can be registered as a host project if it is not
+     * attached as a runtime project to another host project.
+     * A project can be registered as a host project only once. Subsequent
+     * register calls for the same project will fail.
+     * 
+ */ + public com.google.cloud.apihub.v1.HostProjectRegistration createHostProjectRegistration( + com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateHostProjectRegistrationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get a host project registration.
+     * 
+ */ + public com.google.cloud.apihub.v1.HostProjectRegistration getHostProjectRegistration( + com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetHostProjectRegistrationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists host project registrations.
+     * 
+ */ + public com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + listHostProjectRegistrations( + com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListHostProjectRegistrationsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * HostProjectRegistrationService. + * + *
+   * This service is used for managing the host project registrations.
+   * 
+ */ + public static final class HostProjectRegistrationServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private HostProjectRegistrationServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected HostProjectRegistrationServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new HostProjectRegistrationServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Create a host project registration.
+     * A Google cloud project can be registered as a host project if it is not
+     * attached as a runtime project to another host project.
+     * A project can be registered as a host project only once. Subsequent
+     * register calls for the same project will fail.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.apihub.v1.HostProjectRegistration> + createHostProjectRegistration( + com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateHostProjectRegistrationMethod(), getCallOptions()), + request); + } + + /** + * + * + *
+     * Get a host project registration.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.apihub.v1.HostProjectRegistration> + getHostProjectRegistration( + com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetHostProjectRegistrationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists host project registrations.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse> + listHostProjectRegistrations( + com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListHostProjectRegistrationsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_HOST_PROJECT_REGISTRATION = 0; + private static final int METHODID_GET_HOST_PROJECT_REGISTRATION = 1; + private static final int METHODID_LIST_HOST_PROJECT_REGISTRATIONS = 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 AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService 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_CREATE_HOST_PROJECT_REGISTRATION: + serviceImpl.createHostProjectRegistration( + (com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_HOST_PROJECT_REGISTRATION: + serviceImpl.getHostProjectRegistration( + (com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_HOST_PROJECT_REGISTRATIONS: + serviceImpl.listHostProjectRegistrations( + (com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse>) + 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(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateHostProjectRegistrationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest, + com.google.cloud.apihub.v1.HostProjectRegistration>( + service, METHODID_CREATE_HOST_PROJECT_REGISTRATION))) + .addMethod( + getGetHostProjectRegistrationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest, + com.google.cloud.apihub.v1.HostProjectRegistration>( + service, METHODID_GET_HOST_PROJECT_REGISTRATION))) + .addMethod( + getListHostProjectRegistrationsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest, + com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse>( + service, METHODID_LIST_HOST_PROJECT_REGISTRATIONS))) + .build(); + } + + private abstract static class HostProjectRegistrationServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + HostProjectRegistrationServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.apihub.v1.HostProjectRegistrationServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("HostProjectRegistrationService"); + } + } + + private static final class HostProjectRegistrationServiceFileDescriptorSupplier + extends HostProjectRegistrationServiceBaseDescriptorSupplier { + HostProjectRegistrationServiceFileDescriptorSupplier() {} + } + + private static final class HostProjectRegistrationServiceMethodDescriptorSupplier + extends HostProjectRegistrationServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + HostProjectRegistrationServiceMethodDescriptorSupplier(java.lang.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 (HostProjectRegistrationServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor( + new HostProjectRegistrationServiceFileDescriptorSupplier()) + .addMethod(getCreateHostProjectRegistrationMethod()) + .addMethod(getGetHostProjectRegistrationMethod()) + .addMethod(getListHostProjectRegistrationsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-apihub/grpc-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LintingServiceGrpc.java b/java-apihub/grpc-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LintingServiceGrpc.java new file mode 100644 index 000000000000..7d275a0cc34b --- /dev/null +++ b/java-apihub/grpc-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LintingServiceGrpc.java @@ -0,0 +1,718 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * This service provides all methods related to the 1p Linter.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/apihub/v1/linting_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class LintingServiceGrpc { + + private LintingServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.apihub.v1.LintingService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetStyleGuideRequest, com.google.cloud.apihub.v1.StyleGuide> + getGetStyleGuideMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetStyleGuide", + requestType = com.google.cloud.apihub.v1.GetStyleGuideRequest.class, + responseType = com.google.cloud.apihub.v1.StyleGuide.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetStyleGuideRequest, com.google.cloud.apihub.v1.StyleGuide> + getGetStyleGuideMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetStyleGuideRequest, com.google.cloud.apihub.v1.StyleGuide> + getGetStyleGuideMethod; + if ((getGetStyleGuideMethod = LintingServiceGrpc.getGetStyleGuideMethod) == null) { + synchronized (LintingServiceGrpc.class) { + if ((getGetStyleGuideMethod = LintingServiceGrpc.getGetStyleGuideMethod) == null) { + LintingServiceGrpc.getGetStyleGuideMethod = + getGetStyleGuideMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetStyleGuide")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.GetStyleGuideRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.StyleGuide.getDefaultInstance())) + .setSchemaDescriptor( + new LintingServiceMethodDescriptorSupplier("GetStyleGuide")) + .build(); + } + } + } + return getGetStyleGuideMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.UpdateStyleGuideRequest, com.google.cloud.apihub.v1.StyleGuide> + getUpdateStyleGuideMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateStyleGuide", + requestType = com.google.cloud.apihub.v1.UpdateStyleGuideRequest.class, + responseType = com.google.cloud.apihub.v1.StyleGuide.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.UpdateStyleGuideRequest, com.google.cloud.apihub.v1.StyleGuide> + getUpdateStyleGuideMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.UpdateStyleGuideRequest, + com.google.cloud.apihub.v1.StyleGuide> + getUpdateStyleGuideMethod; + if ((getUpdateStyleGuideMethod = LintingServiceGrpc.getUpdateStyleGuideMethod) == null) { + synchronized (LintingServiceGrpc.class) { + if ((getUpdateStyleGuideMethod = LintingServiceGrpc.getUpdateStyleGuideMethod) == null) { + LintingServiceGrpc.getUpdateStyleGuideMethod = + getUpdateStyleGuideMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateStyleGuide")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.UpdateStyleGuideRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.StyleGuide.getDefaultInstance())) + .setSchemaDescriptor( + new LintingServiceMethodDescriptorSupplier("UpdateStyleGuide")) + .build(); + } + } + } + return getUpdateStyleGuideMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetStyleGuideContentsRequest, + com.google.cloud.apihub.v1.StyleGuideContents> + getGetStyleGuideContentsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetStyleGuideContents", + requestType = com.google.cloud.apihub.v1.GetStyleGuideContentsRequest.class, + responseType = com.google.cloud.apihub.v1.StyleGuideContents.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetStyleGuideContentsRequest, + com.google.cloud.apihub.v1.StyleGuideContents> + getGetStyleGuideContentsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetStyleGuideContentsRequest, + com.google.cloud.apihub.v1.StyleGuideContents> + getGetStyleGuideContentsMethod; + if ((getGetStyleGuideContentsMethod = LintingServiceGrpc.getGetStyleGuideContentsMethod) + == null) { + synchronized (LintingServiceGrpc.class) { + if ((getGetStyleGuideContentsMethod = LintingServiceGrpc.getGetStyleGuideContentsMethod) + == null) { + LintingServiceGrpc.getGetStyleGuideContentsMethod = + getGetStyleGuideContentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetStyleGuideContents")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.GetStyleGuideContentsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.StyleGuideContents.getDefaultInstance())) + .setSchemaDescriptor( + new LintingServiceMethodDescriptorSupplier("GetStyleGuideContents")) + .build(); + } + } + } + return getGetStyleGuideContentsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.LintSpecRequest, com.google.protobuf.Empty> + getLintSpecMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "LintSpec", + requestType = com.google.cloud.apihub.v1.LintSpecRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.LintSpecRequest, com.google.protobuf.Empty> + getLintSpecMethod() { + io.grpc.MethodDescriptor + getLintSpecMethod; + if ((getLintSpecMethod = LintingServiceGrpc.getLintSpecMethod) == null) { + synchronized (LintingServiceGrpc.class) { + if ((getLintSpecMethod = LintingServiceGrpc.getLintSpecMethod) == null) { + LintingServiceGrpc.getLintSpecMethod = + getLintSpecMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "LintSpec")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.LintSpecRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new LintingServiceMethodDescriptorSupplier("LintSpec")) + .build(); + } + } + } + return getLintSpecMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static LintingServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public LintingServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LintingServiceStub(channel, callOptions); + } + }; + return LintingServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static LintingServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public LintingServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LintingServiceBlockingStub(channel, callOptions); + } + }; + return LintingServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static LintingServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public LintingServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LintingServiceFutureStub(channel, callOptions); + } + }; + return LintingServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * This service provides all methods related to the 1p Linter.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Get the style guide being used for linting.
+     * 
+ */ + default void getStyleGuide( + com.google.cloud.apihub.v1.GetStyleGuideRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetStyleGuideMethod(), responseObserver); + } + + /** + * + * + *
+     * Update the styleGuide to be used for liniting in by API hub.
+     * 
+ */ + default void updateStyleGuide( + com.google.cloud.apihub.v1.UpdateStyleGuideRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateStyleGuideMethod(), responseObserver); + } + + /** + * + * + *
+     * Get the contents of the style guide.
+     * 
+ */ + default void getStyleGuideContents( + com.google.cloud.apihub.v1.GetStyleGuideContentsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetStyleGuideContentsMethod(), responseObserver); + } + + /** + * + * + *
+     * Lints the requested spec and updates the corresponding API Spec with the
+     * lint response. This lint response will be available in all subsequent
+     * Get and List Spec calls to Core service.
+     * 
+ */ + default void lintSpec( + com.google.cloud.apihub.v1.LintSpecRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getLintSpecMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service LintingService. + * + *
+   * This service provides all methods related to the 1p Linter.
+   * 
+ */ + public abstract static class LintingServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return LintingServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service LintingService. + * + *
+   * This service provides all methods related to the 1p Linter.
+   * 
+ */ + public static final class LintingServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private LintingServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected LintingServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LintingServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Get the style guide being used for linting.
+     * 
+ */ + public void getStyleGuide( + com.google.cloud.apihub.v1.GetStyleGuideRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetStyleGuideMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Update the styleGuide to be used for liniting in by API hub.
+     * 
+ */ + public void updateStyleGuide( + com.google.cloud.apihub.v1.UpdateStyleGuideRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateStyleGuideMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Get the contents of the style guide.
+     * 
+ */ + public void getStyleGuideContents( + com.google.cloud.apihub.v1.GetStyleGuideContentsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetStyleGuideContentsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lints the requested spec and updates the corresponding API Spec with the
+     * lint response. This lint response will be available in all subsequent
+     * Get and List Spec calls to Core service.
+     * 
+ */ + public void lintSpec( + com.google.cloud.apihub.v1.LintSpecRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getLintSpecMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service LintingService. + * + *
+   * This service provides all methods related to the 1p Linter.
+   * 
+ */ + public static final class LintingServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private LintingServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected LintingServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LintingServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Get the style guide being used for linting.
+     * 
+ */ + public com.google.cloud.apihub.v1.StyleGuide getStyleGuide( + com.google.cloud.apihub.v1.GetStyleGuideRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetStyleGuideMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Update the styleGuide to be used for liniting in by API hub.
+     * 
+ */ + public com.google.cloud.apihub.v1.StyleGuide updateStyleGuide( + com.google.cloud.apihub.v1.UpdateStyleGuideRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateStyleGuideMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get the contents of the style guide.
+     * 
+ */ + public com.google.cloud.apihub.v1.StyleGuideContents getStyleGuideContents( + com.google.cloud.apihub.v1.GetStyleGuideContentsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetStyleGuideContentsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lints the requested spec and updates the corresponding API Spec with the
+     * lint response. This lint response will be available in all subsequent
+     * Get and List Spec calls to Core service.
+     * 
+ */ + public com.google.protobuf.Empty lintSpec(com.google.cloud.apihub.v1.LintSpecRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getLintSpecMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service LintingService. + * + *
+   * This service provides all methods related to the 1p Linter.
+   * 
+ */ + public static final class LintingServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private LintingServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected LintingServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LintingServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Get the style guide being used for linting.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getStyleGuide(com.google.cloud.apihub.v1.GetStyleGuideRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetStyleGuideMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Update the styleGuide to be used for liniting in by API hub.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateStyleGuide(com.google.cloud.apihub.v1.UpdateStyleGuideRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateStyleGuideMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Get the contents of the style guide.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.apihub.v1.StyleGuideContents> + getStyleGuideContents(com.google.cloud.apihub.v1.GetStyleGuideContentsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetStyleGuideContentsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lints the requested spec and updates the corresponding API Spec with the
+     * lint response. This lint response will be available in all subsequent
+     * Get and List Spec calls to Core service.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture lintSpec( + com.google.cloud.apihub.v1.LintSpecRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getLintSpecMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_GET_STYLE_GUIDE = 0; + private static final int METHODID_UPDATE_STYLE_GUIDE = 1; + private static final int METHODID_GET_STYLE_GUIDE_CONTENTS = 2; + private static final int METHODID_LINT_SPEC = 3; + + 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 AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService 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_STYLE_GUIDE: + serviceImpl.getStyleGuide( + (com.google.cloud.apihub.v1.GetStyleGuideRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_STYLE_GUIDE: + serviceImpl.updateStyleGuide( + (com.google.cloud.apihub.v1.UpdateStyleGuideRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_STYLE_GUIDE_CONTENTS: + serviceImpl.getStyleGuideContents( + (com.google.cloud.apihub.v1.GetStyleGuideContentsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LINT_SPEC: + serviceImpl.lintSpec( + (com.google.cloud.apihub.v1.LintSpecRequest) 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(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetStyleGuideMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.GetStyleGuideRequest, + com.google.cloud.apihub.v1.StyleGuide>(service, METHODID_GET_STYLE_GUIDE))) + .addMethod( + getUpdateStyleGuideMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.UpdateStyleGuideRequest, + com.google.cloud.apihub.v1.StyleGuide>(service, METHODID_UPDATE_STYLE_GUIDE))) + .addMethod( + getGetStyleGuideContentsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.GetStyleGuideContentsRequest, + com.google.cloud.apihub.v1.StyleGuideContents>( + service, METHODID_GET_STYLE_GUIDE_CONTENTS))) + .addMethod( + getLintSpecMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.LintSpecRequest, com.google.protobuf.Empty>( + service, METHODID_LINT_SPEC))) + .build(); + } + + private abstract static class LintingServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + LintingServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.apihub.v1.LintingServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("LintingService"); + } + } + + private static final class LintingServiceFileDescriptorSupplier + extends LintingServiceBaseDescriptorSupplier { + LintingServiceFileDescriptorSupplier() {} + } + + private static final class LintingServiceMethodDescriptorSupplier + extends LintingServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + LintingServiceMethodDescriptorSupplier(java.lang.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 (LintingServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new LintingServiceFileDescriptorSupplier()) + .addMethod(getGetStyleGuideMethod()) + .addMethod(getUpdateStyleGuideMethod()) + .addMethod(getGetStyleGuideContentsMethod()) + .addMethod(getLintSpecMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-apihub/grpc-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ProvisioningGrpc.java b/java-apihub/grpc-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ProvisioningGrpc.java new file mode 100644 index 000000000000..1f8bfa6fb9c1 --- /dev/null +++ b/java-apihub/grpc-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ProvisioningGrpc.java @@ -0,0 +1,617 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * This service is used for managing the data plane provisioning of the API hub.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/apihub/v1/provisioning_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class ProvisioningGrpc { + + private ProvisioningGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.apihub.v1.Provisioning"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateApiHubInstanceRequest, com.google.longrunning.Operation> + getCreateApiHubInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateApiHubInstance", + requestType = com.google.cloud.apihub.v1.CreateApiHubInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateApiHubInstanceRequest, com.google.longrunning.Operation> + getCreateApiHubInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateApiHubInstanceRequest, + com.google.longrunning.Operation> + getCreateApiHubInstanceMethod; + if ((getCreateApiHubInstanceMethod = ProvisioningGrpc.getCreateApiHubInstanceMethod) == null) { + synchronized (ProvisioningGrpc.class) { + if ((getCreateApiHubInstanceMethod = ProvisioningGrpc.getCreateApiHubInstanceMethod) + == null) { + ProvisioningGrpc.getCreateApiHubInstanceMethod = + getCreateApiHubInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateApiHubInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.CreateApiHubInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ProvisioningMethodDescriptorSupplier("CreateApiHubInstance")) + .build(); + } + } + } + return getCreateApiHubInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetApiHubInstanceRequest, + com.google.cloud.apihub.v1.ApiHubInstance> + getGetApiHubInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetApiHubInstance", + requestType = com.google.cloud.apihub.v1.GetApiHubInstanceRequest.class, + responseType = com.google.cloud.apihub.v1.ApiHubInstance.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetApiHubInstanceRequest, + com.google.cloud.apihub.v1.ApiHubInstance> + getGetApiHubInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetApiHubInstanceRequest, + com.google.cloud.apihub.v1.ApiHubInstance> + getGetApiHubInstanceMethod; + if ((getGetApiHubInstanceMethod = ProvisioningGrpc.getGetApiHubInstanceMethod) == null) { + synchronized (ProvisioningGrpc.class) { + if ((getGetApiHubInstanceMethod = ProvisioningGrpc.getGetApiHubInstanceMethod) == null) { + ProvisioningGrpc.getGetApiHubInstanceMethod = + getGetApiHubInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetApiHubInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.GetApiHubInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.ApiHubInstance.getDefaultInstance())) + .setSchemaDescriptor( + new ProvisioningMethodDescriptorSupplier("GetApiHubInstance")) + .build(); + } + } + } + return getGetApiHubInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.LookupApiHubInstanceRequest, + com.google.cloud.apihub.v1.LookupApiHubInstanceResponse> + getLookupApiHubInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "LookupApiHubInstance", + requestType = com.google.cloud.apihub.v1.LookupApiHubInstanceRequest.class, + responseType = com.google.cloud.apihub.v1.LookupApiHubInstanceResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.LookupApiHubInstanceRequest, + com.google.cloud.apihub.v1.LookupApiHubInstanceResponse> + getLookupApiHubInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.LookupApiHubInstanceRequest, + com.google.cloud.apihub.v1.LookupApiHubInstanceResponse> + getLookupApiHubInstanceMethod; + if ((getLookupApiHubInstanceMethod = ProvisioningGrpc.getLookupApiHubInstanceMethod) == null) { + synchronized (ProvisioningGrpc.class) { + if ((getLookupApiHubInstanceMethod = ProvisioningGrpc.getLookupApiHubInstanceMethod) + == null) { + ProvisioningGrpc.getLookupApiHubInstanceMethod = + getLookupApiHubInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "LookupApiHubInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.LookupApiHubInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.LookupApiHubInstanceResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new ProvisioningMethodDescriptorSupplier("LookupApiHubInstance")) + .build(); + } + } + } + return getLookupApiHubInstanceMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ProvisioningStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ProvisioningStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ProvisioningStub(channel, callOptions); + } + }; + return ProvisioningStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ProvisioningBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ProvisioningBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ProvisioningBlockingStub(channel, callOptions); + } + }; + return ProvisioningBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ProvisioningFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ProvisioningFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ProvisioningFutureStub(channel, callOptions); + } + }; + return ProvisioningFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * This service is used for managing the data plane provisioning of the API hub.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Provisions instance resources for the API Hub.
+     * 
+ */ + default void createApiHubInstance( + com.google.cloud.apihub.v1.CreateApiHubInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateApiHubInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single API Hub instance.
+     * 
+ */ + default void getApiHubInstance( + com.google.cloud.apihub.v1.GetApiHubInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetApiHubInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Looks up an Api Hub instance in a given GCP project. There will always be
+     * only one Api Hub instance for a GCP project across all locations.
+     * 
+ */ + default void lookupApiHubInstance( + com.google.cloud.apihub.v1.LookupApiHubInstanceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getLookupApiHubInstanceMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service Provisioning. + * + *
+   * This service is used for managing the data plane provisioning of the API hub.
+   * 
+ */ + public abstract static class ProvisioningImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return ProvisioningGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service Provisioning. + * + *
+   * This service is used for managing the data plane provisioning of the API hub.
+   * 
+ */ + public static final class ProvisioningStub + extends io.grpc.stub.AbstractAsyncStub { + private ProvisioningStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ProvisioningStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ProvisioningStub(channel, callOptions); + } + + /** + * + * + *
+     * Provisions instance resources for the API Hub.
+     * 
+ */ + public void createApiHubInstance( + com.google.cloud.apihub.v1.CreateApiHubInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateApiHubInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single API Hub instance.
+     * 
+ */ + public void getApiHubInstance( + com.google.cloud.apihub.v1.GetApiHubInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetApiHubInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Looks up an Api Hub instance in a given GCP project. There will always be
+     * only one Api Hub instance for a GCP project across all locations.
+     * 
+ */ + public void lookupApiHubInstance( + com.google.cloud.apihub.v1.LookupApiHubInstanceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getLookupApiHubInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service Provisioning. + * + *
+   * This service is used for managing the data plane provisioning of the API hub.
+   * 
+ */ + public static final class ProvisioningBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private ProvisioningBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ProvisioningBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ProvisioningBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Provisions instance resources for the API Hub.
+     * 
+ */ + public com.google.longrunning.Operation createApiHubInstance( + com.google.cloud.apihub.v1.CreateApiHubInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateApiHubInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single API Hub instance.
+     * 
+ */ + public com.google.cloud.apihub.v1.ApiHubInstance getApiHubInstance( + com.google.cloud.apihub.v1.GetApiHubInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetApiHubInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Looks up an Api Hub instance in a given GCP project. There will always be
+     * only one Api Hub instance for a GCP project across all locations.
+     * 
+ */ + public com.google.cloud.apihub.v1.LookupApiHubInstanceResponse lookupApiHubInstance( + com.google.cloud.apihub.v1.LookupApiHubInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getLookupApiHubInstanceMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Provisioning. + * + *
+   * This service is used for managing the data plane provisioning of the API hub.
+   * 
+ */ + public static final class ProvisioningFutureStub + extends io.grpc.stub.AbstractFutureStub { + private ProvisioningFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ProvisioningFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ProvisioningFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Provisions instance resources for the API Hub.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createApiHubInstance(com.google.cloud.apihub.v1.CreateApiHubInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateApiHubInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single API Hub instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.apihub.v1.ApiHubInstance> + getApiHubInstance(com.google.cloud.apihub.v1.GetApiHubInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetApiHubInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Looks up an Api Hub instance in a given GCP project. There will always be
+     * only one Api Hub instance for a GCP project across all locations.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.apihub.v1.LookupApiHubInstanceResponse> + lookupApiHubInstance(com.google.cloud.apihub.v1.LookupApiHubInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getLookupApiHubInstanceMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_API_HUB_INSTANCE = 0; + private static final int METHODID_GET_API_HUB_INSTANCE = 1; + private static final int METHODID_LOOKUP_API_HUB_INSTANCE = 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 AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService 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_CREATE_API_HUB_INSTANCE: + serviceImpl.createApiHubInstance( + (com.google.cloud.apihub.v1.CreateApiHubInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_API_HUB_INSTANCE: + serviceImpl.getApiHubInstance( + (com.google.cloud.apihub.v1.GetApiHubInstanceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LOOKUP_API_HUB_INSTANCE: + serviceImpl.lookupApiHubInstance( + (com.google.cloud.apihub.v1.LookupApiHubInstanceRequest) 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(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateApiHubInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.CreateApiHubInstanceRequest, + com.google.longrunning.Operation>(service, METHODID_CREATE_API_HUB_INSTANCE))) + .addMethod( + getGetApiHubInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.GetApiHubInstanceRequest, + com.google.cloud.apihub.v1.ApiHubInstance>( + service, METHODID_GET_API_HUB_INSTANCE))) + .addMethod( + getLookupApiHubInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.LookupApiHubInstanceRequest, + com.google.cloud.apihub.v1.LookupApiHubInstanceResponse>( + service, METHODID_LOOKUP_API_HUB_INSTANCE))) + .build(); + } + + private abstract static class ProvisioningBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ProvisioningBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.apihub.v1.ProvisioningServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Provisioning"); + } + } + + private static final class ProvisioningFileDescriptorSupplier + extends ProvisioningBaseDescriptorSupplier { + ProvisioningFileDescriptorSupplier() {} + } + + private static final class ProvisioningMethodDescriptorSupplier + extends ProvisioningBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + ProvisioningMethodDescriptorSupplier(java.lang.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 (ProvisioningGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ProvisioningFileDescriptorSupplier()) + .addMethod(getCreateApiHubInstanceMethod()) + .addMethod(getGetApiHubInstanceMethod()) + .addMethod(getLookupApiHubInstanceMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-apihub/grpc-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentServiceGrpc.java b/java-apihub/grpc-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentServiceGrpc.java new file mode 100644 index 000000000000..e9d366f715c4 --- /dev/null +++ b/java-apihub/grpc-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentServiceGrpc.java @@ -0,0 +1,921 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * This service is used for managing the runtime project attachments.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/apihub/v1/runtime_project_attachment_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class RuntimeProjectAttachmentServiceGrpc { + + private RuntimeProjectAttachmentServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.apihub.v1.RuntimeProjectAttachmentService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest, + com.google.cloud.apihub.v1.RuntimeProjectAttachment> + getCreateRuntimeProjectAttachmentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateRuntimeProjectAttachment", + requestType = com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest.class, + responseType = com.google.cloud.apihub.v1.RuntimeProjectAttachment.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest, + com.google.cloud.apihub.v1.RuntimeProjectAttachment> + getCreateRuntimeProjectAttachmentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest, + com.google.cloud.apihub.v1.RuntimeProjectAttachment> + getCreateRuntimeProjectAttachmentMethod; + if ((getCreateRuntimeProjectAttachmentMethod = + RuntimeProjectAttachmentServiceGrpc.getCreateRuntimeProjectAttachmentMethod) + == null) { + synchronized (RuntimeProjectAttachmentServiceGrpc.class) { + if ((getCreateRuntimeProjectAttachmentMethod = + RuntimeProjectAttachmentServiceGrpc.getCreateRuntimeProjectAttachmentMethod) + == null) { + RuntimeProjectAttachmentServiceGrpc.getCreateRuntimeProjectAttachmentMethod = + getCreateRuntimeProjectAttachmentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateRuntimeProjectAttachment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.RuntimeProjectAttachment + .getDefaultInstance())) + .setSchemaDescriptor( + new RuntimeProjectAttachmentServiceMethodDescriptorSupplier( + "CreateRuntimeProjectAttachment")) + .build(); + } + } + } + return getCreateRuntimeProjectAttachmentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest, + com.google.cloud.apihub.v1.RuntimeProjectAttachment> + getGetRuntimeProjectAttachmentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetRuntimeProjectAttachment", + requestType = com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest.class, + responseType = com.google.cloud.apihub.v1.RuntimeProjectAttachment.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest, + com.google.cloud.apihub.v1.RuntimeProjectAttachment> + getGetRuntimeProjectAttachmentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest, + com.google.cloud.apihub.v1.RuntimeProjectAttachment> + getGetRuntimeProjectAttachmentMethod; + if ((getGetRuntimeProjectAttachmentMethod = + RuntimeProjectAttachmentServiceGrpc.getGetRuntimeProjectAttachmentMethod) + == null) { + synchronized (RuntimeProjectAttachmentServiceGrpc.class) { + if ((getGetRuntimeProjectAttachmentMethod = + RuntimeProjectAttachmentServiceGrpc.getGetRuntimeProjectAttachmentMethod) + == null) { + RuntimeProjectAttachmentServiceGrpc.getGetRuntimeProjectAttachmentMethod = + getGetRuntimeProjectAttachmentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetRuntimeProjectAttachment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.RuntimeProjectAttachment + .getDefaultInstance())) + .setSchemaDescriptor( + new RuntimeProjectAttachmentServiceMethodDescriptorSupplier( + "GetRuntimeProjectAttachment")) + .build(); + } + } + } + return getGetRuntimeProjectAttachmentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest, + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse> + getListRuntimeProjectAttachmentsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListRuntimeProjectAttachments", + requestType = com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest.class, + responseType = com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest, + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse> + getListRuntimeProjectAttachmentsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest, + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse> + getListRuntimeProjectAttachmentsMethod; + if ((getListRuntimeProjectAttachmentsMethod = + RuntimeProjectAttachmentServiceGrpc.getListRuntimeProjectAttachmentsMethod) + == null) { + synchronized (RuntimeProjectAttachmentServiceGrpc.class) { + if ((getListRuntimeProjectAttachmentsMethod = + RuntimeProjectAttachmentServiceGrpc.getListRuntimeProjectAttachmentsMethod) + == null) { + RuntimeProjectAttachmentServiceGrpc.getListRuntimeProjectAttachmentsMethod = + getListRuntimeProjectAttachmentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListRuntimeProjectAttachments")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new RuntimeProjectAttachmentServiceMethodDescriptorSupplier( + "ListRuntimeProjectAttachments")) + .build(); + } + } + } + return getListRuntimeProjectAttachmentsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest, + com.google.protobuf.Empty> + getDeleteRuntimeProjectAttachmentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteRuntimeProjectAttachment", + requestType = com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest, + com.google.protobuf.Empty> + getDeleteRuntimeProjectAttachmentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest, + com.google.protobuf.Empty> + getDeleteRuntimeProjectAttachmentMethod; + if ((getDeleteRuntimeProjectAttachmentMethod = + RuntimeProjectAttachmentServiceGrpc.getDeleteRuntimeProjectAttachmentMethod) + == null) { + synchronized (RuntimeProjectAttachmentServiceGrpc.class) { + if ((getDeleteRuntimeProjectAttachmentMethod = + RuntimeProjectAttachmentServiceGrpc.getDeleteRuntimeProjectAttachmentMethod) + == null) { + RuntimeProjectAttachmentServiceGrpc.getDeleteRuntimeProjectAttachmentMethod = + getDeleteRuntimeProjectAttachmentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteRuntimeProjectAttachment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new RuntimeProjectAttachmentServiceMethodDescriptorSupplier( + "DeleteRuntimeProjectAttachment")) + .build(); + } + } + } + return getDeleteRuntimeProjectAttachmentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest, + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse> + getLookupRuntimeProjectAttachmentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "LookupRuntimeProjectAttachment", + requestType = com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest.class, + responseType = com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest, + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse> + getLookupRuntimeProjectAttachmentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest, + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse> + getLookupRuntimeProjectAttachmentMethod; + if ((getLookupRuntimeProjectAttachmentMethod = + RuntimeProjectAttachmentServiceGrpc.getLookupRuntimeProjectAttachmentMethod) + == null) { + synchronized (RuntimeProjectAttachmentServiceGrpc.class) { + if ((getLookupRuntimeProjectAttachmentMethod = + RuntimeProjectAttachmentServiceGrpc.getLookupRuntimeProjectAttachmentMethod) + == null) { + RuntimeProjectAttachmentServiceGrpc.getLookupRuntimeProjectAttachmentMethod = + getLookupRuntimeProjectAttachmentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "LookupRuntimeProjectAttachment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new RuntimeProjectAttachmentServiceMethodDescriptorSupplier( + "LookupRuntimeProjectAttachment")) + .build(); + } + } + } + return getLookupRuntimeProjectAttachmentMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static RuntimeProjectAttachmentServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RuntimeProjectAttachmentServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RuntimeProjectAttachmentServiceStub(channel, callOptions); + } + }; + return RuntimeProjectAttachmentServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static RuntimeProjectAttachmentServiceBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RuntimeProjectAttachmentServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RuntimeProjectAttachmentServiceBlockingStub(channel, callOptions); + } + }; + return RuntimeProjectAttachmentServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static RuntimeProjectAttachmentServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RuntimeProjectAttachmentServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RuntimeProjectAttachmentServiceFutureStub(channel, callOptions); + } + }; + return RuntimeProjectAttachmentServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * This service is used for managing the runtime project attachments.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Attaches a runtime project to the host project.
+     * 
+ */ + default void createRuntimeProjectAttachment( + com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateRuntimeProjectAttachmentMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a runtime project attachment.
+     * 
+ */ + default void getRuntimeProjectAttachment( + com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetRuntimeProjectAttachmentMethod(), responseObserver); + } + + /** + * + * + *
+     * List runtime projects attached to the host project.
+     * 
+ */ + default void listRuntimeProjectAttachments( + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListRuntimeProjectAttachmentsMethod(), responseObserver); + } + + /** + * + * + *
+     * Delete a runtime project attachment in the API Hub. This call will detach
+     * the runtime project from the host project.
+     * 
+ */ + default void deleteRuntimeProjectAttachment( + com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteRuntimeProjectAttachmentMethod(), responseObserver); + } + + /** + * + * + *
+     * Look up a runtime project attachment. This API can be called in the context
+     * of any project.
+     * 
+ */ + default void lookupRuntimeProjectAttachment( + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getLookupRuntimeProjectAttachmentMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service RuntimeProjectAttachmentService. + * + *
+   * This service is used for managing the runtime project attachments.
+   * 
+ */ + public abstract static class RuntimeProjectAttachmentServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return RuntimeProjectAttachmentServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service + * RuntimeProjectAttachmentService. + * + *
+   * This service is used for managing the runtime project attachments.
+   * 
+ */ + public static final class RuntimeProjectAttachmentServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private RuntimeProjectAttachmentServiceStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RuntimeProjectAttachmentServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RuntimeProjectAttachmentServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Attaches a runtime project to the host project.
+     * 
+ */ + public void createRuntimeProjectAttachment( + com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateRuntimeProjectAttachmentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a runtime project attachment.
+     * 
+ */ + public void getRuntimeProjectAttachment( + com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetRuntimeProjectAttachmentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * List runtime projects attached to the host project.
+     * 
+ */ + public void listRuntimeProjectAttachments( + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListRuntimeProjectAttachmentsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Delete a runtime project attachment in the API Hub. This call will detach
+     * the runtime project from the host project.
+     * 
+ */ + public void deleteRuntimeProjectAttachment( + com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteRuntimeProjectAttachmentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Look up a runtime project attachment. This API can be called in the context
+     * of any project.
+     * 
+ */ + public void lookupRuntimeProjectAttachment( + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getLookupRuntimeProjectAttachmentMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service RuntimeProjectAttachmentService. + * + *
+   * This service is used for managing the runtime project attachments.
+   * 
+ */ + public static final class RuntimeProjectAttachmentServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private RuntimeProjectAttachmentServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RuntimeProjectAttachmentServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RuntimeProjectAttachmentServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Attaches a runtime project to the host project.
+     * 
+ */ + public com.google.cloud.apihub.v1.RuntimeProjectAttachment createRuntimeProjectAttachment( + com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateRuntimeProjectAttachmentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a runtime project attachment.
+     * 
+ */ + public com.google.cloud.apihub.v1.RuntimeProjectAttachment getRuntimeProjectAttachment( + com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetRuntimeProjectAttachmentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * List runtime projects attached to the host project.
+     * 
+ */ + public com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + listRuntimeProjectAttachments( + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListRuntimeProjectAttachmentsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Delete a runtime project attachment in the API Hub. This call will detach
+     * the runtime project from the host project.
+     * 
+ */ + public com.google.protobuf.Empty deleteRuntimeProjectAttachment( + com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteRuntimeProjectAttachmentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Look up a runtime project attachment. This API can be called in the context
+     * of any project.
+     * 
+ */ + public com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse + lookupRuntimeProjectAttachment( + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getLookupRuntimeProjectAttachmentMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * RuntimeProjectAttachmentService. + * + *
+   * This service is used for managing the runtime project attachments.
+   * 
+ */ + public static final class RuntimeProjectAttachmentServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private RuntimeProjectAttachmentServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RuntimeProjectAttachmentServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RuntimeProjectAttachmentServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Attaches a runtime project to the host project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.apihub.v1.RuntimeProjectAttachment> + createRuntimeProjectAttachment( + com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateRuntimeProjectAttachmentMethod(), getCallOptions()), + request); + } + + /** + * + * + *
+     * Gets a runtime project attachment.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.apihub.v1.RuntimeProjectAttachment> + getRuntimeProjectAttachment( + com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetRuntimeProjectAttachmentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * List runtime projects attached to the host project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse> + listRuntimeProjectAttachments( + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListRuntimeProjectAttachmentsMethod(), getCallOptions()), + request); + } + + /** + * + * + *
+     * Delete a runtime project attachment in the API Hub. This call will detach
+     * the runtime project from the host project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteRuntimeProjectAttachment( + com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteRuntimeProjectAttachmentMethod(), getCallOptions()), + request); + } + + /** + * + * + *
+     * Look up a runtime project attachment. This API can be called in the context
+     * of any project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse> + lookupRuntimeProjectAttachment( + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getLookupRuntimeProjectAttachmentMethod(), getCallOptions()), + request); + } + } + + private static final int METHODID_CREATE_RUNTIME_PROJECT_ATTACHMENT = 0; + private static final int METHODID_GET_RUNTIME_PROJECT_ATTACHMENT = 1; + private static final int METHODID_LIST_RUNTIME_PROJECT_ATTACHMENTS = 2; + private static final int METHODID_DELETE_RUNTIME_PROJECT_ATTACHMENT = 3; + private static final int METHODID_LOOKUP_RUNTIME_PROJECT_ATTACHMENT = 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 AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService 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_CREATE_RUNTIME_PROJECT_ATTACHMENT: + serviceImpl.createRuntimeProjectAttachment( + (com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_RUNTIME_PROJECT_ATTACHMENT: + serviceImpl.getRuntimeProjectAttachment( + (com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_RUNTIME_PROJECT_ATTACHMENTS: + serviceImpl.listRuntimeProjectAttachments( + (com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse>) + responseObserver); + break; + case METHODID_DELETE_RUNTIME_PROJECT_ATTACHMENT: + serviceImpl.deleteRuntimeProjectAttachment( + (com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LOOKUP_RUNTIME_PROJECT_ATTACHMENT: + serviceImpl.lookupRuntimeProjectAttachment( + (com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse>) + 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(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateRuntimeProjectAttachmentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest, + com.google.cloud.apihub.v1.RuntimeProjectAttachment>( + service, METHODID_CREATE_RUNTIME_PROJECT_ATTACHMENT))) + .addMethod( + getGetRuntimeProjectAttachmentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest, + com.google.cloud.apihub.v1.RuntimeProjectAttachment>( + service, METHODID_GET_RUNTIME_PROJECT_ATTACHMENT))) + .addMethod( + getListRuntimeProjectAttachmentsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest, + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse>( + service, METHODID_LIST_RUNTIME_PROJECT_ATTACHMENTS))) + .addMethod( + getDeleteRuntimeProjectAttachmentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest, + com.google.protobuf.Empty>( + service, METHODID_DELETE_RUNTIME_PROJECT_ATTACHMENT))) + .addMethod( + getLookupRuntimeProjectAttachmentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest, + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse>( + service, METHODID_LOOKUP_RUNTIME_PROJECT_ATTACHMENT))) + .build(); + } + + private abstract static class RuntimeProjectAttachmentServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + RuntimeProjectAttachmentServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("RuntimeProjectAttachmentService"); + } + } + + private static final class RuntimeProjectAttachmentServiceFileDescriptorSupplier + extends RuntimeProjectAttachmentServiceBaseDescriptorSupplier { + RuntimeProjectAttachmentServiceFileDescriptorSupplier() {} + } + + private static final class RuntimeProjectAttachmentServiceMethodDescriptorSupplier + extends RuntimeProjectAttachmentServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + RuntimeProjectAttachmentServiceMethodDescriptorSupplier(java.lang.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 (RuntimeProjectAttachmentServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor( + new RuntimeProjectAttachmentServiceFileDescriptorSupplier()) + .addMethod(getCreateRuntimeProjectAttachmentMethod()) + .addMethod(getGetRuntimeProjectAttachmentMethod()) + .addMethod(getListRuntimeProjectAttachmentsMethod()) + .addMethod(getDeleteRuntimeProjectAttachmentMethod()) + .addMethod(getLookupRuntimeProjectAttachmentMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-apihub/owlbot.py b/java-apihub/owlbot.py new file mode 100644 index 000000000000..2ba11e6bba67 --- /dev/null +++ b/java-apihub/owlbot.py @@ -0,0 +1,36 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import synthtool as s +from synthtool.languages import java + + +for library in s.get_staging_dirs(): + # put any special-case replacements here + s.move(library) + +s.remove_staging_dirs() +java.common_templates(monorepo=True, excludes=[ + ".github/*", + ".kokoro/*", + "samples/*", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "SECURITY.md", + "java.header", + "license-checks.xml", + "renovate.json", + ".gitignore" +]) \ No newline at end of file diff --git a/java-apihub/pom.xml b/java-apihub/pom.xml new file mode 100644 index 000000000000..c292f13019ec --- /dev/null +++ b/java-apihub/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + com.google.cloud + google-cloud-apihub-parent + pom + 0.0.1-SNAPSHOT + Google API hub API Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.42.0-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + google-cloud-apihub-parent + + + + + + com.google.cloud + google-cloud-apihub + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-apihub-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-apihub-v1 + 0.0.1-SNAPSHOT + + + + + + + google-cloud-apihub + grpc-google-cloud-apihub-v1 + proto-google-cloud-apihub-v1 + google-cloud-apihub-bom + + + diff --git a/java-apihub/proto-google-cloud-apihub-v1/clirr-ignored-differences.xml b/java-apihub/proto-google-cloud-apihub-v1/clirr-ignored-differences.xml new file mode 100644 index 000000000000..b07fc001b8e4 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/apihub/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/apihub/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/apihub/v1/*OrBuilder + boolean has*(*) + + diff --git a/java-apihub/proto-google-cloud-apihub-v1/pom.xml b/java-apihub/proto-google-cloud-apihub-v1/pom.xml new file mode 100644 index 000000000000..50c958463693 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-apihub-v1 + 0.0.1-SNAPSHOT + proto-google-cloud-apihub-v1 + Proto library for google-cloud-apihub + + com.google.cloud + google-cloud-apihub-parent + 0.0.1-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 + + + diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Api.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Api.java new file mode 100644 index 000000000000..de2d67382efe --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Api.java @@ -0,0 +1,5067 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * An API resource in the API Hub.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Api} + */ +public final class Api extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.Api) + ApiOrBuilder { + private static final long serialVersionUID = 0L; + // Use Api.newBuilder() to construct. + private Api(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Api() { + name_ = ""; + displayName_ = ""; + description_ = ""; + versions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + selectedVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Api(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Api_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 13: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Api_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Api.class, com.google.cloud.apihub.v1.Api.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. The name of the API resource in the API Hub.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+   * Identifier. The name of the API resource in the API Hub.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * Required. The display name of the API resource.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+   * Required. The display name of the API resource.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 DESCRIPTION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * Optional. The description of the API resource.
+   * 
+ * + * string description = 3 [(.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. The description of the API resource.
+   * 
+ * + * string description = 3 [(.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 DOCUMENTATION_FIELD_NUMBER = 4; + private com.google.cloud.apihub.v1.Documentation documentation_; + /** + * + * + *
+   * Optional. The documentation for the API resource.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the documentation field is set. + */ + @java.lang.Override + public boolean hasDocumentation() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Optional. The documentation for the API resource.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The documentation. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Documentation getDocumentation() { + return documentation_ == null + ? com.google.cloud.apihub.v1.Documentation.getDefaultInstance() + : documentation_; + } + /** + * + * + *
+   * Optional. The documentation for the API resource.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.DocumentationOrBuilder getDocumentationOrBuilder() { + return documentation_ == null + ? com.google.cloud.apihub.v1.Documentation.getDefaultInstance() + : documentation_; + } + + public static final int OWNER_FIELD_NUMBER = 5; + private com.google.cloud.apihub.v1.Owner owner_; + /** + * + * + *
+   * Optional. Owner details for the API resource.
+   * 
+ * + * .google.cloud.apihub.v1.Owner owner = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the owner field is set. + */ + @java.lang.Override + public boolean hasOwner() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Optional. Owner details for the API resource.
+   * 
+ * + * .google.cloud.apihub.v1.Owner owner = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The owner. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Owner getOwner() { + return owner_ == null ? com.google.cloud.apihub.v1.Owner.getDefaultInstance() : owner_; + } + /** + * + * + *
+   * Optional. Owner details for the API resource.
+   * 
+ * + * .google.cloud.apihub.v1.Owner owner = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.OwnerOrBuilder getOwnerOrBuilder() { + return owner_ == null ? com.google.cloud.apihub.v1.Owner.getDefaultInstance() : owner_; + } + + public static final int VERSIONS_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList versions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Output only. The list of versions present in an API resource.
+   * Note: An API resource can be associated with more than 1 version.
+   * Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * repeated string versions = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the versions. + */ + public com.google.protobuf.ProtocolStringList getVersionsList() { + return versions_; + } + /** + * + * + *
+   * Output only. The list of versions present in an API resource.
+   * Note: An API resource can be associated with more than 1 version.
+   * Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * repeated string versions = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The count of versions. + */ + public int getVersionsCount() { + return versions_.size(); + } + /** + * + * + *
+   * Output only. The list of versions present in an API resource.
+   * Note: An API resource can be associated with more than 1 version.
+   * Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * repeated string versions = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The versions at the given index. + */ + public java.lang.String getVersions(int index) { + return versions_.get(index); + } + /** + * + * + *
+   * Output only. The list of versions present in an API resource.
+   * Note: An API resource can be associated with more than 1 version.
+   * Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * repeated string versions = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the versions at the given index. + */ + public com.google.protobuf.ByteString getVersionsBytes(int index) { + return versions_.getByteString(index); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time at which the API resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Output only. The time at which the API resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.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. The time at which the API resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 8; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The time at which the API resource was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+   * Output only. The time at which the API resource was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.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 time at which the API resource was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int TARGET_USER_FIELD_NUMBER = 9; + private com.google.cloud.apihub.v1.AttributeValues targetUser_; + /** + * + * + *
+   * Optional. The target users for the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-target-user`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues target_user = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the targetUser field is set. + */ + @java.lang.Override + public boolean hasTargetUser() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+   * Optional. The target users for the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-target-user`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues target_user = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The targetUser. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getTargetUser() { + return targetUser_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : targetUser_; + } + /** + * + * + *
+   * Optional. The target users for the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-target-user`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues target_user = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValuesOrBuilder getTargetUserOrBuilder() { + return targetUser_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : targetUser_; + } + + public static final int TEAM_FIELD_NUMBER = 10; + private com.google.cloud.apihub.v1.AttributeValues team_; + /** + * + * + *
+   * Optional. The team owning the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-team`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues team = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the team field is set. + */ + @java.lang.Override + public boolean hasTeam() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+   * Optional. The team owning the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-team`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues team = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The team. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getTeam() { + return team_ == null ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() : team_; + } + /** + * + * + *
+   * Optional. The team owning the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-team`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues team = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValuesOrBuilder getTeamOrBuilder() { + return team_ == null ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() : team_; + } + + public static final int BUSINESS_UNIT_FIELD_NUMBER = 11; + private com.google.cloud.apihub.v1.AttributeValues businessUnit_; + /** + * + * + *
+   * Optional. The business unit owning the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-business-unit`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues business_unit = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the businessUnit field is set. + */ + @java.lang.Override + public boolean hasBusinessUnit() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+   * Optional. The business unit owning the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-business-unit`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues business_unit = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The businessUnit. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getBusinessUnit() { + return businessUnit_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : businessUnit_; + } + /** + * + * + *
+   * Optional. The business unit owning the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-business-unit`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues business_unit = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValuesOrBuilder getBusinessUnitOrBuilder() { + return businessUnit_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : businessUnit_; + } + + public static final int MATURITY_LEVEL_FIELD_NUMBER = 12; + private com.google.cloud.apihub.v1.AttributeValues maturityLevel_; + /** + * + * + *
+   * Optional. The maturity level of the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-maturity-level`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues maturity_level = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the maturityLevel field is set. + */ + @java.lang.Override + public boolean hasMaturityLevel() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+   * Optional. The maturity level of the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-maturity-level`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues maturity_level = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The maturityLevel. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getMaturityLevel() { + return maturityLevel_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : maturityLevel_; + } + /** + * + * + *
+   * Optional. The maturity level of the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-maturity-level`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues maturity_level = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValuesOrBuilder getMaturityLevelOrBuilder() { + return maturityLevel_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : maturityLevel_; + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 13; + + private static final class AttributesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.apihub.v1.AttributeValues> + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Api_AttributesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField + attributes_; + + private com.google.protobuf.MapField + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField(AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the API
+   * resource. The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().getMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the API
+   * resource. The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the API
+   * resource. The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.apihub.v1.AttributeValues getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the API
+   * resource. The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getAttributesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int API_STYLE_FIELD_NUMBER = 14; + private com.google.cloud.apihub.v1.AttributeValues apiStyle_; + /** + * + * + *
+   * Optional. The style of the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-api-style`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues api_style = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the apiStyle field is set. + */ + @java.lang.Override + public boolean hasApiStyle() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * + * + *
+   * Optional. The style of the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-api-style`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues api_style = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The apiStyle. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getApiStyle() { + return apiStyle_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : apiStyle_; + } + /** + * + * + *
+   * Optional. The style of the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-api-style`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues api_style = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValuesOrBuilder getApiStyleOrBuilder() { + return apiStyle_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : apiStyle_; + } + + public static final int SELECTED_VERSION_FIELD_NUMBER = 15; + + @SuppressWarnings("serial") + private volatile java.lang.Object selectedVersion_ = ""; + /** + * + * + *
+   * Optional. The selected version for an API resource.
+   * This can be used when special handling is needed on client side for
+   * particular version of the API. Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * string selected_version = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The selectedVersion. + */ + @java.lang.Override + public java.lang.String getSelectedVersion() { + java.lang.Object ref = selectedVersion_; + 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(); + selectedVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The selected version for an API resource.
+   * This can be used when special handling is needed on client side for
+   * particular version of the API. Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * string selected_version = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for selectedVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSelectedVersionBytes() { + java.lang.Object ref = selectedVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selectedVersion_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getDocumentation()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getOwner()); + } + for (int i = 0; i < versions_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, versions_.getRaw(i)); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(7, getCreateTime()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(8, getUpdateTime()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(9, getTargetUser()); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(10, getTeam()); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeMessage(11, getBusinessUnit()); + } + if (((bitField0_ & 0x00000080) != 0)) { + output.writeMessage(12, getMaturityLevel()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAttributes(), AttributesDefaultEntryHolder.defaultEntry, 13); + if (((bitField0_ & 0x00000100) != 0)) { + output.writeMessage(14, getApiStyle()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selectedVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 15, selectedVersion_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getDocumentation()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getOwner()); + } + { + int dataSize = 0; + for (int i = 0; i < versions_.size(); i++) { + dataSize += computeStringSizeNoTag(versions_.getRaw(i)); + } + size += dataSize; + size += 1 * getVersionsList().size(); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getCreateTime()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getUpdateTime()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getTargetUser()); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getTeam()); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getBusinessUnit()); + } + if (((bitField0_ & 0x00000080) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getMaturityLevel()); + } + for (java.util.Map.Entry entry : + internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry + attributes__ = + AttributesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, attributes__); + } + if (((bitField0_ & 0x00000100) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getApiStyle()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selectedVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, selectedVersion_); + } + size += getUnknownFields().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.apihub.v1.Api)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.Api other = (com.google.cloud.apihub.v1.Api) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (hasDocumentation() != other.hasDocumentation()) return false; + if (hasDocumentation()) { + if (!getDocumentation().equals(other.getDocumentation())) return false; + } + if (hasOwner() != other.hasOwner()) return false; + if (hasOwner()) { + if (!getOwner().equals(other.getOwner())) return false; + } + if (!getVersionsList().equals(other.getVersionsList())) 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 (hasTargetUser() != other.hasTargetUser()) return false; + if (hasTargetUser()) { + if (!getTargetUser().equals(other.getTargetUser())) return false; + } + if (hasTeam() != other.hasTeam()) return false; + if (hasTeam()) { + if (!getTeam().equals(other.getTeam())) return false; + } + if (hasBusinessUnit() != other.hasBusinessUnit()) return false; + if (hasBusinessUnit()) { + if (!getBusinessUnit().equals(other.getBusinessUnit())) return false; + } + if (hasMaturityLevel() != other.hasMaturityLevel()) return false; + if (hasMaturityLevel()) { + if (!getMaturityLevel().equals(other.getMaturityLevel())) return false; + } + if (!internalGetAttributes().equals(other.internalGetAttributes())) return false; + if (hasApiStyle() != other.hasApiStyle()) return false; + if (hasApiStyle()) { + if (!getApiStyle().equals(other.getApiStyle())) return false; + } + if (!getSelectedVersion().equals(other.getSelectedVersion())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasDocumentation()) { + hash = (37 * hash) + DOCUMENTATION_FIELD_NUMBER; + hash = (53 * hash) + getDocumentation().hashCode(); + } + if (hasOwner()) { + hash = (37 * hash) + OWNER_FIELD_NUMBER; + hash = (53 * hash) + getOwner().hashCode(); + } + if (getVersionsCount() > 0) { + hash = (37 * hash) + VERSIONS_FIELD_NUMBER; + hash = (53 * hash) + getVersionsList().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 (hasTargetUser()) { + hash = (37 * hash) + TARGET_USER_FIELD_NUMBER; + hash = (53 * hash) + getTargetUser().hashCode(); + } + if (hasTeam()) { + hash = (37 * hash) + TEAM_FIELD_NUMBER; + hash = (53 * hash) + getTeam().hashCode(); + } + if (hasBusinessUnit()) { + hash = (37 * hash) + BUSINESS_UNIT_FIELD_NUMBER; + hash = (53 * hash) + getBusinessUnit().hashCode(); + } + if (hasMaturityLevel()) { + hash = (37 * hash) + MATURITY_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + getMaturityLevel().hashCode(); + } + if (!internalGetAttributes().getMap().isEmpty()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttributes().hashCode(); + } + if (hasApiStyle()) { + hash = (37 * hash) + API_STYLE_FIELD_NUMBER; + hash = (53 * hash) + getApiStyle().hashCode(); + } + hash = (37 * hash) + SELECTED_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getSelectedVersion().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.Api parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Api 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.apihub.v1.Api parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Api 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.apihub.v1.Api parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Api parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.Api parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Api 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.apihub.v1.Api parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Api 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.apihub.v1.Api parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Api 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.apihub.v1.Api 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; + } + /** + * + * + *
+   * An API resource in the API Hub.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Api} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.Api) + com.google.cloud.apihub.v1.ApiOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Api_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 13: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 13: + return internalGetMutableAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Api_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Api.class, com.google.cloud.apihub.v1.Api.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.Api.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getDocumentationFieldBuilder(); + getOwnerFieldBuilder(); + getCreateTimeFieldBuilder(); + getUpdateTimeFieldBuilder(); + getTargetUserFieldBuilder(); + getTeamFieldBuilder(); + getBusinessUnitFieldBuilder(); + getMaturityLevelFieldBuilder(); + getApiStyleFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + description_ = ""; + documentation_ = null; + if (documentationBuilder_ != null) { + documentationBuilder_.dispose(); + documentationBuilder_ = null; + } + owner_ = null; + if (ownerBuilder_ != null) { + ownerBuilder_.dispose(); + ownerBuilder_ = null; + } + versions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + targetUser_ = null; + if (targetUserBuilder_ != null) { + targetUserBuilder_.dispose(); + targetUserBuilder_ = null; + } + team_ = null; + if (teamBuilder_ != null) { + teamBuilder_.dispose(); + teamBuilder_ = null; + } + businessUnit_ = null; + if (businessUnitBuilder_ != null) { + businessUnitBuilder_.dispose(); + businessUnitBuilder_ = null; + } + maturityLevel_ = null; + if (maturityLevelBuilder_ != null) { + maturityLevelBuilder_.dispose(); + maturityLevelBuilder_ = null; + } + internalGetMutableAttributes().clear(); + apiStyle_ = null; + if (apiStyleBuilder_ != null) { + apiStyleBuilder_.dispose(); + apiStyleBuilder_ = null; + } + selectedVersion_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Api_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Api getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.Api.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Api build() { + com.google.cloud.apihub.v1.Api result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Api buildPartial() { + com.google.cloud.apihub.v1.Api result = new com.google.cloud.apihub.v1.Api(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.Api result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.documentation_ = + documentationBuilder_ == null ? documentation_ : documentationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.owner_ = ownerBuilder_ == null ? owner_ : ownerBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + versions_.makeImmutable(); + result.versions_ = versions_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.targetUser_ = targetUserBuilder_ == null ? targetUser_ : targetUserBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.team_ = teamBuilder_ == null ? team_ : teamBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.businessUnit_ = + businessUnitBuilder_ == null ? businessUnit_ : businessUnitBuilder_.build(); + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.maturityLevel_ = + maturityLevelBuilder_ == null ? maturityLevel_ : maturityLevelBuilder_.build(); + to_bitField0_ |= 0x00000080; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.attributes_ = + internalGetAttributes().build(AttributesDefaultEntryHolder.defaultEntry); + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.apiStyle_ = apiStyleBuilder_ == null ? apiStyle_ : apiStyleBuilder_.build(); + to_bitField0_ |= 0x00000100; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.selectedVersion_ = selectedVersion_; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.Api) { + return mergeFrom((com.google.cloud.apihub.v1.Api) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.Api other) { + if (other == com.google.cloud.apihub.v1.Api.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasDocumentation()) { + mergeDocumentation(other.getDocumentation()); + } + if (other.hasOwner()) { + mergeOwner(other.getOwner()); + } + if (!other.versions_.isEmpty()) { + if (versions_.isEmpty()) { + versions_ = other.versions_; + bitField0_ |= 0x00000020; + } else { + ensureVersionsIsMutable(); + versions_.addAll(other.versions_); + } + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasTargetUser()) { + mergeTargetUser(other.getTargetUser()); + } + if (other.hasTeam()) { + mergeTeam(other.getTeam()); + } + if (other.hasBusinessUnit()) { + mergeBusinessUnit(other.getBusinessUnit()); + } + if (other.hasMaturityLevel()) { + mergeMaturityLevel(other.getMaturityLevel()); + } + internalGetMutableAttributes().mergeFrom(other.internalGetAttributes()); + bitField0_ |= 0x00001000; + if (other.hasApiStyle()) { + mergeApiStyle(other.getApiStyle()); + } + if (!other.getSelectedVersion().isEmpty()) { + selectedVersion_ = other.selectedVersion_; + bitField0_ |= 0x00004000; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getDocumentationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage(getOwnerFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureVersionsIsMutable(); + versions_.add(s); + break; + } // case 50 + case 58: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 74: + { + input.readMessage(getTargetUserFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 82: + { + input.readMessage(getTeamFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 90: + { + input.readMessage(getBusinessUnitFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 90 + case 98: + { + input.readMessage(getMaturityLevelFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 98 + case 106: + { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.apihub.v1.AttributeValues> + attributes__ = + input.readMessage( + AttributesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAttributes() + .ensureBuilderMap() + .put(attributes__.getKey(), attributes__.getValue()); + bitField0_ |= 0x00001000; + break; + } // case 106 + case 114: + { + input.readMessage(getApiStyleFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00002000; + break; + } // case 114 + case 122: + { + selectedVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00004000; + break; + } // case 122 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. The name of the API resource in the API Hub.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. The name of the API resource in the API Hub.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. The name of the API resource in the API Hub.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The name of the API resource in the API Hub.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The name of the API resource in the API Hub.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Required. The display name of the API resource.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. The display name of the API resource.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. The display name of the API resource.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The display name of the API resource.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The display name of the API resource.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Optional. The description of the API resource.
+     * 
+ * + * string description = 3 [(.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. The description of the API resource.
+     * 
+ * + * string description = 3 [(.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. The description of the API resource.
+     * 
+ * + * string description = 3 [(.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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The description of the API resource.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The description of the API resource.
+     * 
+ * + * string description = 3 [(.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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.cloud.apihub.v1.Documentation documentation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Documentation, + com.google.cloud.apihub.v1.Documentation.Builder, + com.google.cloud.apihub.v1.DocumentationOrBuilder> + documentationBuilder_; + /** + * + * + *
+     * Optional. The documentation for the API resource.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the documentation field is set. + */ + public boolean hasDocumentation() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Optional. The documentation for the API resource.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The documentation. + */ + public com.google.cloud.apihub.v1.Documentation getDocumentation() { + if (documentationBuilder_ == null) { + return documentation_ == null + ? com.google.cloud.apihub.v1.Documentation.getDefaultInstance() + : documentation_; + } else { + return documentationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The documentation for the API resource.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDocumentation(com.google.cloud.apihub.v1.Documentation value) { + if (documentationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + documentation_ = value; + } else { + documentationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The documentation for the API resource.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDocumentation( + com.google.cloud.apihub.v1.Documentation.Builder builderForValue) { + if (documentationBuilder_ == null) { + documentation_ = builderForValue.build(); + } else { + documentationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The documentation for the API resource.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeDocumentation(com.google.cloud.apihub.v1.Documentation value) { + if (documentationBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && documentation_ != null + && documentation_ != com.google.cloud.apihub.v1.Documentation.getDefaultInstance()) { + getDocumentationBuilder().mergeFrom(value); + } else { + documentation_ = value; + } + } else { + documentationBuilder_.mergeFrom(value); + } + if (documentation_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. The documentation for the API resource.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearDocumentation() { + bitField0_ = (bitField0_ & ~0x00000008); + documentation_ = null; + if (documentationBuilder_ != null) { + documentationBuilder_.dispose(); + documentationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The documentation for the API resource.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.Documentation.Builder getDocumentationBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getDocumentationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The documentation for the API resource.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.DocumentationOrBuilder getDocumentationOrBuilder() { + if (documentationBuilder_ != null) { + return documentationBuilder_.getMessageOrBuilder(); + } else { + return documentation_ == null + ? com.google.cloud.apihub.v1.Documentation.getDefaultInstance() + : documentation_; + } + } + /** + * + * + *
+     * Optional. The documentation for the API resource.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Documentation, + com.google.cloud.apihub.v1.Documentation.Builder, + com.google.cloud.apihub.v1.DocumentationOrBuilder> + getDocumentationFieldBuilder() { + if (documentationBuilder_ == null) { + documentationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Documentation, + com.google.cloud.apihub.v1.Documentation.Builder, + com.google.cloud.apihub.v1.DocumentationOrBuilder>( + getDocumentation(), getParentForChildren(), isClean()); + documentation_ = null; + } + return documentationBuilder_; + } + + private com.google.cloud.apihub.v1.Owner owner_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Owner, + com.google.cloud.apihub.v1.Owner.Builder, + com.google.cloud.apihub.v1.OwnerOrBuilder> + ownerBuilder_; + /** + * + * + *
+     * Optional. Owner details for the API resource.
+     * 
+ * + * .google.cloud.apihub.v1.Owner owner = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the owner field is set. + */ + public boolean hasOwner() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Optional. Owner details for the API resource.
+     * 
+ * + * .google.cloud.apihub.v1.Owner owner = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The owner. + */ + public com.google.cloud.apihub.v1.Owner getOwner() { + if (ownerBuilder_ == null) { + return owner_ == null ? com.google.cloud.apihub.v1.Owner.getDefaultInstance() : owner_; + } else { + return ownerBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Owner details for the API resource.
+     * 
+ * + * .google.cloud.apihub.v1.Owner owner = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setOwner(com.google.cloud.apihub.v1.Owner value) { + if (ownerBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + owner_ = value; + } else { + ownerBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Owner details for the API resource.
+     * 
+ * + * .google.cloud.apihub.v1.Owner owner = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setOwner(com.google.cloud.apihub.v1.Owner.Builder builderForValue) { + if (ownerBuilder_ == null) { + owner_ = builderForValue.build(); + } else { + ownerBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Owner details for the API resource.
+     * 
+ * + * .google.cloud.apihub.v1.Owner owner = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeOwner(com.google.cloud.apihub.v1.Owner value) { + if (ownerBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && owner_ != null + && owner_ != com.google.cloud.apihub.v1.Owner.getDefaultInstance()) { + getOwnerBuilder().mergeFrom(value); + } else { + owner_ = value; + } + } else { + ownerBuilder_.mergeFrom(value); + } + if (owner_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. Owner details for the API resource.
+     * 
+ * + * .google.cloud.apihub.v1.Owner owner = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearOwner() { + bitField0_ = (bitField0_ & ~0x00000010); + owner_ = null; + if (ownerBuilder_ != null) { + ownerBuilder_.dispose(); + ownerBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Owner details for the API resource.
+     * 
+ * + * .google.cloud.apihub.v1.Owner owner = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.Owner.Builder getOwnerBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getOwnerFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Owner details for the API resource.
+     * 
+ * + * .google.cloud.apihub.v1.Owner owner = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.OwnerOrBuilder getOwnerOrBuilder() { + if (ownerBuilder_ != null) { + return ownerBuilder_.getMessageOrBuilder(); + } else { + return owner_ == null ? com.google.cloud.apihub.v1.Owner.getDefaultInstance() : owner_; + } + } + /** + * + * + *
+     * Optional. Owner details for the API resource.
+     * 
+ * + * .google.cloud.apihub.v1.Owner owner = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Owner, + com.google.cloud.apihub.v1.Owner.Builder, + com.google.cloud.apihub.v1.OwnerOrBuilder> + getOwnerFieldBuilder() { + if (ownerBuilder_ == null) { + ownerBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Owner, + com.google.cloud.apihub.v1.Owner.Builder, + com.google.cloud.apihub.v1.OwnerOrBuilder>( + getOwner(), getParentForChildren(), isClean()); + owner_ = null; + } + return ownerBuilder_; + } + + private com.google.protobuf.LazyStringArrayList versions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureVersionsIsMutable() { + if (!versions_.isModifiable()) { + versions_ = new com.google.protobuf.LazyStringArrayList(versions_); + } + bitField0_ |= 0x00000020; + } + /** + * + * + *
+     * Output only. The list of versions present in an API resource.
+     * Note: An API resource can be associated with more than 1 version.
+     * Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * repeated string versions = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the versions. + */ + public com.google.protobuf.ProtocolStringList getVersionsList() { + versions_.makeImmutable(); + return versions_; + } + /** + * + * + *
+     * Output only. The list of versions present in an API resource.
+     * Note: An API resource can be associated with more than 1 version.
+     * Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * repeated string versions = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The count of versions. + */ + public int getVersionsCount() { + return versions_.size(); + } + /** + * + * + *
+     * Output only. The list of versions present in an API resource.
+     * Note: An API resource can be associated with more than 1 version.
+     * Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * repeated string versions = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The versions at the given index. + */ + public java.lang.String getVersions(int index) { + return versions_.get(index); + } + /** + * + * + *
+     * Output only. The list of versions present in an API resource.
+     * Note: An API resource can be associated with more than 1 version.
+     * Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * repeated string versions = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the versions at the given index. + */ + public com.google.protobuf.ByteString getVersionsBytes(int index) { + return versions_.getByteString(index); + } + /** + * + * + *
+     * Output only. The list of versions present in an API resource.
+     * Note: An API resource can be associated with more than 1 version.
+     * Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * repeated string versions = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index to set the value at. + * @param value The versions to set. + * @return This builder for chaining. + */ + public Builder setVersions(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureVersionsIsMutable(); + versions_.set(index, value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The list of versions present in an API resource.
+     * Note: An API resource can be associated with more than 1 version.
+     * Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * repeated string versions = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The versions to add. + * @return This builder for chaining. + */ + public Builder addVersions(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureVersionsIsMutable(); + versions_.add(value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The list of versions present in an API resource.
+     * Note: An API resource can be associated with more than 1 version.
+     * Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * repeated string versions = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param values The versions to add. + * @return This builder for chaining. + */ + public Builder addAllVersions(java.lang.Iterable values) { + ensureVersionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, versions_); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The list of versions present in an API resource.
+     * Note: An API resource can be associated with more than 1 version.
+     * Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * repeated string versions = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearVersions() { + versions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The list of versions present in an API resource.
+     * Note: An API resource can be associated with more than 1 version.
+     * Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * repeated string versions = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes of the versions to add. + * @return This builder for chaining. + */ + public Builder addVersionsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureVersionsIsMutable(); + versions_.add(value); + bitField0_ |= 0x00000020; + 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. The time at which the API resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * Output only. The time at which the API resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.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. The time at which the API resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the API resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the API resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The time at which the API resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000040); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the API resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time at which the API resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.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. The time at which the API resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_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> + 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 time at which the API resource was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+     * Output only. The time at which the API resource was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.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 time at which the API resource was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the API resource was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the API resource was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The time at which the API resource was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000080); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the API resource was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time at which the API resource was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.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 time at which the API resource was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_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> + 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.cloud.apihub.v1.AttributeValues targetUser_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder> + targetUserBuilder_; + /** + * + * + *
+     * Optional. The target users for the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-target-user`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues target_user = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the targetUser field is set. + */ + public boolean hasTargetUser() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * + * + *
+     * Optional. The target users for the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-target-user`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues target_user = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The targetUser. + */ + public com.google.cloud.apihub.v1.AttributeValues getTargetUser() { + if (targetUserBuilder_ == null) { + return targetUser_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : targetUser_; + } else { + return targetUserBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The target users for the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-target-user`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues target_user = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTargetUser(com.google.cloud.apihub.v1.AttributeValues value) { + if (targetUserBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + targetUser_ = value; + } else { + targetUserBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The target users for the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-target-user`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues target_user = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTargetUser( + com.google.cloud.apihub.v1.AttributeValues.Builder builderForValue) { + if (targetUserBuilder_ == null) { + targetUser_ = builderForValue.build(); + } else { + targetUserBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The target users for the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-target-user`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues target_user = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeTargetUser(com.google.cloud.apihub.v1.AttributeValues value) { + if (targetUserBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && targetUser_ != null + && targetUser_ != com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance()) { + getTargetUserBuilder().mergeFrom(value); + } else { + targetUser_ = value; + } + } else { + targetUserBuilder_.mergeFrom(value); + } + if (targetUser_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. The target users for the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-target-user`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues target_user = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearTargetUser() { + bitField0_ = (bitField0_ & ~0x00000100); + targetUser_ = null; + if (targetUserBuilder_ != null) { + targetUserBuilder_.dispose(); + targetUserBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The target users for the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-target-user`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues target_user = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.AttributeValues.Builder getTargetUserBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getTargetUserFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The target users for the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-target-user`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues target_user = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.AttributeValuesOrBuilder getTargetUserOrBuilder() { + if (targetUserBuilder_ != null) { + return targetUserBuilder_.getMessageOrBuilder(); + } else { + return targetUser_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : targetUser_; + } + } + /** + * + * + *
+     * Optional. The target users for the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-target-user`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues target_user = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder> + getTargetUserFieldBuilder() { + if (targetUserBuilder_ == null) { + targetUserBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder>( + getTargetUser(), getParentForChildren(), isClean()); + targetUser_ = null; + } + return targetUserBuilder_; + } + + private com.google.cloud.apihub.v1.AttributeValues team_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder> + teamBuilder_; + /** + * + * + *
+     * Optional. The team owning the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-team`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues team = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the team field is set. + */ + public boolean hasTeam() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * + * + *
+     * Optional. The team owning the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-team`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues team = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The team. + */ + public com.google.cloud.apihub.v1.AttributeValues getTeam() { + if (teamBuilder_ == null) { + return team_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : team_; + } else { + return teamBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The team owning the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-team`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues team = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTeam(com.google.cloud.apihub.v1.AttributeValues value) { + if (teamBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + team_ = value; + } else { + teamBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The team owning the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-team`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues team = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTeam(com.google.cloud.apihub.v1.AttributeValues.Builder builderForValue) { + if (teamBuilder_ == null) { + team_ = builderForValue.build(); + } else { + teamBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The team owning the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-team`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues team = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeTeam(com.google.cloud.apihub.v1.AttributeValues value) { + if (teamBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && team_ != null + && team_ != com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance()) { + getTeamBuilder().mergeFrom(value); + } else { + team_ = value; + } + } else { + teamBuilder_.mergeFrom(value); + } + if (team_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. The team owning the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-team`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues team = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearTeam() { + bitField0_ = (bitField0_ & ~0x00000200); + team_ = null; + if (teamBuilder_ != null) { + teamBuilder_.dispose(); + teamBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The team owning the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-team`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues team = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.AttributeValues.Builder getTeamBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getTeamFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The team owning the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-team`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues team = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.AttributeValuesOrBuilder getTeamOrBuilder() { + if (teamBuilder_ != null) { + return teamBuilder_.getMessageOrBuilder(); + } else { + return team_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : team_; + } + } + /** + * + * + *
+     * Optional. The team owning the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-team`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues team = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder> + getTeamFieldBuilder() { + if (teamBuilder_ == null) { + teamBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder>( + getTeam(), getParentForChildren(), isClean()); + team_ = null; + } + return teamBuilder_; + } + + private com.google.cloud.apihub.v1.AttributeValues businessUnit_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder> + businessUnitBuilder_; + /** + * + * + *
+     * Optional. The business unit owning the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-business-unit`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues business_unit = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the businessUnit field is set. + */ + public boolean hasBusinessUnit() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + * + * + *
+     * Optional. The business unit owning the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-business-unit`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues business_unit = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The businessUnit. + */ + public com.google.cloud.apihub.v1.AttributeValues getBusinessUnit() { + if (businessUnitBuilder_ == null) { + return businessUnit_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : businessUnit_; + } else { + return businessUnitBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The business unit owning the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-business-unit`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues business_unit = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setBusinessUnit(com.google.cloud.apihub.v1.AttributeValues value) { + if (businessUnitBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + businessUnit_ = value; + } else { + businessUnitBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The business unit owning the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-business-unit`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues business_unit = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setBusinessUnit( + com.google.cloud.apihub.v1.AttributeValues.Builder builderForValue) { + if (businessUnitBuilder_ == null) { + businessUnit_ = builderForValue.build(); + } else { + businessUnitBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The business unit owning the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-business-unit`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues business_unit = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeBusinessUnit(com.google.cloud.apihub.v1.AttributeValues value) { + if (businessUnitBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) + && businessUnit_ != null + && businessUnit_ != com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance()) { + getBusinessUnitBuilder().mergeFrom(value); + } else { + businessUnit_ = value; + } + } else { + businessUnitBuilder_.mergeFrom(value); + } + if (businessUnit_ != null) { + bitField0_ |= 0x00000400; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. The business unit owning the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-business-unit`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues business_unit = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearBusinessUnit() { + bitField0_ = (bitField0_ & ~0x00000400); + businessUnit_ = null; + if (businessUnitBuilder_ != null) { + businessUnitBuilder_.dispose(); + businessUnitBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The business unit owning the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-business-unit`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues business_unit = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.AttributeValues.Builder getBusinessUnitBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return getBusinessUnitFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The business unit owning the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-business-unit`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues business_unit = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.AttributeValuesOrBuilder getBusinessUnitOrBuilder() { + if (businessUnitBuilder_ != null) { + return businessUnitBuilder_.getMessageOrBuilder(); + } else { + return businessUnit_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : businessUnit_; + } + } + /** + * + * + *
+     * Optional. The business unit owning the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-business-unit`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues business_unit = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder> + getBusinessUnitFieldBuilder() { + if (businessUnitBuilder_ == null) { + businessUnitBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder>( + getBusinessUnit(), getParentForChildren(), isClean()); + businessUnit_ = null; + } + return businessUnitBuilder_; + } + + private com.google.cloud.apihub.v1.AttributeValues maturityLevel_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder> + maturityLevelBuilder_; + /** + * + * + *
+     * Optional. The maturity level of the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-maturity-level`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues maturity_level = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the maturityLevel field is set. + */ + public boolean hasMaturityLevel() { + return ((bitField0_ & 0x00000800) != 0); + } + /** + * + * + *
+     * Optional. The maturity level of the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-maturity-level`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues maturity_level = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The maturityLevel. + */ + public com.google.cloud.apihub.v1.AttributeValues getMaturityLevel() { + if (maturityLevelBuilder_ == null) { + return maturityLevel_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : maturityLevel_; + } else { + return maturityLevelBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The maturity level of the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-maturity-level`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues maturity_level = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setMaturityLevel(com.google.cloud.apihub.v1.AttributeValues value) { + if (maturityLevelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maturityLevel_ = value; + } else { + maturityLevelBuilder_.setMessage(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maturity level of the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-maturity-level`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues maturity_level = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setMaturityLevel( + com.google.cloud.apihub.v1.AttributeValues.Builder builderForValue) { + if (maturityLevelBuilder_ == null) { + maturityLevel_ = builderForValue.build(); + } else { + maturityLevelBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maturity level of the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-maturity-level`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues maturity_level = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeMaturityLevel(com.google.cloud.apihub.v1.AttributeValues value) { + if (maturityLevelBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) + && maturityLevel_ != null + && maturityLevel_ != com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance()) { + getMaturityLevelBuilder().mergeFrom(value); + } else { + maturityLevel_ = value; + } + } else { + maturityLevelBuilder_.mergeFrom(value); + } + if (maturityLevel_ != null) { + bitField0_ |= 0x00000800; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. The maturity level of the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-maturity-level`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues maturity_level = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearMaturityLevel() { + bitField0_ = (bitField0_ & ~0x00000800); + maturityLevel_ = null; + if (maturityLevelBuilder_ != null) { + maturityLevelBuilder_.dispose(); + maturityLevelBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maturity level of the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-maturity-level`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues maturity_level = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.AttributeValues.Builder getMaturityLevelBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return getMaturityLevelFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The maturity level of the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-maturity-level`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues maturity_level = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.AttributeValuesOrBuilder getMaturityLevelOrBuilder() { + if (maturityLevelBuilder_ != null) { + return maturityLevelBuilder_.getMessageOrBuilder(); + } else { + return maturityLevel_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : maturityLevel_; + } + } + /** + * + * + *
+     * Optional. The maturity level of the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-maturity-level`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues maturity_level = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder> + getMaturityLevelFieldBuilder() { + if (maturityLevelBuilder_ == null) { + maturityLevelBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder>( + getMaturityLevel(), getParentForChildren(), isClean()); + maturityLevel_ = null; + } + return maturityLevelBuilder_; + } + + private static final class AttributesConverter + implements com.google.protobuf.MapFieldBuilder.Converter< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues> { + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues build( + com.google.cloud.apihub.v1.AttributeValuesOrBuilder val) { + if (val instanceof com.google.cloud.apihub.v1.AttributeValues) { + return (com.google.cloud.apihub.v1.AttributeValues) val; + } + return ((com.google.cloud.apihub.v1.AttributeValues.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.apihub.v1.AttributeValues> + defaultEntry() { + return AttributesDefaultEntryHolder.defaultEntry; + } + }; + + private static final AttributesConverter attributesConverter = new AttributesConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder> + attributes_; + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder> + internalGetAttributes() { + if (attributes_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(attributesConverter); + } + return attributes_; + } + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder> + internalGetMutableAttributes() { + if (attributes_ == null) { + attributes_ = new com.google.protobuf.MapFieldBuilder<>(attributesConverter); + } + bitField0_ |= 0x00001000; + onChanged(); + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().ensureBuilderMap().size(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the API
+     * resource. The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().ensureBuilderMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the API
+     * resource. The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getImmutableMap(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the API
+     * resource. The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.apihub.v1.AttributeValues getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableAttributes().ensureBuilderMap(); + return map.containsKey(key) ? attributesConverter.build(map.get(key)) : defaultValue; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the API
+     * resource. The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getAttributesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableAttributes().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return attributesConverter.build(map.get(key)); + } + + public Builder clearAttributes() { + bitField0_ = (bitField0_ & ~0x00001000); + internalGetMutableAttributes().clear(); + return this; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the API
+     * resource. The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAttributes().ensureBuilderMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableAttributes() { + bitField0_ |= 0x00001000; + return internalGetMutableAttributes().ensureMessageMap(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the API
+     * resource. The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAttributes( + java.lang.String key, com.google.cloud.apihub.v1.AttributeValues value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAttributes().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00001000; + return this; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the API
+     * resource. The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllAttributes( + java.util.Map values) { + for (java.util.Map.Entry e : + values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableAttributes().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00001000; + return this; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the API
+     * resource. The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.AttributeValues.Builder putAttributesBuilderIfAbsent( + java.lang.String key) { + java.util.Map + builderMap = internalGetMutableAttributes().ensureBuilderMap(); + com.google.cloud.apihub.v1.AttributeValuesOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = com.google.cloud.apihub.v1.AttributeValues.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.cloud.apihub.v1.AttributeValues) { + entry = ((com.google.cloud.apihub.v1.AttributeValues) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.cloud.apihub.v1.AttributeValues.Builder) entry; + } + + private com.google.cloud.apihub.v1.AttributeValues apiStyle_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder> + apiStyleBuilder_; + /** + * + * + *
+     * Optional. The style of the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-api-style`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues api_style = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the apiStyle field is set. + */ + public boolean hasApiStyle() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + * + * + *
+     * Optional. The style of the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-api-style`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues api_style = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The apiStyle. + */ + public com.google.cloud.apihub.v1.AttributeValues getApiStyle() { + if (apiStyleBuilder_ == null) { + return apiStyle_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : apiStyle_; + } else { + return apiStyleBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The style of the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-api-style`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues api_style = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setApiStyle(com.google.cloud.apihub.v1.AttributeValues value) { + if (apiStyleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + apiStyle_ = value; + } else { + apiStyleBuilder_.setMessage(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The style of the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-api-style`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues api_style = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setApiStyle(com.google.cloud.apihub.v1.AttributeValues.Builder builderForValue) { + if (apiStyleBuilder_ == null) { + apiStyle_ = builderForValue.build(); + } else { + apiStyleBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The style of the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-api-style`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues api_style = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeApiStyle(com.google.cloud.apihub.v1.AttributeValues value) { + if (apiStyleBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0) + && apiStyle_ != null + && apiStyle_ != com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance()) { + getApiStyleBuilder().mergeFrom(value); + } else { + apiStyle_ = value; + } + } else { + apiStyleBuilder_.mergeFrom(value); + } + if (apiStyle_ != null) { + bitField0_ |= 0x00002000; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. The style of the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-api-style`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues api_style = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearApiStyle() { + bitField0_ = (bitField0_ & ~0x00002000); + apiStyle_ = null; + if (apiStyleBuilder_ != null) { + apiStyleBuilder_.dispose(); + apiStyleBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The style of the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-api-style`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues api_style = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.AttributeValues.Builder getApiStyleBuilder() { + bitField0_ |= 0x00002000; + onChanged(); + return getApiStyleFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The style of the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-api-style`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues api_style = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.AttributeValuesOrBuilder getApiStyleOrBuilder() { + if (apiStyleBuilder_ != null) { + return apiStyleBuilder_.getMessageOrBuilder(); + } else { + return apiStyle_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : apiStyle_; + } + } + /** + * + * + *
+     * Optional. The style of the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-api-style`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues api_style = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder> + getApiStyleFieldBuilder() { + if (apiStyleBuilder_ == null) { + apiStyleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder>( + getApiStyle(), getParentForChildren(), isClean()); + apiStyle_ = null; + } + return apiStyleBuilder_; + } + + private java.lang.Object selectedVersion_ = ""; + /** + * + * + *
+     * Optional. The selected version for an API resource.
+     * This can be used when special handling is needed on client side for
+     * particular version of the API. Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * string selected_version = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The selectedVersion. + */ + public java.lang.String getSelectedVersion() { + java.lang.Object ref = selectedVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selectedVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The selected version for an API resource.
+     * This can be used when special handling is needed on client side for
+     * particular version of the API. Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * string selected_version = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for selectedVersion. + */ + public com.google.protobuf.ByteString getSelectedVersionBytes() { + java.lang.Object ref = selectedVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selectedVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The selected version for an API resource.
+     * This can be used when special handling is needed on client side for
+     * particular version of the API. Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * string selected_version = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The selectedVersion to set. + * @return This builder for chaining. + */ + public Builder setSelectedVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + selectedVersion_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The selected version for an API resource.
+     * This can be used when special handling is needed on client side for
+     * particular version of the API. Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * string selected_version = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearSelectedVersion() { + selectedVersion_ = getDefaultInstance().getSelectedVersion(); + bitField0_ = (bitField0_ & ~0x00004000); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The selected version for an API resource.
+     * This can be used when special handling is needed on client side for
+     * particular version of the API. Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * string selected_version = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for selectedVersion to set. + * @return This builder for chaining. + */ + public Builder setSelectedVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + selectedVersion_ = value; + bitField0_ |= 0x00004000; + 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.apihub.v1.Api) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.Api) + private static final com.google.cloud.apihub.v1.Api DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.Api(); + } + + public static com.google.cloud.apihub.v1.Api getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Api parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.Api getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubInstance.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubInstance.java new file mode 100644 index 000000000000..c29495233e59 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubInstance.java @@ -0,0 +1,3310 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * An ApiHubInstance represents the instance resources of the API Hub.
+ * Currently, only one ApiHub instance is allowed for each project.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ApiHubInstance} + */ +public final class ApiHubInstance extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.ApiHubInstance) + ApiHubInstanceOrBuilder { + private static final long serialVersionUID = 0L; + // Use ApiHubInstance.newBuilder() to construct. + private ApiHubInstance(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ApiHubInstance() { + name_ = ""; + state_ = 0; + stateMessage_ = ""; + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ApiHubInstance(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_ApiHubInstance_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 7: + 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.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_ApiHubInstance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ApiHubInstance.class, + com.google.cloud.apihub.v1.ApiHubInstance.Builder.class); + } + + /** + * + * + *
+   * State of the ApiHub Instance.
+   * 
+ * + * Protobuf enum {@code google.cloud.apihub.v1.ApiHubInstance.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The default value. This value is used if the state is omitted.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The ApiHub instance has not been initialized or has been deleted.
+     * 
+ * + * INACTIVE = 1; + */ + INACTIVE(1), + /** + * + * + *
+     * The ApiHub instance is being created.
+     * 
+ * + * CREATING = 2; + */ + CREATING(2), + /** + * + * + *
+     * The ApiHub instance has been created and is ready for use.
+     * 
+ * + * ACTIVE = 3; + */ + ACTIVE(3), + /** + * + * + *
+     * The ApiHub instance is being updated.
+     * 
+ * + * UPDATING = 4; + */ + UPDATING(4), + /** + * + * + *
+     * The ApiHub instance is being deleted.
+     * 
+ * + * DELETING = 5; + */ + DELETING(5), + /** + * + * + *
+     * The ApiHub instance encountered an error during a state change.
+     * 
+ * + * FAILED = 6; + */ + FAILED(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The default value. This value is used if the state is omitted.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The ApiHub instance has not been initialized or has been deleted.
+     * 
+ * + * INACTIVE = 1; + */ + public static final int INACTIVE_VALUE = 1; + /** + * + * + *
+     * The ApiHub instance is being created.
+     * 
+ * + * CREATING = 2; + */ + public static final int CREATING_VALUE = 2; + /** + * + * + *
+     * The ApiHub instance has been created and is ready for use.
+     * 
+ * + * ACTIVE = 3; + */ + public static final int ACTIVE_VALUE = 3; + /** + * + * + *
+     * The ApiHub instance is being updated.
+     * 
+ * + * UPDATING = 4; + */ + public static final int UPDATING_VALUE = 4; + /** + * + * + *
+     * The ApiHub instance is being deleted.
+     * 
+ * + * DELETING = 5; + */ + public static final int DELETING_VALUE = 5; + /** + * + * + *
+     * The ApiHub instance encountered an error during a state change.
+     * 
+ * + * FAILED = 6; + */ + public static final int FAILED_VALUE = 6; + + 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 INACTIVE; + case 2: + return CREATING; + case 3: + return ACTIVE; + case 4: + return UPDATING; + case 5: + return DELETING; + case 6: + return FAILED; + 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.apihub.v1.ApiHubInstance.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.apihub.v1.ApiHubInstance.State) + } + + public interface ConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.ApiHubInstance.Config) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The Customer Managed Encryption Key (CMEK) used for data
+     * encryption. The CMEK name should follow the format of
+     * `projects/([^/]+)/locations/([^/]+)/keyRings/([^/]+)/cryptoKeys/([^/]+)`,
+     * where the location must match the instance location.
+     * 
+ * + * string cmek_key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The cmekKeyName. + */ + java.lang.String getCmekKeyName(); + /** + * + * + *
+     * Required. The Customer Managed Encryption Key (CMEK) used for data
+     * encryption. The CMEK name should follow the format of
+     * `projects/([^/]+)/locations/([^/]+)/keyRings/([^/]+)/cryptoKeys/([^/]+)`,
+     * where the location must match the instance location.
+     * 
+ * + * string cmek_key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for cmekKeyName. + */ + com.google.protobuf.ByteString getCmekKeyNameBytes(); + } + /** + * + * + *
+   * Available configurations to provision an ApiHub Instance.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ApiHubInstance.Config} + */ + public static final class Config extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.ApiHubInstance.Config) + ConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use Config.newBuilder() to construct. + private Config(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Config() { + cmekKeyName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Config(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_ApiHubInstance_Config_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_ApiHubInstance_Config_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ApiHubInstance.Config.class, + com.google.cloud.apihub.v1.ApiHubInstance.Config.Builder.class); + } + + public static final int CMEK_KEY_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object cmekKeyName_ = ""; + /** + * + * + *
+     * Required. The Customer Managed Encryption Key (CMEK) used for data
+     * encryption. The CMEK name should follow the format of
+     * `projects/([^/]+)/locations/([^/]+)/keyRings/([^/]+)/cryptoKeys/([^/]+)`,
+     * where the location must match the instance location.
+     * 
+ * + * string cmek_key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The cmekKeyName. + */ + @java.lang.Override + public java.lang.String getCmekKeyName() { + java.lang.Object ref = cmekKeyName_; + 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(); + cmekKeyName_ = s; + return s; + } + } + /** + * + * + *
+     * Required. The Customer Managed Encryption Key (CMEK) used for data
+     * encryption. The CMEK name should follow the format of
+     * `projects/([^/]+)/locations/([^/]+)/keyRings/([^/]+)/cryptoKeys/([^/]+)`,
+     * where the location must match the instance location.
+     * 
+ * + * string cmek_key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for cmekKeyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCmekKeyNameBytes() { + java.lang.Object ref = cmekKeyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cmekKeyName_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cmekKeyName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, cmekKeyName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cmekKeyName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, cmekKeyName_); + } + size += getUnknownFields().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.apihub.v1.ApiHubInstance.Config)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.ApiHubInstance.Config other = + (com.google.cloud.apihub.v1.ApiHubInstance.Config) obj; + + if (!getCmekKeyName().equals(other.getCmekKeyName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + CMEK_KEY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getCmekKeyName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.ApiHubInstance.Config parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ApiHubInstance.Config 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.apihub.v1.ApiHubInstance.Config parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ApiHubInstance.Config 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.apihub.v1.ApiHubInstance.Config parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ApiHubInstance.Config parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.ApiHubInstance.Config parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ApiHubInstance.Config 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.apihub.v1.ApiHubInstance.Config parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ApiHubInstance.Config 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.apihub.v1.ApiHubInstance.Config parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ApiHubInstance.Config 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.apihub.v1.ApiHubInstance.Config 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; + } + /** + * + * + *
+     * Available configurations to provision an ApiHub Instance.
+     * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ApiHubInstance.Config} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.ApiHubInstance.Config) + com.google.cloud.apihub.v1.ApiHubInstance.ConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_ApiHubInstance_Config_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_ApiHubInstance_Config_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ApiHubInstance.Config.class, + com.google.cloud.apihub.v1.ApiHubInstance.Config.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.ApiHubInstance.Config.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + cmekKeyName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_ApiHubInstance_Config_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ApiHubInstance.Config getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.ApiHubInstance.Config.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ApiHubInstance.Config build() { + com.google.cloud.apihub.v1.ApiHubInstance.Config result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ApiHubInstance.Config buildPartial() { + com.google.cloud.apihub.v1.ApiHubInstance.Config result = + new com.google.cloud.apihub.v1.ApiHubInstance.Config(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.ApiHubInstance.Config result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.cmekKeyName_ = cmekKeyName_; + } + } + + @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.apihub.v1.ApiHubInstance.Config) { + return mergeFrom((com.google.cloud.apihub.v1.ApiHubInstance.Config) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.ApiHubInstance.Config other) { + if (other == com.google.cloud.apihub.v1.ApiHubInstance.Config.getDefaultInstance()) + return this; + if (!other.getCmekKeyName().isEmpty()) { + cmekKeyName_ = other.cmekKeyName_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + cmekKeyName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object cmekKeyName_ = ""; + /** + * + * + *
+       * Required. The Customer Managed Encryption Key (CMEK) used for data
+       * encryption. The CMEK name should follow the format of
+       * `projects/([^/]+)/locations/([^/]+)/keyRings/([^/]+)/cryptoKeys/([^/]+)`,
+       * where the location must match the instance location.
+       * 
+ * + * string cmek_key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The cmekKeyName. + */ + public java.lang.String getCmekKeyName() { + java.lang.Object ref = cmekKeyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cmekKeyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Required. The Customer Managed Encryption Key (CMEK) used for data
+       * encryption. The CMEK name should follow the format of
+       * `projects/([^/]+)/locations/([^/]+)/keyRings/([^/]+)/cryptoKeys/([^/]+)`,
+       * where the location must match the instance location.
+       * 
+ * + * string cmek_key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for cmekKeyName. + */ + public com.google.protobuf.ByteString getCmekKeyNameBytes() { + java.lang.Object ref = cmekKeyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cmekKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Required. The Customer Managed Encryption Key (CMEK) used for data
+       * encryption. The CMEK name should follow the format of
+       * `projects/([^/]+)/locations/([^/]+)/keyRings/([^/]+)/cryptoKeys/([^/]+)`,
+       * where the location must match the instance location.
+       * 
+ * + * string cmek_key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The cmekKeyName to set. + * @return This builder for chaining. + */ + public Builder setCmekKeyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + cmekKeyName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The Customer Managed Encryption Key (CMEK) used for data
+       * encryption. The CMEK name should follow the format of
+       * `projects/([^/]+)/locations/([^/]+)/keyRings/([^/]+)/cryptoKeys/([^/]+)`,
+       * where the location must match the instance location.
+       * 
+ * + * string cmek_key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearCmekKeyName() { + cmekKeyName_ = getDefaultInstance().getCmekKeyName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The Customer Managed Encryption Key (CMEK) used for data
+       * encryption. The CMEK name should follow the format of
+       * `projects/([^/]+)/locations/([^/]+)/keyRings/([^/]+)/cryptoKeys/([^/]+)`,
+       * where the location must match the instance location.
+       * 
+ * + * string cmek_key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for cmekKeyName to set. + * @return This builder for chaining. + */ + public Builder setCmekKeyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + cmekKeyName_ = value; + bitField0_ |= 0x00000001; + 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.apihub.v1.ApiHubInstance.Config) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.ApiHubInstance.Config) + private static final com.google.cloud.apihub.v1.ApiHubInstance.Config DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.ApiHubInstance.Config(); + } + + public static com.google.cloud.apihub.v1.ApiHubInstance.Config getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Config parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.ApiHubInstance.Config getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. Format:
+   * `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+   * Identifier. Format:
+   * `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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 CREATE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Creation timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. Creation timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.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 timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Last update timestamp.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Output only. Last update timestamp.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.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. Last update timestamp.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int STATE_FIELD_NUMBER = 4; + private int state_ = 0; + /** + * + * + *
+   * Output only. The current state of the ApiHub instance.
+   * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance.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 current state of the ApiHub instance.
+   * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.ApiHubInstance.State getState() { + com.google.cloud.apihub.v1.ApiHubInstance.State result = + com.google.cloud.apihub.v1.ApiHubInstance.State.forNumber(state_); + return result == null ? com.google.cloud.apihub.v1.ApiHubInstance.State.UNRECOGNIZED : result; + } + + public static final int STATE_MESSAGE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object stateMessage_ = ""; + /** + * + * + *
+   * Output only. Extra information about ApiHub instance state. Currently the
+   * message would be populated when state is `FAILED`.
+   * 
+ * + * string state_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The stateMessage. + */ + @java.lang.Override + public java.lang.String getStateMessage() { + java.lang.Object ref = stateMessage_; + 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(); + stateMessage_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Extra information about ApiHub instance state. Currently the
+   * message would be populated when state is `FAILED`.
+   * 
+ * + * string state_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for stateMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStateMessageBytes() { + java.lang.Object ref = stateMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + stateMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONFIG_FIELD_NUMBER = 6; + private com.google.cloud.apihub.v1.ApiHubInstance.Config config_; + /** + * + * + *
+   * Required. Config of the ApiHub instance.
+   * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance.Config config = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the config field is set. + */ + @java.lang.Override + public boolean hasConfig() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Required. Config of the ApiHub instance.
+   * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance.Config config = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The config. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.ApiHubInstance.Config getConfig() { + return config_ == null + ? com.google.cloud.apihub.v1.ApiHubInstance.Config.getDefaultInstance() + : config_; + } + /** + * + * + *
+   * Required. Config of the ApiHub instance.
+   * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance.Config config = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.ApiHubInstance.ConfigOrBuilder getConfigOrBuilder() { + return config_ == null + ? com.google.cloud.apihub.v1.ApiHubInstance.Config.getDefaultInstance() + : config_; + } + + public static final int LABELS_FIELD_NUMBER = 7; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_ApiHubInstance_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + 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. Instance labels to represent user-provided metadata.
+   * Refer to cloud documentation on labels for more details.
+   * https://cloud.google.com/compute/docs/labeling-resources
+   * 
+ * + * map<string, string> labels = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Optional. Instance labels to represent user-provided metadata.
+   * Refer to cloud documentation on labels for more details.
+   * https://cloud.google.com/compute/docs/labeling-resources
+   * 
+ * + * map<string, string> labels = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Optional. Instance labels to represent user-provided metadata.
+   * Refer to cloud documentation on labels for more details.
+   * https://cloud.google.com/compute/docs/labeling-resources
+   * 
+ * + * map<string, string> labels = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. Instance labels to represent user-provided metadata.
+   * Refer to cloud documentation on labels for more details.
+   * https://cloud.google.com/compute/docs/labeling-resources
+   * 
+ * + * map<string, string> labels = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int DESCRIPTION_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * Optional. Description of the ApiHub instance.
+   * 
+ * + * string description = 8 [(.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. Description of the ApiHub instance.
+   * 
+ * + * string description = 8 [(.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; + } + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getUpdateTime()); + } + if (state_ != com.google.cloud.apihub.v1.ApiHubInstance.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(stateMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, stateMessage_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(6, getConfig()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 7); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, description_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateTime()); + } + if (state_ != com.google.cloud.apihub.v1.ApiHubInstance.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(stateMessage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, stateMessage_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getConfig()); + } + 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(7, labels__); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, description_); + } + size += getUnknownFields().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.apihub.v1.ApiHubInstance)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.ApiHubInstance other = + (com.google.cloud.apihub.v1.ApiHubInstance) obj; + + if (!getName().equals(other.getName())) 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 (state_ != other.state_) return false; + if (!getStateMessage().equals(other.getStateMessage())) return false; + if (hasConfig() != other.hasConfig()) return false; + if (hasConfig()) { + if (!getConfig().equals(other.getConfig())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + 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) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + STATE_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getStateMessage().hashCode(); + if (hasConfig()) { + hash = (37 * hash) + CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getConfig().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.ApiHubInstance parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ApiHubInstance 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.apihub.v1.ApiHubInstance parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ApiHubInstance 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.apihub.v1.ApiHubInstance parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ApiHubInstance parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.ApiHubInstance parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ApiHubInstance 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.apihub.v1.ApiHubInstance parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ApiHubInstance 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.apihub.v1.ApiHubInstance parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ApiHubInstance 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.apihub.v1.ApiHubInstance 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; + } + /** + * + * + *
+   * An ApiHubInstance represents the instance resources of the API Hub.
+   * Currently, only one ApiHub instance is allowed for each project.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ApiHubInstance} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.ApiHubInstance) + com.google.cloud.apihub.v1.ApiHubInstanceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_ApiHubInstance_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 7: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 7: + 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.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_ApiHubInstance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ApiHubInstance.class, + com.google.cloud.apihub.v1.ApiHubInstance.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.ApiHubInstance.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCreateTimeFieldBuilder(); + getUpdateTimeFieldBuilder(); + getConfigFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + state_ = 0; + stateMessage_ = ""; + config_ = null; + if (configBuilder_ != null) { + configBuilder_.dispose(); + configBuilder_ = null; + } + internalGetMutableLabels().clear(); + description_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_ApiHubInstance_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ApiHubInstance getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.ApiHubInstance.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ApiHubInstance build() { + com.google.cloud.apihub.v1.ApiHubInstance result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ApiHubInstance buildPartial() { + com.google.cloud.apihub.v1.ApiHubInstance result = + new com.google.cloud.apihub.v1.ApiHubInstance(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.ApiHubInstance result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.stateMessage_ = stateMessage_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.config_ = configBuilder_ == null ? config_ : configBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.description_ = description_; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.ApiHubInstance) { + return mergeFrom((com.google.cloud.apihub.v1.ApiHubInstance) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.ApiHubInstance other) { + if (other == com.google.cloud.apihub.v1.ApiHubInstance.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getStateMessage().isEmpty()) { + stateMessage_ = other.stateMessage_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.hasConfig()) { + mergeConfig(other.getConfig()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000040; + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000080; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + stateMessage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage(getConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. Format:
+     * `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. Format:
+     * `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. Format:
+     * `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Format:
+     * `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Format:
+     * `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + 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 timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. Creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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 timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000002); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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 timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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. Last update timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. Last update timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.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. Last update timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Last update timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Last update timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Last update timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000004); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Last update timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Last update timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.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. Last update timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.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 int state_ = 0; + /** + * + * + *
+     * Output only. The current state of the ApiHub instance.
+     * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance.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 current state of the ApiHub instance.
+     * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance.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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current state of the ApiHub instance.
+     * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.ApiHubInstance.State getState() { + com.google.cloud.apihub.v1.ApiHubInstance.State result = + com.google.cloud.apihub.v1.ApiHubInstance.State.forNumber(state_); + return result == null ? com.google.cloud.apihub.v1.ApiHubInstance.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The current state of the ApiHub instance.
+     * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance.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.apihub.v1.ApiHubInstance.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current state of the ApiHub instance.
+     * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000008); + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object stateMessage_ = ""; + /** + * + * + *
+     * Output only. Extra information about ApiHub instance state. Currently the
+     * message would be populated when state is `FAILED`.
+     * 
+ * + * string state_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The stateMessage. + */ + public java.lang.String getStateMessage() { + java.lang.Object ref = stateMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + stateMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Extra information about ApiHub instance state. Currently the
+     * message would be populated when state is `FAILED`.
+     * 
+ * + * string state_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for stateMessage. + */ + public com.google.protobuf.ByteString getStateMessageBytes() { + java.lang.Object ref = stateMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + stateMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Extra information about ApiHub instance state. Currently the
+     * message would be populated when state is `FAILED`.
+     * 
+ * + * string state_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The stateMessage to set. + * @return This builder for chaining. + */ + public Builder setStateMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + stateMessage_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Extra information about ApiHub instance state. Currently the
+     * message would be populated when state is `FAILED`.
+     * 
+ * + * string state_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStateMessage() { + stateMessage_ = getDefaultInstance().getStateMessage(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Extra information about ApiHub instance state. Currently the
+     * message would be populated when state is `FAILED`.
+     * 
+ * + * string state_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for stateMessage to set. + * @return This builder for chaining. + */ + public Builder setStateMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + stateMessage_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private com.google.cloud.apihub.v1.ApiHubInstance.Config config_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.ApiHubInstance.Config, + com.google.cloud.apihub.v1.ApiHubInstance.Config.Builder, + com.google.cloud.apihub.v1.ApiHubInstance.ConfigOrBuilder> + configBuilder_; + /** + * + * + *
+     * Required. Config of the ApiHub instance.
+     * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance.Config config = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the config field is set. + */ + public boolean hasConfig() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Required. Config of the ApiHub instance.
+     * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance.Config config = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The config. + */ + public com.google.cloud.apihub.v1.ApiHubInstance.Config getConfig() { + if (configBuilder_ == null) { + return config_ == null + ? com.google.cloud.apihub.v1.ApiHubInstance.Config.getDefaultInstance() + : config_; + } else { + return configBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Config of the ApiHub instance.
+     * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance.Config config = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConfig(com.google.cloud.apihub.v1.ApiHubInstance.Config value) { + if (configBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + config_ = value; + } else { + configBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Config of the ApiHub instance.
+     * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance.Config config = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConfig( + com.google.cloud.apihub.v1.ApiHubInstance.Config.Builder builderForValue) { + if (configBuilder_ == null) { + config_ = builderForValue.build(); + } else { + configBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Config of the ApiHub instance.
+     * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance.Config config = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeConfig(com.google.cloud.apihub.v1.ApiHubInstance.Config value) { + if (configBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && config_ != null + && config_ != com.google.cloud.apihub.v1.ApiHubInstance.Config.getDefaultInstance()) { + getConfigBuilder().mergeFrom(value); + } else { + config_ = value; + } + } else { + configBuilder_.mergeFrom(value); + } + if (config_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. Config of the ApiHub instance.
+     * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance.Config config = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearConfig() { + bitField0_ = (bitField0_ & ~0x00000020); + config_ = null; + if (configBuilder_ != null) { + configBuilder_.dispose(); + configBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Config of the ApiHub instance.
+     * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance.Config config = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.ApiHubInstance.Config.Builder getConfigBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Config of the ApiHub instance.
+     * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance.Config config = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.ApiHubInstance.ConfigOrBuilder getConfigOrBuilder() { + if (configBuilder_ != null) { + return configBuilder_.getMessageOrBuilder(); + } else { + return config_ == null + ? com.google.cloud.apihub.v1.ApiHubInstance.Config.getDefaultInstance() + : config_; + } + } + /** + * + * + *
+     * Required. Config of the ApiHub instance.
+     * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance.Config config = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.ApiHubInstance.Config, + com.google.cloud.apihub.v1.ApiHubInstance.Config.Builder, + com.google.cloud.apihub.v1.ApiHubInstance.ConfigOrBuilder> + getConfigFieldBuilder() { + if (configBuilder_ == null) { + configBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.ApiHubInstance.Config, + com.google.cloud.apihub.v1.ApiHubInstance.Config.Builder, + com.google.cloud.apihub.v1.ApiHubInstance.ConfigOrBuilder>( + getConfig(), getParentForChildren(), isClean()); + config_ = null; + } + return configBuilder_; + } + + 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() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000040; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Optional. Instance labels to represent user-provided metadata.
+     * Refer to cloud documentation on labels for more details.
+     * https://cloud.google.com/compute/docs/labeling-resources
+     * 
+ * + * map<string, string> labels = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Optional. Instance labels to represent user-provided metadata.
+     * Refer to cloud documentation on labels for more details.
+     * https://cloud.google.com/compute/docs/labeling-resources
+     * 
+ * + * map<string, string> labels = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Optional. Instance labels to represent user-provided metadata.
+     * Refer to cloud documentation on labels for more details.
+     * https://cloud.google.com/compute/docs/labeling-resources
+     * 
+ * + * map<string, string> labels = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. Instance labels to represent user-provided metadata.
+     * Refer to cloud documentation on labels for more details.
+     * https://cloud.google.com/compute/docs/labeling-resources
+     * 
+ * + * map<string, string> labels = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000040); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. Instance labels to represent user-provided metadata.
+     * Refer to cloud documentation on labels for more details.
+     * https://cloud.google.com/compute/docs/labeling-resources
+     * 
+ * + * map<string, string> labels = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000040; + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Optional. Instance labels to represent user-provided metadata.
+     * Refer to cloud documentation on labels for more details.
+     * https://cloud.google.com/compute/docs/labeling-resources
+     * 
+ * + * map<string, string> labels = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000040; + return this; + } + /** + * + * + *
+     * Optional. Instance labels to represent user-provided metadata.
+     * Refer to cloud documentation on labels for more details.
+     * https://cloud.google.com/compute/docs/labeling-resources
+     * 
+ * + * map<string, string> labels = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000040; + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Optional. Description of the ApiHub instance.
+     * 
+ * + * string description = 8 [(.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. Description of the ApiHub instance.
+     * 
+ * + * string description = 8 [(.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. Description of the ApiHub instance.
+     * 
+ * + * string description = 8 [(.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; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Description of the ApiHub instance.
+     * 
+ * + * string description = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Description of the ApiHub instance.
+     * 
+ * + * string description = 8 [(.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; + bitField0_ |= 0x00000080; + 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.apihub.v1.ApiHubInstance) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.ApiHubInstance) + private static final com.google.cloud.apihub.v1.ApiHubInstance DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.ApiHubInstance(); + } + + public static com.google.cloud.apihub.v1.ApiHubInstance getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ApiHubInstance parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.ApiHubInstance getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubInstanceName.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubInstanceName.java new file mode 100644 index 000000000000..f32ef87ba1ad --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubInstanceName.java @@ -0,0 +1,227 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +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 ApiHubInstanceName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_API_HUB_INSTANCE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String apiHubInstance; + + @Deprecated + protected ApiHubInstanceName() { + project = null; + location = null; + apiHubInstance = null; + } + + private ApiHubInstanceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + apiHubInstance = Preconditions.checkNotNull(builder.getApiHubInstance()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getApiHubInstance() { + return apiHubInstance; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ApiHubInstanceName of(String project, String location, String apiHubInstance) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setApiHubInstance(apiHubInstance) + .build(); + } + + public static String format(String project, String location, String apiHubInstance) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setApiHubInstance(apiHubInstance) + .build() + .toString(); + } + + public static ApiHubInstanceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_API_HUB_INSTANCE.validatedMatch( + formattedString, "ApiHubInstanceName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("api_hub_instance")); + } + + 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 (ApiHubInstanceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_API_HUB_INSTANCE.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); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (apiHubInstance != null) { + fieldMapBuilder.put("api_hub_instance", apiHubInstance); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_API_HUB_INSTANCE.instantiate( + "project", project, "location", location, "api_hub_instance", apiHubInstance); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + ApiHubInstanceName that = ((ApiHubInstanceName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.apiHubInstance, that.apiHubInstance); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(apiHubInstance); + return h; + } + + /** Builder for projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}. */ + public static class Builder { + private String project; + private String location; + private String apiHubInstance; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getApiHubInstance() { + return apiHubInstance; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setApiHubInstance(String apiHubInstance) { + this.apiHubInstance = apiHubInstance; + return this; + } + + private Builder(ApiHubInstanceName apiHubInstanceName) { + this.project = apiHubInstanceName.project; + this.location = apiHubInstanceName.location; + this.apiHubInstance = apiHubInstanceName.apiHubInstance; + } + + public ApiHubInstanceName build() { + return new ApiHubInstanceName(this); + } + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubInstanceOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubInstanceOrBuilder.java new file mode 100644 index 000000000000..a6fef74213e6 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubInstanceOrBuilder.java @@ -0,0 +1,319 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface ApiHubInstanceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.ApiHubInstance) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. Format:
+   * `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. Format:
+   * `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. Creation timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Creation timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Creation timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Last update timestamp.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Last update timestamp.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Last update timestamp.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The current state of the ApiHub instance.
+   * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The current state of the ApiHub instance.
+   * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.apihub.v1.ApiHubInstance.State getState(); + + /** + * + * + *
+   * Output only. Extra information about ApiHub instance state. Currently the
+   * message would be populated when state is `FAILED`.
+   * 
+ * + * string state_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The stateMessage. + */ + java.lang.String getStateMessage(); + /** + * + * + *
+   * Output only. Extra information about ApiHub instance state. Currently the
+   * message would be populated when state is `FAILED`.
+   * 
+ * + * string state_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for stateMessage. + */ + com.google.protobuf.ByteString getStateMessageBytes(); + + /** + * + * + *
+   * Required. Config of the ApiHub instance.
+   * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance.Config config = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the config field is set. + */ + boolean hasConfig(); + /** + * + * + *
+   * Required. Config of the ApiHub instance.
+   * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance.Config config = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The config. + */ + com.google.cloud.apihub.v1.ApiHubInstance.Config getConfig(); + /** + * + * + *
+   * Required. Config of the ApiHub instance.
+   * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance.Config config = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.apihub.v1.ApiHubInstance.ConfigOrBuilder getConfigOrBuilder(); + + /** + * + * + *
+   * Optional. Instance labels to represent user-provided metadata.
+   * Refer to cloud documentation on labels for more details.
+   * https://cloud.google.com/compute/docs/labeling-resources
+   * 
+ * + * map<string, string> labels = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + int getLabelsCount(); + /** + * + * + *
+   * Optional. Instance labels to represent user-provided metadata.
+   * Refer to cloud documentation on labels for more details.
+   * https://cloud.google.com/compute/docs/labeling-resources
+   * 
+ * + * map<string, string> labels = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Optional. Instance labels to represent user-provided metadata.
+   * Refer to cloud documentation on labels for more details.
+   * https://cloud.google.com/compute/docs/labeling-resources
+   * 
+ * + * map<string, string> labels = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Optional. Instance labels to represent user-provided metadata.
+   * Refer to cloud documentation on labels for more details.
+   * https://cloud.google.com/compute/docs/labeling-resources
+   * 
+ * + * map<string, string> labels = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Optional. Instance labels to represent user-provided metadata.
+   * Refer to cloud documentation on labels for more details.
+   * https://cloud.google.com/compute/docs/labeling-resources
+   * 
+ * + * map<string, string> labels = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Optional. Description of the ApiHub instance.
+   * 
+ * + * string description = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Optional. Description of the ApiHub instance.
+   * 
+ * + * string description = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubResource.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubResource.java new file mode 100644 index 000000000000..bb98a63a959e --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubResource.java @@ -0,0 +1,2352 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * ApiHubResource is one of the resources such as Api, Operation, Deployment,
+ * Definition, Spec and Version resources stored in API-Hub.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ApiHubResource} + */ +public final class ApiHubResource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.ApiHubResource) + ApiHubResourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use ApiHubResource.newBuilder() to construct. + private ApiHubResource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ApiHubResource() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ApiHubResource(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ApiHubResource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ApiHubResource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ApiHubResource.class, + com.google.cloud.apihub.v1.ApiHubResource.Builder.class); + } + + private int resourceCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object resource_; + + public enum ResourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + API(1), + OPERATION(2), + DEPLOYMENT(3), + SPEC(4), + DEFINITION(5), + VERSION(6), + RESOURCE_NOT_SET(0); + private final int value; + + private ResourceCase(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 ResourceCase valueOf(int value) { + return forNumber(value); + } + + public static ResourceCase forNumber(int value) { + switch (value) { + case 1: + return API; + case 2: + return OPERATION; + case 3: + return DEPLOYMENT; + case 4: + return SPEC; + case 5: + return DEFINITION; + case 6: + return VERSION; + case 0: + return RESOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ResourceCase getResourceCase() { + return ResourceCase.forNumber(resourceCase_); + } + + public static final int API_FIELD_NUMBER = 1; + /** + * + * + *
+   * This represents Api resource in search results. Only name, display_name,
+   * description and owner fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Api api = 1; + * + * @return Whether the api field is set. + */ + @java.lang.Override + public boolean hasApi() { + return resourceCase_ == 1; + } + /** + * + * + *
+   * This represents Api resource in search results. Only name, display_name,
+   * description and owner fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Api api = 1; + * + * @return The api. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Api getApi() { + if (resourceCase_ == 1) { + return (com.google.cloud.apihub.v1.Api) resource_; + } + return com.google.cloud.apihub.v1.Api.getDefaultInstance(); + } + /** + * + * + *
+   * This represents Api resource in search results. Only name, display_name,
+   * description and owner fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Api api = 1; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.ApiOrBuilder getApiOrBuilder() { + if (resourceCase_ == 1) { + return (com.google.cloud.apihub.v1.Api) resource_; + } + return com.google.cloud.apihub.v1.Api.getDefaultInstance(); + } + + public static final int OPERATION_FIELD_NUMBER = 2; + /** + * + * + *
+   * This represents ApiOperation resource in search results. Only name,
+   * and description fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.ApiOperation operation = 2; + * + * @return Whether the operation field is set. + */ + @java.lang.Override + public boolean hasOperation() { + return resourceCase_ == 2; + } + /** + * + * + *
+   * This represents ApiOperation resource in search results. Only name,
+   * and description fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.ApiOperation operation = 2; + * + * @return The operation. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.ApiOperation getOperation() { + if (resourceCase_ == 2) { + return (com.google.cloud.apihub.v1.ApiOperation) resource_; + } + return com.google.cloud.apihub.v1.ApiOperation.getDefaultInstance(); + } + /** + * + * + *
+   * This represents ApiOperation resource in search results. Only name,
+   * and description fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.ApiOperation operation = 2; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.ApiOperationOrBuilder getOperationOrBuilder() { + if (resourceCase_ == 2) { + return (com.google.cloud.apihub.v1.ApiOperation) resource_; + } + return com.google.cloud.apihub.v1.ApiOperation.getDefaultInstance(); + } + + public static final int DEPLOYMENT_FIELD_NUMBER = 3; + /** + * + * + *
+   * This represents Deployment resource in search results. Only name,
+   * display_name and description fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Deployment deployment = 3; + * + * @return Whether the deployment field is set. + */ + @java.lang.Override + public boolean hasDeployment() { + return resourceCase_ == 3; + } + /** + * + * + *
+   * This represents Deployment resource in search results. Only name,
+   * display_name and description fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Deployment deployment = 3; + * + * @return The deployment. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Deployment getDeployment() { + if (resourceCase_ == 3) { + return (com.google.cloud.apihub.v1.Deployment) resource_; + } + return com.google.cloud.apihub.v1.Deployment.getDefaultInstance(); + } + /** + * + * + *
+   * This represents Deployment resource in search results. Only name,
+   * display_name and description fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Deployment deployment = 3; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.DeploymentOrBuilder getDeploymentOrBuilder() { + if (resourceCase_ == 3) { + return (com.google.cloud.apihub.v1.Deployment) resource_; + } + return com.google.cloud.apihub.v1.Deployment.getDefaultInstance(); + } + + public static final int SPEC_FIELD_NUMBER = 4; + /** + * + * + *
+   * This represents Spec resource in search results. Only name,
+   * display_name and description fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Spec spec = 4; + * + * @return Whether the spec field is set. + */ + @java.lang.Override + public boolean hasSpec() { + return resourceCase_ == 4; + } + /** + * + * + *
+   * This represents Spec resource in search results. Only name,
+   * display_name and description fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Spec spec = 4; + * + * @return The spec. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Spec getSpec() { + if (resourceCase_ == 4) { + return (com.google.cloud.apihub.v1.Spec) resource_; + } + return com.google.cloud.apihub.v1.Spec.getDefaultInstance(); + } + /** + * + * + *
+   * This represents Spec resource in search results. Only name,
+   * display_name and description fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Spec spec = 4; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.SpecOrBuilder getSpecOrBuilder() { + if (resourceCase_ == 4) { + return (com.google.cloud.apihub.v1.Spec) resource_; + } + return com.google.cloud.apihub.v1.Spec.getDefaultInstance(); + } + + public static final int DEFINITION_FIELD_NUMBER = 5; + /** + * + * + *
+   * This represents Definition resource in search results.
+   * Only name field is populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Definition definition = 5; + * + * @return Whether the definition field is set. + */ + @java.lang.Override + public boolean hasDefinition() { + return resourceCase_ == 5; + } + /** + * + * + *
+   * This represents Definition resource in search results.
+   * Only name field is populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Definition definition = 5; + * + * @return The definition. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Definition getDefinition() { + if (resourceCase_ == 5) { + return (com.google.cloud.apihub.v1.Definition) resource_; + } + return com.google.cloud.apihub.v1.Definition.getDefaultInstance(); + } + /** + * + * + *
+   * This represents Definition resource in search results.
+   * Only name field is populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Definition definition = 5; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.DefinitionOrBuilder getDefinitionOrBuilder() { + if (resourceCase_ == 5) { + return (com.google.cloud.apihub.v1.Definition) resource_; + } + return com.google.cloud.apihub.v1.Definition.getDefaultInstance(); + } + + public static final int VERSION_FIELD_NUMBER = 6; + /** + * + * + *
+   * This represents Version resource in search results. Only name,
+   * display_name and description fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Version version = 6; + * + * @return Whether the version field is set. + */ + @java.lang.Override + public boolean hasVersion() { + return resourceCase_ == 6; + } + /** + * + * + *
+   * This represents Version resource in search results. Only name,
+   * display_name and description fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Version version = 6; + * + * @return The version. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Version getVersion() { + if (resourceCase_ == 6) { + return (com.google.cloud.apihub.v1.Version) resource_; + } + return com.google.cloud.apihub.v1.Version.getDefaultInstance(); + } + /** + * + * + *
+   * This represents Version resource in search results. Only name,
+   * display_name and description fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Version version = 6; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.VersionOrBuilder getVersionOrBuilder() { + if (resourceCase_ == 6) { + return (com.google.cloud.apihub.v1.Version) resource_; + } + return com.google.cloud.apihub.v1.Version.getDefaultInstance(); + } + + 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 (resourceCase_ == 1) { + output.writeMessage(1, (com.google.cloud.apihub.v1.Api) resource_); + } + if (resourceCase_ == 2) { + output.writeMessage(2, (com.google.cloud.apihub.v1.ApiOperation) resource_); + } + if (resourceCase_ == 3) { + output.writeMessage(3, (com.google.cloud.apihub.v1.Deployment) resource_); + } + if (resourceCase_ == 4) { + output.writeMessage(4, (com.google.cloud.apihub.v1.Spec) resource_); + } + if (resourceCase_ == 5) { + output.writeMessage(5, (com.google.cloud.apihub.v1.Definition) resource_); + } + if (resourceCase_ == 6) { + output.writeMessage(6, (com.google.cloud.apihub.v1.Version) resource_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (resourceCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.apihub.v1.Api) resource_); + } + if (resourceCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.apihub.v1.ApiOperation) resource_); + } + if (resourceCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.apihub.v1.Deployment) resource_); + } + if (resourceCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.apihub.v1.Spec) resource_); + } + if (resourceCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.cloud.apihub.v1.Definition) resource_); + } + if (resourceCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.cloud.apihub.v1.Version) resource_); + } + size += getUnknownFields().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.apihub.v1.ApiHubResource)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.ApiHubResource other = + (com.google.cloud.apihub.v1.ApiHubResource) obj; + + if (!getResourceCase().equals(other.getResourceCase())) return false; + switch (resourceCase_) { + case 1: + if (!getApi().equals(other.getApi())) return false; + break; + case 2: + if (!getOperation().equals(other.getOperation())) return false; + break; + case 3: + if (!getDeployment().equals(other.getDeployment())) return false; + break; + case 4: + if (!getSpec().equals(other.getSpec())) return false; + break; + case 5: + if (!getDefinition().equals(other.getDefinition())) return false; + break; + case 6: + if (!getVersion().equals(other.getVersion())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (resourceCase_) { + case 1: + hash = (37 * hash) + API_FIELD_NUMBER; + hash = (53 * hash) + getApi().hashCode(); + break; + case 2: + hash = (37 * hash) + OPERATION_FIELD_NUMBER; + hash = (53 * hash) + getOperation().hashCode(); + break; + case 3: + hash = (37 * hash) + DEPLOYMENT_FIELD_NUMBER; + hash = (53 * hash) + getDeployment().hashCode(); + break; + case 4: + hash = (37 * hash) + SPEC_FIELD_NUMBER; + hash = (53 * hash) + getSpec().hashCode(); + break; + case 5: + hash = (37 * hash) + DEFINITION_FIELD_NUMBER; + hash = (53 * hash) + getDefinition().hashCode(); + break; + case 6: + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.ApiHubResource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ApiHubResource 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.apihub.v1.ApiHubResource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ApiHubResource 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.apihub.v1.ApiHubResource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ApiHubResource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.ApiHubResource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ApiHubResource 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.apihub.v1.ApiHubResource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ApiHubResource 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.apihub.v1.ApiHubResource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ApiHubResource 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.apihub.v1.ApiHubResource 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; + } + /** + * + * + *
+   * ApiHubResource is one of the resources such as Api, Operation, Deployment,
+   * Definition, Spec and Version resources stored in API-Hub.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ApiHubResource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.ApiHubResource) + com.google.cloud.apihub.v1.ApiHubResourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ApiHubResource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ApiHubResource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ApiHubResource.class, + com.google.cloud.apihub.v1.ApiHubResource.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.ApiHubResource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (apiBuilder_ != null) { + apiBuilder_.clear(); + } + if (operationBuilder_ != null) { + operationBuilder_.clear(); + } + if (deploymentBuilder_ != null) { + deploymentBuilder_.clear(); + } + if (specBuilder_ != null) { + specBuilder_.clear(); + } + if (definitionBuilder_ != null) { + definitionBuilder_.clear(); + } + if (versionBuilder_ != null) { + versionBuilder_.clear(); + } + resourceCase_ = 0; + resource_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ApiHubResource_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ApiHubResource getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.ApiHubResource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ApiHubResource build() { + com.google.cloud.apihub.v1.ApiHubResource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ApiHubResource buildPartial() { + com.google.cloud.apihub.v1.ApiHubResource result = + new com.google.cloud.apihub.v1.ApiHubResource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.ApiHubResource result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.apihub.v1.ApiHubResource result) { + result.resourceCase_ = resourceCase_; + result.resource_ = this.resource_; + if (resourceCase_ == 1 && apiBuilder_ != null) { + result.resource_ = apiBuilder_.build(); + } + if (resourceCase_ == 2 && operationBuilder_ != null) { + result.resource_ = operationBuilder_.build(); + } + if (resourceCase_ == 3 && deploymentBuilder_ != null) { + result.resource_ = deploymentBuilder_.build(); + } + if (resourceCase_ == 4 && specBuilder_ != null) { + result.resource_ = specBuilder_.build(); + } + if (resourceCase_ == 5 && definitionBuilder_ != null) { + result.resource_ = definitionBuilder_.build(); + } + if (resourceCase_ == 6 && versionBuilder_ != null) { + result.resource_ = versionBuilder_.build(); + } + } + + @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.apihub.v1.ApiHubResource) { + return mergeFrom((com.google.cloud.apihub.v1.ApiHubResource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.ApiHubResource other) { + if (other == com.google.cloud.apihub.v1.ApiHubResource.getDefaultInstance()) return this; + switch (other.getResourceCase()) { + case API: + { + mergeApi(other.getApi()); + break; + } + case OPERATION: + { + mergeOperation(other.getOperation()); + break; + } + case DEPLOYMENT: + { + mergeDeployment(other.getDeployment()); + break; + } + case SPEC: + { + mergeSpec(other.getSpec()); + break; + } + case DEFINITION: + { + mergeDefinition(other.getDefinition()); + break; + } + case VERSION: + { + mergeVersion(other.getVersion()); + break; + } + case RESOURCE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getApiFieldBuilder().getBuilder(), extensionRegistry); + resourceCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage(getOperationFieldBuilder().getBuilder(), extensionRegistry); + resourceCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(getDeploymentFieldBuilder().getBuilder(), extensionRegistry); + resourceCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage(getSpecFieldBuilder().getBuilder(), extensionRegistry); + resourceCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage(getDefinitionFieldBuilder().getBuilder(), extensionRegistry); + resourceCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage(getVersionFieldBuilder().getBuilder(), extensionRegistry); + resourceCase_ = 6; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int resourceCase_ = 0; + private java.lang.Object resource_; + + public ResourceCase getResourceCase() { + return ResourceCase.forNumber(resourceCase_); + } + + public Builder clearResource() { + resourceCase_ = 0; + resource_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Api, + com.google.cloud.apihub.v1.Api.Builder, + com.google.cloud.apihub.v1.ApiOrBuilder> + apiBuilder_; + /** + * + * + *
+     * This represents Api resource in search results. Only name, display_name,
+     * description and owner fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Api api = 1; + * + * @return Whether the api field is set. + */ + @java.lang.Override + public boolean hasApi() { + return resourceCase_ == 1; + } + /** + * + * + *
+     * This represents Api resource in search results. Only name, display_name,
+     * description and owner fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Api api = 1; + * + * @return The api. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Api getApi() { + if (apiBuilder_ == null) { + if (resourceCase_ == 1) { + return (com.google.cloud.apihub.v1.Api) resource_; + } + return com.google.cloud.apihub.v1.Api.getDefaultInstance(); + } else { + if (resourceCase_ == 1) { + return apiBuilder_.getMessage(); + } + return com.google.cloud.apihub.v1.Api.getDefaultInstance(); + } + } + /** + * + * + *
+     * This represents Api resource in search results. Only name, display_name,
+     * description and owner fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Api api = 1; + */ + public Builder setApi(com.google.cloud.apihub.v1.Api value) { + if (apiBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resource_ = value; + onChanged(); + } else { + apiBuilder_.setMessage(value); + } + resourceCase_ = 1; + return this; + } + /** + * + * + *
+     * This represents Api resource in search results. Only name, display_name,
+     * description and owner fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Api api = 1; + */ + public Builder setApi(com.google.cloud.apihub.v1.Api.Builder builderForValue) { + if (apiBuilder_ == null) { + resource_ = builderForValue.build(); + onChanged(); + } else { + apiBuilder_.setMessage(builderForValue.build()); + } + resourceCase_ = 1; + return this; + } + /** + * + * + *
+     * This represents Api resource in search results. Only name, display_name,
+     * description and owner fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Api api = 1; + */ + public Builder mergeApi(com.google.cloud.apihub.v1.Api value) { + if (apiBuilder_ == null) { + if (resourceCase_ == 1 + && resource_ != com.google.cloud.apihub.v1.Api.getDefaultInstance()) { + resource_ = + com.google.cloud.apihub.v1.Api.newBuilder((com.google.cloud.apihub.v1.Api) resource_) + .mergeFrom(value) + .buildPartial(); + } else { + resource_ = value; + } + onChanged(); + } else { + if (resourceCase_ == 1) { + apiBuilder_.mergeFrom(value); + } else { + apiBuilder_.setMessage(value); + } + } + resourceCase_ = 1; + return this; + } + /** + * + * + *
+     * This represents Api resource in search results. Only name, display_name,
+     * description and owner fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Api api = 1; + */ + public Builder clearApi() { + if (apiBuilder_ == null) { + if (resourceCase_ == 1) { + resourceCase_ = 0; + resource_ = null; + onChanged(); + } + } else { + if (resourceCase_ == 1) { + resourceCase_ = 0; + resource_ = null; + } + apiBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * This represents Api resource in search results. Only name, display_name,
+     * description and owner fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Api api = 1; + */ + public com.google.cloud.apihub.v1.Api.Builder getApiBuilder() { + return getApiFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * This represents Api resource in search results. Only name, display_name,
+     * description and owner fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Api api = 1; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.ApiOrBuilder getApiOrBuilder() { + if ((resourceCase_ == 1) && (apiBuilder_ != null)) { + return apiBuilder_.getMessageOrBuilder(); + } else { + if (resourceCase_ == 1) { + return (com.google.cloud.apihub.v1.Api) resource_; + } + return com.google.cloud.apihub.v1.Api.getDefaultInstance(); + } + } + /** + * + * + *
+     * This represents Api resource in search results. Only name, display_name,
+     * description and owner fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Api api = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Api, + com.google.cloud.apihub.v1.Api.Builder, + com.google.cloud.apihub.v1.ApiOrBuilder> + getApiFieldBuilder() { + if (apiBuilder_ == null) { + if (!(resourceCase_ == 1)) { + resource_ = com.google.cloud.apihub.v1.Api.getDefaultInstance(); + } + apiBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Api, + com.google.cloud.apihub.v1.Api.Builder, + com.google.cloud.apihub.v1.ApiOrBuilder>( + (com.google.cloud.apihub.v1.Api) resource_, getParentForChildren(), isClean()); + resource_ = null; + } + resourceCase_ = 1; + onChanged(); + return apiBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.ApiOperation, + com.google.cloud.apihub.v1.ApiOperation.Builder, + com.google.cloud.apihub.v1.ApiOperationOrBuilder> + operationBuilder_; + /** + * + * + *
+     * This represents ApiOperation resource in search results. Only name,
+     * and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.ApiOperation operation = 2; + * + * @return Whether the operation field is set. + */ + @java.lang.Override + public boolean hasOperation() { + return resourceCase_ == 2; + } + /** + * + * + *
+     * This represents ApiOperation resource in search results. Only name,
+     * and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.ApiOperation operation = 2; + * + * @return The operation. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.ApiOperation getOperation() { + if (operationBuilder_ == null) { + if (resourceCase_ == 2) { + return (com.google.cloud.apihub.v1.ApiOperation) resource_; + } + return com.google.cloud.apihub.v1.ApiOperation.getDefaultInstance(); + } else { + if (resourceCase_ == 2) { + return operationBuilder_.getMessage(); + } + return com.google.cloud.apihub.v1.ApiOperation.getDefaultInstance(); + } + } + /** + * + * + *
+     * This represents ApiOperation resource in search results. Only name,
+     * and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.ApiOperation operation = 2; + */ + public Builder setOperation(com.google.cloud.apihub.v1.ApiOperation value) { + if (operationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resource_ = value; + onChanged(); + } else { + operationBuilder_.setMessage(value); + } + resourceCase_ = 2; + return this; + } + /** + * + * + *
+     * This represents ApiOperation resource in search results. Only name,
+     * and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.ApiOperation operation = 2; + */ + public Builder setOperation(com.google.cloud.apihub.v1.ApiOperation.Builder builderForValue) { + if (operationBuilder_ == null) { + resource_ = builderForValue.build(); + onChanged(); + } else { + operationBuilder_.setMessage(builderForValue.build()); + } + resourceCase_ = 2; + return this; + } + /** + * + * + *
+     * This represents ApiOperation resource in search results. Only name,
+     * and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.ApiOperation operation = 2; + */ + public Builder mergeOperation(com.google.cloud.apihub.v1.ApiOperation value) { + if (operationBuilder_ == null) { + if (resourceCase_ == 2 + && resource_ != com.google.cloud.apihub.v1.ApiOperation.getDefaultInstance()) { + resource_ = + com.google.cloud.apihub.v1.ApiOperation.newBuilder( + (com.google.cloud.apihub.v1.ApiOperation) resource_) + .mergeFrom(value) + .buildPartial(); + } else { + resource_ = value; + } + onChanged(); + } else { + if (resourceCase_ == 2) { + operationBuilder_.mergeFrom(value); + } else { + operationBuilder_.setMessage(value); + } + } + resourceCase_ = 2; + return this; + } + /** + * + * + *
+     * This represents ApiOperation resource in search results. Only name,
+     * and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.ApiOperation operation = 2; + */ + public Builder clearOperation() { + if (operationBuilder_ == null) { + if (resourceCase_ == 2) { + resourceCase_ = 0; + resource_ = null; + onChanged(); + } + } else { + if (resourceCase_ == 2) { + resourceCase_ = 0; + resource_ = null; + } + operationBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * This represents ApiOperation resource in search results. Only name,
+     * and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.ApiOperation operation = 2; + */ + public com.google.cloud.apihub.v1.ApiOperation.Builder getOperationBuilder() { + return getOperationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * This represents ApiOperation resource in search results. Only name,
+     * and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.ApiOperation operation = 2; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.ApiOperationOrBuilder getOperationOrBuilder() { + if ((resourceCase_ == 2) && (operationBuilder_ != null)) { + return operationBuilder_.getMessageOrBuilder(); + } else { + if (resourceCase_ == 2) { + return (com.google.cloud.apihub.v1.ApiOperation) resource_; + } + return com.google.cloud.apihub.v1.ApiOperation.getDefaultInstance(); + } + } + /** + * + * + *
+     * This represents ApiOperation resource in search results. Only name,
+     * and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.ApiOperation operation = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.ApiOperation, + com.google.cloud.apihub.v1.ApiOperation.Builder, + com.google.cloud.apihub.v1.ApiOperationOrBuilder> + getOperationFieldBuilder() { + if (operationBuilder_ == null) { + if (!(resourceCase_ == 2)) { + resource_ = com.google.cloud.apihub.v1.ApiOperation.getDefaultInstance(); + } + operationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.ApiOperation, + com.google.cloud.apihub.v1.ApiOperation.Builder, + com.google.cloud.apihub.v1.ApiOperationOrBuilder>( + (com.google.cloud.apihub.v1.ApiOperation) resource_, + getParentForChildren(), + isClean()); + resource_ = null; + } + resourceCase_ = 2; + onChanged(); + return operationBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Deployment, + com.google.cloud.apihub.v1.Deployment.Builder, + com.google.cloud.apihub.v1.DeploymentOrBuilder> + deploymentBuilder_; + /** + * + * + *
+     * This represents Deployment resource in search results. Only name,
+     * display_name and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Deployment deployment = 3; + * + * @return Whether the deployment field is set. + */ + @java.lang.Override + public boolean hasDeployment() { + return resourceCase_ == 3; + } + /** + * + * + *
+     * This represents Deployment resource in search results. Only name,
+     * display_name and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Deployment deployment = 3; + * + * @return The deployment. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Deployment getDeployment() { + if (deploymentBuilder_ == null) { + if (resourceCase_ == 3) { + return (com.google.cloud.apihub.v1.Deployment) resource_; + } + return com.google.cloud.apihub.v1.Deployment.getDefaultInstance(); + } else { + if (resourceCase_ == 3) { + return deploymentBuilder_.getMessage(); + } + return com.google.cloud.apihub.v1.Deployment.getDefaultInstance(); + } + } + /** + * + * + *
+     * This represents Deployment resource in search results. Only name,
+     * display_name and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Deployment deployment = 3; + */ + public Builder setDeployment(com.google.cloud.apihub.v1.Deployment value) { + if (deploymentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resource_ = value; + onChanged(); + } else { + deploymentBuilder_.setMessage(value); + } + resourceCase_ = 3; + return this; + } + /** + * + * + *
+     * This represents Deployment resource in search results. Only name,
+     * display_name and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Deployment deployment = 3; + */ + public Builder setDeployment(com.google.cloud.apihub.v1.Deployment.Builder builderForValue) { + if (deploymentBuilder_ == null) { + resource_ = builderForValue.build(); + onChanged(); + } else { + deploymentBuilder_.setMessage(builderForValue.build()); + } + resourceCase_ = 3; + return this; + } + /** + * + * + *
+     * This represents Deployment resource in search results. Only name,
+     * display_name and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Deployment deployment = 3; + */ + public Builder mergeDeployment(com.google.cloud.apihub.v1.Deployment value) { + if (deploymentBuilder_ == null) { + if (resourceCase_ == 3 + && resource_ != com.google.cloud.apihub.v1.Deployment.getDefaultInstance()) { + resource_ = + com.google.cloud.apihub.v1.Deployment.newBuilder( + (com.google.cloud.apihub.v1.Deployment) resource_) + .mergeFrom(value) + .buildPartial(); + } else { + resource_ = value; + } + onChanged(); + } else { + if (resourceCase_ == 3) { + deploymentBuilder_.mergeFrom(value); + } else { + deploymentBuilder_.setMessage(value); + } + } + resourceCase_ = 3; + return this; + } + /** + * + * + *
+     * This represents Deployment resource in search results. Only name,
+     * display_name and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Deployment deployment = 3; + */ + public Builder clearDeployment() { + if (deploymentBuilder_ == null) { + if (resourceCase_ == 3) { + resourceCase_ = 0; + resource_ = null; + onChanged(); + } + } else { + if (resourceCase_ == 3) { + resourceCase_ = 0; + resource_ = null; + } + deploymentBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * This represents Deployment resource in search results. Only name,
+     * display_name and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Deployment deployment = 3; + */ + public com.google.cloud.apihub.v1.Deployment.Builder getDeploymentBuilder() { + return getDeploymentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * This represents Deployment resource in search results. Only name,
+     * display_name and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Deployment deployment = 3; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.DeploymentOrBuilder getDeploymentOrBuilder() { + if ((resourceCase_ == 3) && (deploymentBuilder_ != null)) { + return deploymentBuilder_.getMessageOrBuilder(); + } else { + if (resourceCase_ == 3) { + return (com.google.cloud.apihub.v1.Deployment) resource_; + } + return com.google.cloud.apihub.v1.Deployment.getDefaultInstance(); + } + } + /** + * + * + *
+     * This represents Deployment resource in search results. Only name,
+     * display_name and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Deployment deployment = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Deployment, + com.google.cloud.apihub.v1.Deployment.Builder, + com.google.cloud.apihub.v1.DeploymentOrBuilder> + getDeploymentFieldBuilder() { + if (deploymentBuilder_ == null) { + if (!(resourceCase_ == 3)) { + resource_ = com.google.cloud.apihub.v1.Deployment.getDefaultInstance(); + } + deploymentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Deployment, + com.google.cloud.apihub.v1.Deployment.Builder, + com.google.cloud.apihub.v1.DeploymentOrBuilder>( + (com.google.cloud.apihub.v1.Deployment) resource_, + getParentForChildren(), + isClean()); + resource_ = null; + } + resourceCase_ = 3; + onChanged(); + return deploymentBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Spec, + com.google.cloud.apihub.v1.Spec.Builder, + com.google.cloud.apihub.v1.SpecOrBuilder> + specBuilder_; + /** + * + * + *
+     * This represents Spec resource in search results. Only name,
+     * display_name and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Spec spec = 4; + * + * @return Whether the spec field is set. + */ + @java.lang.Override + public boolean hasSpec() { + return resourceCase_ == 4; + } + /** + * + * + *
+     * This represents Spec resource in search results. Only name,
+     * display_name and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Spec spec = 4; + * + * @return The spec. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Spec getSpec() { + if (specBuilder_ == null) { + if (resourceCase_ == 4) { + return (com.google.cloud.apihub.v1.Spec) resource_; + } + return com.google.cloud.apihub.v1.Spec.getDefaultInstance(); + } else { + if (resourceCase_ == 4) { + return specBuilder_.getMessage(); + } + return com.google.cloud.apihub.v1.Spec.getDefaultInstance(); + } + } + /** + * + * + *
+     * This represents Spec resource in search results. Only name,
+     * display_name and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Spec spec = 4; + */ + public Builder setSpec(com.google.cloud.apihub.v1.Spec value) { + if (specBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resource_ = value; + onChanged(); + } else { + specBuilder_.setMessage(value); + } + resourceCase_ = 4; + return this; + } + /** + * + * + *
+     * This represents Spec resource in search results. Only name,
+     * display_name and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Spec spec = 4; + */ + public Builder setSpec(com.google.cloud.apihub.v1.Spec.Builder builderForValue) { + if (specBuilder_ == null) { + resource_ = builderForValue.build(); + onChanged(); + } else { + specBuilder_.setMessage(builderForValue.build()); + } + resourceCase_ = 4; + return this; + } + /** + * + * + *
+     * This represents Spec resource in search results. Only name,
+     * display_name and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Spec spec = 4; + */ + public Builder mergeSpec(com.google.cloud.apihub.v1.Spec value) { + if (specBuilder_ == null) { + if (resourceCase_ == 4 + && resource_ != com.google.cloud.apihub.v1.Spec.getDefaultInstance()) { + resource_ = + com.google.cloud.apihub.v1.Spec.newBuilder( + (com.google.cloud.apihub.v1.Spec) resource_) + .mergeFrom(value) + .buildPartial(); + } else { + resource_ = value; + } + onChanged(); + } else { + if (resourceCase_ == 4) { + specBuilder_.mergeFrom(value); + } else { + specBuilder_.setMessage(value); + } + } + resourceCase_ = 4; + return this; + } + /** + * + * + *
+     * This represents Spec resource in search results. Only name,
+     * display_name and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Spec spec = 4; + */ + public Builder clearSpec() { + if (specBuilder_ == null) { + if (resourceCase_ == 4) { + resourceCase_ = 0; + resource_ = null; + onChanged(); + } + } else { + if (resourceCase_ == 4) { + resourceCase_ = 0; + resource_ = null; + } + specBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * This represents Spec resource in search results. Only name,
+     * display_name and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Spec spec = 4; + */ + public com.google.cloud.apihub.v1.Spec.Builder getSpecBuilder() { + return getSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * This represents Spec resource in search results. Only name,
+     * display_name and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Spec spec = 4; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.SpecOrBuilder getSpecOrBuilder() { + if ((resourceCase_ == 4) && (specBuilder_ != null)) { + return specBuilder_.getMessageOrBuilder(); + } else { + if (resourceCase_ == 4) { + return (com.google.cloud.apihub.v1.Spec) resource_; + } + return com.google.cloud.apihub.v1.Spec.getDefaultInstance(); + } + } + /** + * + * + *
+     * This represents Spec resource in search results. Only name,
+     * display_name and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Spec spec = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Spec, + com.google.cloud.apihub.v1.Spec.Builder, + com.google.cloud.apihub.v1.SpecOrBuilder> + getSpecFieldBuilder() { + if (specBuilder_ == null) { + if (!(resourceCase_ == 4)) { + resource_ = com.google.cloud.apihub.v1.Spec.getDefaultInstance(); + } + specBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Spec, + com.google.cloud.apihub.v1.Spec.Builder, + com.google.cloud.apihub.v1.SpecOrBuilder>( + (com.google.cloud.apihub.v1.Spec) resource_, getParentForChildren(), isClean()); + resource_ = null; + } + resourceCase_ = 4; + onChanged(); + return specBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Definition, + com.google.cloud.apihub.v1.Definition.Builder, + com.google.cloud.apihub.v1.DefinitionOrBuilder> + definitionBuilder_; + /** + * + * + *
+     * This represents Definition resource in search results.
+     * Only name field is populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Definition definition = 5; + * + * @return Whether the definition field is set. + */ + @java.lang.Override + public boolean hasDefinition() { + return resourceCase_ == 5; + } + /** + * + * + *
+     * This represents Definition resource in search results.
+     * Only name field is populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Definition definition = 5; + * + * @return The definition. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Definition getDefinition() { + if (definitionBuilder_ == null) { + if (resourceCase_ == 5) { + return (com.google.cloud.apihub.v1.Definition) resource_; + } + return com.google.cloud.apihub.v1.Definition.getDefaultInstance(); + } else { + if (resourceCase_ == 5) { + return definitionBuilder_.getMessage(); + } + return com.google.cloud.apihub.v1.Definition.getDefaultInstance(); + } + } + /** + * + * + *
+     * This represents Definition resource in search results.
+     * Only name field is populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Definition definition = 5; + */ + public Builder setDefinition(com.google.cloud.apihub.v1.Definition value) { + if (definitionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resource_ = value; + onChanged(); + } else { + definitionBuilder_.setMessage(value); + } + resourceCase_ = 5; + return this; + } + /** + * + * + *
+     * This represents Definition resource in search results.
+     * Only name field is populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Definition definition = 5; + */ + public Builder setDefinition(com.google.cloud.apihub.v1.Definition.Builder builderForValue) { + if (definitionBuilder_ == null) { + resource_ = builderForValue.build(); + onChanged(); + } else { + definitionBuilder_.setMessage(builderForValue.build()); + } + resourceCase_ = 5; + return this; + } + /** + * + * + *
+     * This represents Definition resource in search results.
+     * Only name field is populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Definition definition = 5; + */ + public Builder mergeDefinition(com.google.cloud.apihub.v1.Definition value) { + if (definitionBuilder_ == null) { + if (resourceCase_ == 5 + && resource_ != com.google.cloud.apihub.v1.Definition.getDefaultInstance()) { + resource_ = + com.google.cloud.apihub.v1.Definition.newBuilder( + (com.google.cloud.apihub.v1.Definition) resource_) + .mergeFrom(value) + .buildPartial(); + } else { + resource_ = value; + } + onChanged(); + } else { + if (resourceCase_ == 5) { + definitionBuilder_.mergeFrom(value); + } else { + definitionBuilder_.setMessage(value); + } + } + resourceCase_ = 5; + return this; + } + /** + * + * + *
+     * This represents Definition resource in search results.
+     * Only name field is populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Definition definition = 5; + */ + public Builder clearDefinition() { + if (definitionBuilder_ == null) { + if (resourceCase_ == 5) { + resourceCase_ = 0; + resource_ = null; + onChanged(); + } + } else { + if (resourceCase_ == 5) { + resourceCase_ = 0; + resource_ = null; + } + definitionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * This represents Definition resource in search results.
+     * Only name field is populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Definition definition = 5; + */ + public com.google.cloud.apihub.v1.Definition.Builder getDefinitionBuilder() { + return getDefinitionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * This represents Definition resource in search results.
+     * Only name field is populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Definition definition = 5; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.DefinitionOrBuilder getDefinitionOrBuilder() { + if ((resourceCase_ == 5) && (definitionBuilder_ != null)) { + return definitionBuilder_.getMessageOrBuilder(); + } else { + if (resourceCase_ == 5) { + return (com.google.cloud.apihub.v1.Definition) resource_; + } + return com.google.cloud.apihub.v1.Definition.getDefaultInstance(); + } + } + /** + * + * + *
+     * This represents Definition resource in search results.
+     * Only name field is populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Definition definition = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Definition, + com.google.cloud.apihub.v1.Definition.Builder, + com.google.cloud.apihub.v1.DefinitionOrBuilder> + getDefinitionFieldBuilder() { + if (definitionBuilder_ == null) { + if (!(resourceCase_ == 5)) { + resource_ = com.google.cloud.apihub.v1.Definition.getDefaultInstance(); + } + definitionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Definition, + com.google.cloud.apihub.v1.Definition.Builder, + com.google.cloud.apihub.v1.DefinitionOrBuilder>( + (com.google.cloud.apihub.v1.Definition) resource_, + getParentForChildren(), + isClean()); + resource_ = null; + } + resourceCase_ = 5; + onChanged(); + return definitionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Version, + com.google.cloud.apihub.v1.Version.Builder, + com.google.cloud.apihub.v1.VersionOrBuilder> + versionBuilder_; + /** + * + * + *
+     * This represents Version resource in search results. Only name,
+     * display_name and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Version version = 6; + * + * @return Whether the version field is set. + */ + @java.lang.Override + public boolean hasVersion() { + return resourceCase_ == 6; + } + /** + * + * + *
+     * This represents Version resource in search results. Only name,
+     * display_name and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Version version = 6; + * + * @return The version. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Version getVersion() { + if (versionBuilder_ == null) { + if (resourceCase_ == 6) { + return (com.google.cloud.apihub.v1.Version) resource_; + } + return com.google.cloud.apihub.v1.Version.getDefaultInstance(); + } else { + if (resourceCase_ == 6) { + return versionBuilder_.getMessage(); + } + return com.google.cloud.apihub.v1.Version.getDefaultInstance(); + } + } + /** + * + * + *
+     * This represents Version resource in search results. Only name,
+     * display_name and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Version version = 6; + */ + public Builder setVersion(com.google.cloud.apihub.v1.Version value) { + if (versionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resource_ = value; + onChanged(); + } else { + versionBuilder_.setMessage(value); + } + resourceCase_ = 6; + return this; + } + /** + * + * + *
+     * This represents Version resource in search results. Only name,
+     * display_name and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Version version = 6; + */ + public Builder setVersion(com.google.cloud.apihub.v1.Version.Builder builderForValue) { + if (versionBuilder_ == null) { + resource_ = builderForValue.build(); + onChanged(); + } else { + versionBuilder_.setMessage(builderForValue.build()); + } + resourceCase_ = 6; + return this; + } + /** + * + * + *
+     * This represents Version resource in search results. Only name,
+     * display_name and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Version version = 6; + */ + public Builder mergeVersion(com.google.cloud.apihub.v1.Version value) { + if (versionBuilder_ == null) { + if (resourceCase_ == 6 + && resource_ != com.google.cloud.apihub.v1.Version.getDefaultInstance()) { + resource_ = + com.google.cloud.apihub.v1.Version.newBuilder( + (com.google.cloud.apihub.v1.Version) resource_) + .mergeFrom(value) + .buildPartial(); + } else { + resource_ = value; + } + onChanged(); + } else { + if (resourceCase_ == 6) { + versionBuilder_.mergeFrom(value); + } else { + versionBuilder_.setMessage(value); + } + } + resourceCase_ = 6; + return this; + } + /** + * + * + *
+     * This represents Version resource in search results. Only name,
+     * display_name and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Version version = 6; + */ + public Builder clearVersion() { + if (versionBuilder_ == null) { + if (resourceCase_ == 6) { + resourceCase_ = 0; + resource_ = null; + onChanged(); + } + } else { + if (resourceCase_ == 6) { + resourceCase_ = 0; + resource_ = null; + } + versionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * This represents Version resource in search results. Only name,
+     * display_name and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Version version = 6; + */ + public com.google.cloud.apihub.v1.Version.Builder getVersionBuilder() { + return getVersionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * This represents Version resource in search results. Only name,
+     * display_name and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Version version = 6; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.VersionOrBuilder getVersionOrBuilder() { + if ((resourceCase_ == 6) && (versionBuilder_ != null)) { + return versionBuilder_.getMessageOrBuilder(); + } else { + if (resourceCase_ == 6) { + return (com.google.cloud.apihub.v1.Version) resource_; + } + return com.google.cloud.apihub.v1.Version.getDefaultInstance(); + } + } + /** + * + * + *
+     * This represents Version resource in search results. Only name,
+     * display_name and description fields are populated in search results.
+     * 
+ * + * .google.cloud.apihub.v1.Version version = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Version, + com.google.cloud.apihub.v1.Version.Builder, + com.google.cloud.apihub.v1.VersionOrBuilder> + getVersionFieldBuilder() { + if (versionBuilder_ == null) { + if (!(resourceCase_ == 6)) { + resource_ = com.google.cloud.apihub.v1.Version.getDefaultInstance(); + } + versionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Version, + com.google.cloud.apihub.v1.Version.Builder, + com.google.cloud.apihub.v1.VersionOrBuilder>( + (com.google.cloud.apihub.v1.Version) resource_, getParentForChildren(), isClean()); + resource_ = null; + } + resourceCase_ = 6; + onChanged(); + return versionBuilder_; + } + + @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.apihub.v1.ApiHubResource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.ApiHubResource) + private static final com.google.cloud.apihub.v1.ApiHubResource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.ApiHubResource(); + } + + public static com.google.cloud.apihub.v1.ApiHubResource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ApiHubResource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.ApiHubResource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubResourceOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubResourceOrBuilder.java new file mode 100644 index 000000000000..1f64262193cb --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubResourceOrBuilder.java @@ -0,0 +1,256 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface ApiHubResourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.ApiHubResource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This represents Api resource in search results. Only name, display_name,
+   * description and owner fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Api api = 1; + * + * @return Whether the api field is set. + */ + boolean hasApi(); + /** + * + * + *
+   * This represents Api resource in search results. Only name, display_name,
+   * description and owner fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Api api = 1; + * + * @return The api. + */ + com.google.cloud.apihub.v1.Api getApi(); + /** + * + * + *
+   * This represents Api resource in search results. Only name, display_name,
+   * description and owner fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Api api = 1; + */ + com.google.cloud.apihub.v1.ApiOrBuilder getApiOrBuilder(); + + /** + * + * + *
+   * This represents ApiOperation resource in search results. Only name,
+   * and description fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.ApiOperation operation = 2; + * + * @return Whether the operation field is set. + */ + boolean hasOperation(); + /** + * + * + *
+   * This represents ApiOperation resource in search results. Only name,
+   * and description fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.ApiOperation operation = 2; + * + * @return The operation. + */ + com.google.cloud.apihub.v1.ApiOperation getOperation(); + /** + * + * + *
+   * This represents ApiOperation resource in search results. Only name,
+   * and description fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.ApiOperation operation = 2; + */ + com.google.cloud.apihub.v1.ApiOperationOrBuilder getOperationOrBuilder(); + + /** + * + * + *
+   * This represents Deployment resource in search results. Only name,
+   * display_name and description fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Deployment deployment = 3; + * + * @return Whether the deployment field is set. + */ + boolean hasDeployment(); + /** + * + * + *
+   * This represents Deployment resource in search results. Only name,
+   * display_name and description fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Deployment deployment = 3; + * + * @return The deployment. + */ + com.google.cloud.apihub.v1.Deployment getDeployment(); + /** + * + * + *
+   * This represents Deployment resource in search results. Only name,
+   * display_name and description fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Deployment deployment = 3; + */ + com.google.cloud.apihub.v1.DeploymentOrBuilder getDeploymentOrBuilder(); + + /** + * + * + *
+   * This represents Spec resource in search results. Only name,
+   * display_name and description fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Spec spec = 4; + * + * @return Whether the spec field is set. + */ + boolean hasSpec(); + /** + * + * + *
+   * This represents Spec resource in search results. Only name,
+   * display_name and description fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Spec spec = 4; + * + * @return The spec. + */ + com.google.cloud.apihub.v1.Spec getSpec(); + /** + * + * + *
+   * This represents Spec resource in search results. Only name,
+   * display_name and description fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Spec spec = 4; + */ + com.google.cloud.apihub.v1.SpecOrBuilder getSpecOrBuilder(); + + /** + * + * + *
+   * This represents Definition resource in search results.
+   * Only name field is populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Definition definition = 5; + * + * @return Whether the definition field is set. + */ + boolean hasDefinition(); + /** + * + * + *
+   * This represents Definition resource in search results.
+   * Only name field is populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Definition definition = 5; + * + * @return The definition. + */ + com.google.cloud.apihub.v1.Definition getDefinition(); + /** + * + * + *
+   * This represents Definition resource in search results.
+   * Only name field is populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Definition definition = 5; + */ + com.google.cloud.apihub.v1.DefinitionOrBuilder getDefinitionOrBuilder(); + + /** + * + * + *
+   * This represents Version resource in search results. Only name,
+   * display_name and description fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Version version = 6; + * + * @return Whether the version field is set. + */ + boolean hasVersion(); + /** + * + * + *
+   * This represents Version resource in search results. Only name,
+   * display_name and description fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Version version = 6; + * + * @return The version. + */ + com.google.cloud.apihub.v1.Version getVersion(); + /** + * + * + *
+   * This represents Version resource in search results. Only name,
+   * display_name and description fields are populated in search results.
+   * 
+ * + * .google.cloud.apihub.v1.Version version = 6; + */ + com.google.cloud.apihub.v1.VersionOrBuilder getVersionOrBuilder(); + + com.google.cloud.apihub.v1.ApiHubResource.ResourceCase getResourceCase(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubServiceProto.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubServiceProto.java new file mode 100644 index 000000000000..eefabb71e794 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiHubServiceProto.java @@ -0,0 +1,1037 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public final class ApiHubServiceProto { + private ApiHubServiceProto() {} + + 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_apihub_v1_CreateApiRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_CreateApiRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_GetApiRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_GetApiRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_UpdateApiRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_UpdateApiRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_DeleteApiRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_DeleteApiRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_ListApisRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_ListApisRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_ListApisResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_ListApisResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_CreateVersionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_CreateVersionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_GetVersionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_GetVersionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_UpdateVersionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_UpdateVersionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_DeleteVersionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_DeleteVersionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_ListVersionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_ListVersionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_ListVersionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_ListVersionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_CreateSpecRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_CreateSpecRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_GetSpecRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_GetSpecRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_UpdateSpecRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_UpdateSpecRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_DeleteSpecRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_DeleteSpecRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_ListSpecsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_ListSpecsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_ListSpecsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_ListSpecsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_GetSpecContentsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_GetSpecContentsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_GetApiOperationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_GetApiOperationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_ListApiOperationsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_ListApiOperationsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_ListApiOperationsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_ListApiOperationsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_GetDefinitionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_GetDefinitionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_CreateDeploymentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_CreateDeploymentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_GetDeploymentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_GetDeploymentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_UpdateDeploymentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_UpdateDeploymentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_DeleteDeploymentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_DeleteDeploymentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_ListDeploymentsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_ListDeploymentsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_ListDeploymentsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_ListDeploymentsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_CreateAttributeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_CreateAttributeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_GetAttributeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_GetAttributeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_UpdateAttributeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_UpdateAttributeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_DeleteAttributeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_DeleteAttributeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_ListAttributesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_ListAttributesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_ListAttributesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_ListAttributesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_SearchResourcesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_SearchResourcesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_ApiHubResource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_ApiHubResource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_SearchResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_SearchResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_SearchResourcesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_SearchResourcesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_CreateDependencyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_CreateDependencyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_GetDependencyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_GetDependencyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_UpdateDependencyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_UpdateDependencyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_DeleteDependencyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_DeleteDependencyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_ListDependenciesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_ListDependenciesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_ListDependenciesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_ListDependenciesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_CreateExternalApiRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_CreateExternalApiRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_GetExternalApiRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_GetExternalApiRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_UpdateExternalApiRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_UpdateExternalApiRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_DeleteExternalApiRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_DeleteExternalApiRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_ListExternalApisRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_ListExternalApisRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_ListExternalApisResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_ListExternalApisResponse_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/apihub/v1/apihub_service." + + "proto\022\026google.cloud.apihub.v1\032\034google/ap" + + "i/annotations.proto\032\027google/api/client.p" + + "roto\032\037google/api/field_behavior.proto\032\031g" + + "oogle/api/resource.proto\032*google/cloud/a" + + "pihub/v1/common_fields.proto\032\033google/pro" + + "tobuf/empty.proto\032 google/protobuf/field" + + "_mask.proto\"\211\001\n\020CreateApiRequest\0221\n\006pare" + + "nt\030\001 \001(\tB!\340A\002\372A\033\022\031apihub.googleapis.com/" + + "Api\022\023\n\006api_id\030\002 \001(\tB\003\340A\001\022-\n\003api\030\003 \001(\0132\033." + + "google.cloud.apihub.v1.ApiB\003\340A\002\"@\n\rGetAp" + + "iRequest\022/\n\004name\030\001 \001(\tB!\340A\002\372A\033\n\031apihub.g" + + "oogleapis.com/Api\"w\n\020UpdateApiRequest\022-\n" + + "\003api\030\001 \001(\0132\033.google.cloud.apihub.v1.ApiB" + + "\003\340A\002\0224\n\013update_mask\030\002 \001(\0132\032.google.proto" + + "buf.FieldMaskB\003\340A\002\"W\n\020DeleteApiRequest\022/" + + "\n\004name\030\001 \001(\tB!\340A\002\372A\033\n\031apihub.googleapis." + + "com/Api\022\022\n\005force\030\002 \001(\010B\003\340A\001\"\212\001\n\017ListApis" + + "Request\0221\n\006parent\030\001 \001(\tB!\340A\002\372A\033\022\031apihub." + + "googleapis.com/Api\022\023\n\006filter\030\002 \001(\tB\003\340A\001\022" + + "\026\n\tpage_size\030\003 \001(\005B\003\340A\001\022\027\n\npage_token\030\004 " + + "\001(\tB\003\340A\001\"V\n\020ListApisResponse\022)\n\004apis\030\001 \003" + + "(\0132\033.google.cloud.apihub.v1.Api\022\027\n\017next_" + + "page_token\030\002 \001(\t\"\231\001\n\024CreateVersionReques" + + "t\0221\n\006parent\030\001 \001(\tB!\340A\002\372A\033\n\031apihub.google" + + "apis.com/Api\022\027\n\nversion_id\030\002 \001(\tB\003\340A\001\0225\n" + + "\007version\030\003 \001(\0132\037.google.cloud.apihub.v1." + + "VersionB\003\340A\002\"H\n\021GetVersionRequest\0223\n\004nam" + + "e\030\001 \001(\tB%\340A\002\372A\037\n\035apihub.googleapis.com/V" + + "ersion\"\203\001\n\024UpdateVersionRequest\0225\n\007versi" + + "on\030\001 \001(\0132\037.google.cloud.apihub.v1.Versio" + + "nB\003\340A\002\0224\n\013update_mask\030\002 \001(\0132\032.google.pro" + + "tobuf.FieldMaskB\003\340A\002\"_\n\024DeleteVersionReq" + + "uest\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035apihub.googl" + + "eapis.com/Version\022\022\n\005force\030\002 \001(\010B\003\340A\001\"\222\001" + + "\n\023ListVersionsRequest\0225\n\006parent\030\001 \001(\tB%\340" + + "A\002\372A\037\022\035apihub.googleapis.com/Version\022\023\n\006" + + "filter\030\002 \001(\tB\003\340A\001\022\026\n\tpage_size\030\003 \001(\005B\003\340A" + + "\001\022\027\n\npage_token\030\004 \001(\tB\003\340A\001\"b\n\024ListVersio" + + "nsResponse\0221\n\010versions\030\001 \003(\0132\037.google.cl" + + "oud.apihub.v1.Version\022\027\n\017next_page_token" + + "\030\002 \001(\t\"\221\001\n\021CreateSpecRequest\0225\n\006parent\030\001" + + " \001(\tB%\340A\002\372A\037\n\035apihub.googleapis.com/Vers" + + "ion\022\024\n\007spec_id\030\002 \001(\tB\003\340A\001\022/\n\004spec\030\003 \001(\0132" + + "\034.google.cloud.apihub.v1.SpecB\003\340A\002\"B\n\016Ge" + + "tSpecRequest\0220\n\004name\030\001 \001(\tB\"\340A\002\372A\034\n\032apih" + + "ub.googleapis.com/Spec\"z\n\021UpdateSpecRequ" + + "est\022/\n\004spec\030\001 \001(\0132\034.google.cloud.apihub." + + "v1.SpecB\003\340A\002\0224\n\013update_mask\030\002 \001(\0132\032.goog" + + "le.protobuf.FieldMaskB\003\340A\002\"E\n\021DeleteSpec" + + "Request\0220\n\004name\030\001 \001(\tB\"\340A\002\372A\034\n\032apihub.go" + + "ogleapis.com/Spec\"\214\001\n\020ListSpecsRequest\0222" + + "\n\006parent\030\001 \001(\tB\"\340A\002\372A\034\022\032apihub.googleapi" + + "s.com/Spec\022\023\n\006filter\030\002 \001(\tB\003\340A\001\022\026\n\tpage_" + + "size\030\003 \001(\005B\003\340A\001\022\027\n\npage_token\030\004 \001(\tB\003\340A\001" + + "\"Y\n\021ListSpecsResponse\022+\n\005specs\030\001 \003(\0132\034.g" + + "oogle.cloud.apihub.v1.Spec\022\027\n\017next_page_" + + "token\030\002 \001(\t\"J\n\026GetSpecContentsRequest\0220\n" + + "\004name\030\001 \001(\tB\"\340A\002\372A\034\n\032apihub.googleapis.c" + + "om/Spec\"R\n\026GetApiOperationRequest\0228\n\004nam" + + "e\030\001 \001(\tB*\340A\002\372A$\n\"apihub.googleapis.com/A" + + "piOperation\"\234\001\n\030ListApiOperationsRequest" + + "\022:\n\006parent\030\001 \001(\tB*\340A\002\372A$\022\"apihub.googlea" + + "pis.com/ApiOperation\022\023\n\006filter\030\002 \001(\tB\003\340A" + + "\001\022\026\n\tpage_size\030\003 \001(\005B\003\340A\001\022\027\n\npage_token\030" + + "\004 \001(\tB\003\340A\001\"r\n\031ListApiOperationsResponse\022" + + "<\n\016api_operations\030\001 \003(\0132$.google.cloud.a" + + "pihub.v1.ApiOperation\022\027\n\017next_page_token" + + "\030\002 \001(\t\"N\n\024GetDefinitionRequest\0226\n\004name\030\001" + + " \001(\tB(\340A\002\372A\"\n apihub.googleapis.com/Defi" + + "nition\"\254\001\n\027CreateDeploymentRequest\0228\n\006pa" + + "rent\030\001 \001(\tB(\340A\002\372A\"\022 apihub.googleapis.co" + + "m/Deployment\022\032\n\rdeployment_id\030\002 \001(\tB\003\340A\001" + + "\022;\n\ndeployment\030\003 \001(\0132\".google.cloud.apih" + + "ub.v1.DeploymentB\003\340A\002\"N\n\024GetDeploymentRe" + + "quest\0226\n\004name\030\001 \001(\tB(\340A\002\372A\"\n apihub.goog" + + "leapis.com/Deployment\"\214\001\n\027UpdateDeployme" + + "ntRequest\022;\n\ndeployment\030\001 \001(\0132\".google.c" + + "loud.apihub.v1.DeploymentB\003\340A\002\0224\n\013update" + + "_mask\030\002 \001(\0132\032.google.protobuf.FieldMaskB" + + "\003\340A\002\"Q\n\027DeleteDeploymentRequest\0226\n\004name\030" + + "\001 \001(\tB(\340A\002\372A\"\n apihub.googleapis.com/Dep" + + "loyment\"\230\001\n\026ListDeploymentsRequest\0228\n\006pa" + + "rent\030\001 \001(\tB(\340A\002\372A\"\022 apihub.googleapis.co" + + "m/Deployment\022\023\n\006filter\030\002 \001(\tB\003\340A\001\022\026\n\tpag" + + "e_size\030\003 \001(\005B\003\340A\001\022\027\n\npage_token\030\004 \001(\tB\003\340" + + "A\001\"k\n\027ListDeploymentsResponse\0227\n\013deploym" + + "ents\030\001 \003(\0132\".google.cloud.apihub.v1.Depl" + + "oyment\022\027\n\017next_page_token\030\002 \001(\t\"\247\001\n\026Crea" + + "teAttributeRequest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372" + + "A!\022\037apihub.googleapis.com/Attribute\022\031\n\014a" + + "ttribute_id\030\002 \001(\tB\003\340A\001\0229\n\tattribute\030\003 \001(" + + "\0132!.google.cloud.apihub.v1.AttributeB\003\340A" + + "\002\"L\n\023GetAttributeRequest\0225\n\004name\030\001 \001(\tB\'" + + "\340A\002\372A!\n\037apihub.googleapis.com/Attribute\"" + + "\211\001\n\026UpdateAttributeRequest\0229\n\tattribute\030" + + "\001 \001(\0132!.google.cloud.apihub.v1.Attribute" + + "B\003\340A\002\0224\n\013update_mask\030\002 \001(\0132\032.google.prot" + + "obuf.FieldMaskB\003\340A\002\"O\n\026DeleteAttributeRe" + + "quest\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037apihub.goog" + + "leapis.com/Attribute\"\226\001\n\025ListAttributesR" + + "equest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\022\037apihub.g" + + "oogleapis.com/Attribute\022\023\n\006filter\030\002 \001(\tB" + + "\003\340A\001\022\026\n\tpage_size\030\003 \001(\005B\003\340A\001\022\027\n\npage_tok" + + "en\030\004 \001(\tB\003\340A\001\"h\n\026ListAttributesResponse\022" + + "5\n\nattributes\030\001 \003(\0132!.google.cloud.apihu" + + "b.v1.Attribute\022\027\n\017next_page_token\030\002 \001(\t\"" + + "\257\001\n\026SearchResourcesRequest\022;\n\010location\030\001" + + " \001(\tB)\340A\002\372A#\n!locations.googleapis.com/L" + + "ocation\022\022\n\005query\030\002 \001(\tB\003\340A\002\022\023\n\006filter\030\003 " + + "\001(\tB\003\340A\001\022\026\n\tpage_size\030\004 \001(\005B\003\340A\001\022\027\n\npage" + + "_token\030\005 \001(\tB\003\340A\001\"\331\002\n\016ApiHubResource\022*\n\003" + + "api\030\001 \001(\0132\033.google.cloud.apihub.v1.ApiH\000" + + "\0229\n\toperation\030\002 \001(\0132$.google.cloud.apihu" + + "b.v1.ApiOperationH\000\0228\n\ndeployment\030\003 \001(\0132" + + "\".google.cloud.apihub.v1.DeploymentH\000\022,\n" + + "\004spec\030\004 \001(\0132\034.google.cloud.apihub.v1.Spe" + + "cH\000\0228\n\ndefinition\030\005 \001(\0132\".google.cloud.a" + + "pihub.v1.DefinitionH\000\0222\n\007version\030\006 \001(\0132\037" + + ".google.cloud.apihub.v1.VersionH\000B\n\n\010res" + + "ource\"H\n\014SearchResult\0228\n\010resource\030\001 \001(\0132" + + "&.google.cloud.apihub.v1.ApiHubResource\"" + + "p\n\027SearchResourcesResponse\022<\n\016search_res" + + "ults\030\001 \003(\0132$.google.cloud.apihub.v1.Sear" + + "chResult\022\027\n\017next_page_token\030\002 \001(\t\"\254\001\n\027Cr" + + "eateDependencyRequest\0228\n\006parent\030\001 \001(\tB(\340" + + "A\002\372A\"\022 apihub.googleapis.com/Dependency\022" + + "\032\n\rdependency_id\030\002 \001(\tB\003\340A\001\022;\n\ndependenc" + + "y\030\003 \001(\0132\".google.cloud.apihub.v1.Depende" + + "ncyB\003\340A\002\"N\n\024GetDependencyRequest\0226\n\004name" + + "\030\001 \001(\tB(\340A\002\372A\"\n apihub.googleapis.com/De" + + "pendency\"\214\001\n\027UpdateDependencyRequest\022;\n\n" + + "dependency\030\001 \001(\0132\".google.cloud.apihub.v" + + "1.DependencyB\003\340A\002\0224\n\013update_mask\030\002 \001(\0132\032" + + ".google.protobuf.FieldMaskB\003\340A\002\"Q\n\027Delet" + + "eDependencyRequest\0226\n\004name\030\001 \001(\tB(\340A\002\372A\"" + + "\n apihub.googleapis.com/Dependency\"\231\001\n\027L" + + "istDependenciesRequest\0228\n\006parent\030\001 \001(\tB(" + + "\340A\002\372A\"\022 apihub.googleapis.com/Dependency" + + "\022\023\n\006filter\030\002 \001(\tB\003\340A\001\022\026\n\tpage_size\030\003 \001(\005" + + "B\003\340A\001\022\027\n\npage_token\030\004 \001(\tB\003\340A\001\"m\n\030ListDe" + + "pendenciesResponse\0228\n\014dependencies\030\001 \003(\013" + + "2\".google.cloud.apihub.v1.Dependency\022\027\n\017" + + "next_page_token\030\002 \001(\t\"\263\001\n\030CreateExternal" + + "ApiRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\022!apih" + + "ub.googleapis.com/ExternalApi\022\034\n\017externa" + + "l_api_id\030\002 \001(\tB\003\340A\001\022>\n\014external_api\030\003 \001(" + + "\0132#.google.cloud.apihub.v1.ExternalApiB\003" + + "\340A\002\"P\n\025GetExternalApiRequest\0227\n\004name\030\001 \001" + + "(\tB)\340A\002\372A#\n!apihub.googleapis.com/Extern" + + "alApi\"\220\001\n\030UpdateExternalApiRequest\022>\n\014ex" + + "ternal_api\030\001 \001(\0132#.google.cloud.apihub.v" + + "1.ExternalApiB\003\340A\002\0224\n\013update_mask\030\002 \001(\0132" + + "\032.google.protobuf.FieldMaskB\003\340A\002\"S\n\030Dele" + + "teExternalApiRequest\0227\n\004name\030\001 \001(\tB)\340A\002\372" + + "A#\n!apihub.googleapis.com/ExternalApi\"\205\001" + + "\n\027ListExternalApisRequest\0229\n\006parent\030\001 \001(" + + "\tB)\340A\002\372A#\022!apihub.googleapis.com/Externa" + + "lApi\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\npage_tok" + + "en\030\003 \001(\tB\003\340A\001\"o\n\030ListExternalApisRespons" + + "e\022:\n\rexternal_apis\030\001 \003(\0132#.google.cloud." + + "apihub.v1.ExternalApi\022\027\n\017next_page_token" + + "\030\002 \001(\t2\2721\n\006ApiHub\022\235\001\n\tCreateApi\022(.google" + + ".cloud.apihub.v1.CreateApiRequest\032\033.goog" + + "le.cloud.apihub.v1.Api\"I\332A\021parent,api,ap" + + "i_id\202\323\344\223\002/\"(/v1/{parent=projects/*/locat" + + "ions/*}/apis:\003api\022\205\001\n\006GetApi\022%.google.cl" + + "oud.apihub.v1.GetApiRequest\032\033.google.clo" + + "ud.apihub.v1.Api\"7\332A\004name\202\323\344\223\002*\022(/v1/{na" + + "me=projects/*/locations/*/apis/*}\022\230\001\n\010Li" + + "stApis\022\'.google.cloud.apihub.v1.ListApis" + + "Request\032(.google.cloud.apihub.v1.ListApi" + + "sResponse\"9\332A\006parent\202\323\344\223\002*\022(/v1/{parent=" + + "projects/*/locations/*}/apis\022\237\001\n\tUpdateA" + + "pi\022(.google.cloud.apihub.v1.UpdateApiReq" + + "uest\032\033.google.cloud.apihub.v1.Api\"K\332A\017ap" + + "i,update_mask\202\323\344\223\00232,/v1/{api.name=proje" + + "cts/*/locations/*/apis/*}:\003api\022\206\001\n\tDelet" + + "eApi\022(.google.cloud.apihub.v1.DeleteApiR" + + "equest\032\026.google.protobuf.Empty\"7\332A\004name\202" + + "\323\344\223\002**(/v1/{name=projects/*/locations/*/" + + "apis/*}\022\300\001\n\rCreateVersion\022,.google.cloud" + + ".apihub.v1.CreateVersionRequest\032\037.google" + + ".cloud.apihub.v1.Version\"`\332A\031parent,vers" + + "ion,version_id\202\323\344\223\002>\"3/v1/{parent=projec" + + "ts/*/locations/*/apis/*}/versions:\007versi" + + "on\022\234\001\n\nGetVersion\022).google.cloud.apihub." + + "v1.GetVersionRequest\032\037.google.cloud.apih" + + "ub.v1.Version\"B\332A\004name\202\323\344\223\0025\0223/v1/{name=" + + "projects/*/locations/*/apis/*/versions/*" + + "}\022\257\001\n\014ListVersions\022+.google.cloud.apihub" + + ".v1.ListVersionsRequest\032,.google.cloud.a" + + "pihub.v1.ListVersionsResponse\"D\332A\006parent" + + "\202\323\344\223\0025\0223/v1/{parent=projects/*/locations" + + "/*/apis/*}/versions\022\302\001\n\rUpdateVersion\022,." + + "google.cloud.apihub.v1.UpdateVersionRequ" + + "est\032\037.google.cloud.apihub.v1.Version\"b\332A" + + "\023version,update_mask\202\323\344\223\002F2;/v1/{version" + + ".name=projects/*/locations/*/apis/*/vers" + + "ions/*}:\007version\022\231\001\n\rDeleteVersion\022,.goo" + + "gle.cloud.apihub.v1.DeleteVersionRequest" + + "\032\026.google.protobuf.Empty\"B\332A\004name\202\323\344\223\0025*" + + "3/v1/{name=projects/*/locations/*/apis/*" + + "/versions/*}\022\266\001\n\nCreateSpec\022).google.clo" + + "ud.apihub.v1.CreateSpecRequest\032\034.google." + + "cloud.apihub.v1.Spec\"_\332A\023parent,spec,spe" + + "c_id\202\323\344\223\002C\";/v1/{parent=projects/*/locat" + + "ions/*/apis/*/versions/*}/specs:\004spec\022\233\001" + + "\n\007GetSpec\022&.google.cloud.apihub.v1.GetSp" + + "ecRequest\032\034.google.cloud.apihub.v1.Spec\"" + + "J\332A\004name\202\323\344\223\002=\022;/v1/{name=projects/*/loc" + + "ations/*/apis/*/versions/*/specs/*}\022\274\001\n\017" + + "GetSpecContents\022..google.cloud.apihub.v1" + + ".GetSpecContentsRequest\032$.google.cloud.a" + + "pihub.v1.SpecContents\"S\332A\004name\202\323\344\223\002F\022D/v" + + "1/{name=projects/*/locations/*/apis/*/ve" + + "rsions/*/specs/*}:contents\022\256\001\n\tListSpecs" + + "\022(.google.cloud.apihub.v1.ListSpecsReque" + + "st\032).google.cloud.apihub.v1.ListSpecsRes" + + "ponse\"L\332A\006parent\202\323\344\223\002=\022;/v1/{parent=proj" + + "ects/*/locations/*/apis/*/versions/*}/sp" + + "ecs\022\270\001\n\nUpdateSpec\022).google.cloud.apihub" + + ".v1.UpdateSpecRequest\032\034.google.cloud.api" + + "hub.v1.Spec\"a\332A\020spec,update_mask\202\323\344\223\002H2@" + + "/v1/{spec.name=projects/*/locations/*/ap" + + "is/*/versions/*/specs/*}:\004spec\022\233\001\n\nDelet" + + "eSpec\022).google.cloud.apihub.v1.DeleteSpe" + + "cRequest\032\026.google.protobuf.Empty\"J\332A\004nam" + + "e\202\323\344\223\002=*;/v1/{name=projects/*/locations/" + + "*/apis/*/versions/*/specs/*}\022\270\001\n\017GetApiO" + + "peration\022..google.cloud.apihub.v1.GetApi" + + "OperationRequest\032$.google.cloud.apihub.v" + + "1.ApiOperation\"O\332A\004name\202\323\344\223\002B\022@/v1/{name" + + "=projects/*/locations/*/apis/*/versions/" + + "*/operations/*}\022\313\001\n\021ListApiOperations\0220." + + "google.cloud.apihub.v1.ListApiOperations" + + "Request\0321.google.cloud.apihub.v1.ListApi" + + "OperationsResponse\"Q\332A\006parent\202\323\344\223\002B\022@/v1" + + "/{parent=projects/*/locations/*/apis/*/v" + + "ersions/*}/operations\022\263\001\n\rGetDefinition\022" + + ",.google.cloud.apihub.v1.GetDefinitionRe" + + "quest\032\".google.cloud.apihub.v1.Definitio" + + "n\"P\332A\004name\202\323\344\223\002C\022A/v1/{name=projects/*/l" + + "ocations/*/apis/*/versions/*/definitions" + + "/*}\022\316\001\n\020CreateDeployment\022/.google.cloud." + + "apihub.v1.CreateDeploymentRequest\032\".goog" + + "le.cloud.apihub.v1.Deployment\"e\332A\037parent" + + ",deployment,deployment_id\202\323\344\223\002=\"//v1/{pa" + + "rent=projects/*/locations/*}/deployments" + + ":\ndeployment\022\241\001\n\rGetDeployment\022,.google." + + "cloud.apihub.v1.GetDeploymentRequest\032\".g" + + "oogle.cloud.apihub.v1.Deployment\">\332A\004nam" + + "e\202\323\344\223\0021\022//v1/{name=projects/*/locations/" + + "*/deployments/*}\022\264\001\n\017ListDeployments\022..g" + + "oogle.cloud.apihub.v1.ListDeploymentsReq" + + "uest\032/.google.cloud.apihub.v1.ListDeploy" + + "mentsResponse\"@\332A\006parent\202\323\344\223\0021\022//v1/{par" + + "ent=projects/*/locations/*}/deployments\022" + + "\320\001\n\020UpdateDeployment\022/.google.cloud.apih" + + "ub.v1.UpdateDeploymentRequest\032\".google.c" + + "loud.apihub.v1.Deployment\"g\332A\026deployment" + + ",update_mask\202\323\344\223\002H2:/v1/{deployment.name" + + "=projects/*/locations/*/deployments/*}:\n" + + "deployment\022\233\001\n\020DeleteDeployment\022/.google" + + ".cloud.apihub.v1.DeleteDeploymentRequest" + + "\032\026.google.protobuf.Empty\">\332A\004name\202\323\344\223\0021*" + + "//v1/{name=projects/*/locations/*/deploy" + + "ments/*}\022\307\001\n\017CreateAttribute\022..google.cl" + + "oud.apihub.v1.CreateAttributeRequest\032!.g" + + "oogle.cloud.apihub.v1.Attribute\"a\332A\035pare" + + "nt,attribute,attribute_id\202\323\344\223\002;\"./v1/{pa" + + "rent=projects/*/locations/*}/attributes:" + + "\tattribute\022\235\001\n\014GetAttribute\022+.google.clo" + + "ud.apihub.v1.GetAttributeRequest\032!.googl" + + "e.cloud.apihub.v1.Attribute\"=\332A\004name\202\323\344\223" + + "\0020\022./v1/{name=projects/*/locations/*/att" + + "ributes/*}\022\311\001\n\017UpdateAttribute\022..google." + + "cloud.apihub.v1.UpdateAttributeRequest\032!" + + ".google.cloud.apihub.v1.Attribute\"c\332A\025at" + + "tribute,update_mask\202\323\344\223\002E28/v1/{attribut" + + "e.name=projects/*/locations/*/attributes" + + "/*}:\tattribute\022\230\001\n\017DeleteAttribute\022..goo" + + "gle.cloud.apihub.v1.DeleteAttributeReque" + + "st\032\026.google.protobuf.Empty\"=\332A\004name\202\323\344\223\002" + + "0*./v1/{name=projects/*/locations/*/attr" + + "ibutes/*}\022\260\001\n\016ListAttributes\022-.google.cl" + + "oud.apihub.v1.ListAttributesRequest\032..go" + + "ogle.cloud.apihub.v1.ListAttributesRespo" + + "nse\"?\332A\006parent\202\323\344\223\0020\022./v1/{parent=projec" + + "ts/*/locations/*}/attributes\022\305\001\n\017SearchR" + + "esources\022..google.cloud.apihub.v1.Search" + + "ResourcesRequest\032/.google.cloud.apihub.v" + + "1.SearchResourcesResponse\"Q\332A\016location,q" + + "uery\202\323\344\223\002:\"5/v1/{location=projects/*/loc" + + "ations/*}:searchResources:\001*\022\330\001\n\021CreateE" + + "xternalApi\0220.google.cloud.apihub.v1.Crea" + + "teExternalApiRequest\032#.google.cloud.apih" + + "ub.v1.ExternalApi\"l\332A#parent,external_ap" + + "i,external_api_id\202\323\344\223\002@\"0/v1/{parent=pro" + + "jects/*/locations/*}/externalApis:\014exter" + + "nal_api\022\245\001\n\016GetExternalApi\022-.google.clou" + + "d.apihub.v1.GetExternalApiRequest\032#.goog" + + "le.cloud.apihub.v1.ExternalApi\"?\332A\004name\202" + + "\323\344\223\0022\0220/v1/{name=projects/*/locations/*/" + + "externalApis/*}\022\332\001\n\021UpdateExternalApi\0220." + + "google.cloud.apihub.v1.UpdateExternalApi" + + "Request\032#.google.cloud.apihub.v1.Externa" + + "lApi\"n\332A\030external_api,update_mask\202\323\344\223\002M2" + + "=/v1/{external_api.name=projects/*/locat" + + "ions/*/externalApis/*}:\014external_api\022\236\001\n" + + "\021DeleteExternalApi\0220.google.cloud.apihub" + + ".v1.DeleteExternalApiRequest\032\026.google.pr" + + "otobuf.Empty\"?\332A\004name\202\323\344\223\0022*0/v1/{name=p" + + "rojects/*/locations/*/externalApis/*}\022\270\001" + + "\n\020ListExternalApis\022/.google.cloud.apihub" + + ".v1.ListExternalApisRequest\0320.google.clo" + + "ud.apihub.v1.ListExternalApisResponse\"A\332" + + "A\006parent\202\323\344\223\0022\0220/v1/{parent=projects/*/l" + + "ocations/*}/externalApis\032I\312A\025apihub.goog" + + "leapis.com\322A.https://www.googleapis.com/" + + "auth/cloud-platform2\204\010\n\022ApiHubDependenci" + + "es\022\317\001\n\020CreateDependency\022/.google.cloud.a" + + "pihub.v1.CreateDependencyRequest\032\".googl" + + "e.cloud.apihub.v1.Dependency\"f\332A\037parent," + + "dependency,dependency_id\202\323\344\223\002>\"0/v1/{par" + + "ent=projects/*/locations/*}/dependencies" + + ":\ndependency\022\242\001\n\rGetDependency\022,.google." + + "cloud.apihub.v1.GetDependencyRequest\032\".g" + + "oogle.cloud.apihub.v1.Dependency\"?\332A\004nam" + + "e\202\323\344\223\0022\0220/v1/{name=projects/*/locations/" + + "*/dependencies/*}\022\321\001\n\020UpdateDependency\022/" + + ".google.cloud.apihub.v1.UpdateDependency" + + "Request\032\".google.cloud.apihub.v1.Depende" + + "ncy\"h\332A\026dependency,update_mask\202\323\344\223\002I2;/v" + + "1/{dependency.name=projects/*/locations/" + + "*/dependencies/*}:\ndependency\022\234\001\n\020Delete" + + "Dependency\022/.google.cloud.apihub.v1.Dele" + + "teDependencyRequest\032\026.google.protobuf.Em" + + "pty\"?\332A\004name\202\323\344\223\0022*0/v1/{name=projects/*" + + "/locations/*/dependencies/*}\022\270\001\n\020ListDep" + + "endencies\022/.google.cloud.apihub.v1.ListD" + + "ependenciesRequest\0320.google.cloud.apihub" + + ".v1.ListDependenciesResponse\"A\332A\006parent\202" + + "\323\344\223\0022\0220/v1/{parent=projects/*/locations/" + + "*}/dependencies\032I\312A\025apihub.googleapis.co" + + "m\322A.https://www.googleapis.com/auth/clou" + + "d-platformB\264\001\n\032com.google.cloud.apihub.v" + + "1B\022ApiHubServiceProtoP\001Z2cloud.google.co" + + "m/go/apihub/apiv1/apihubpb;apihubpb\252\002\026Go" + + "ogle.Cloud.ApiHub.V1\312\002\026Google\\Cloud\\ApiH" + + "ub\\V1\352\002\031Google::Cloud::ApiHub::V1b\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.cloud.apihub.v1.CommonFieldsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }); + internal_static_google_cloud_apihub_v1_CreateApiRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_apihub_v1_CreateApiRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_CreateApiRequest_descriptor, + new java.lang.String[] { + "Parent", "ApiId", "Api", + }); + internal_static_google_cloud_apihub_v1_GetApiRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_apihub_v1_GetApiRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_GetApiRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_apihub_v1_UpdateApiRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_apihub_v1_UpdateApiRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_UpdateApiRequest_descriptor, + new java.lang.String[] { + "Api", "UpdateMask", + }); + internal_static_google_cloud_apihub_v1_DeleteApiRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_apihub_v1_DeleteApiRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_DeleteApiRequest_descriptor, + new java.lang.String[] { + "Name", "Force", + }); + internal_static_google_cloud_apihub_v1_ListApisRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_apihub_v1_ListApisRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_ListApisRequest_descriptor, + new java.lang.String[] { + "Parent", "Filter", "PageSize", "PageToken", + }); + internal_static_google_cloud_apihub_v1_ListApisResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_apihub_v1_ListApisResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_ListApisResponse_descriptor, + new java.lang.String[] { + "Apis", "NextPageToken", + }); + internal_static_google_cloud_apihub_v1_CreateVersionRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_apihub_v1_CreateVersionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_CreateVersionRequest_descriptor, + new java.lang.String[] { + "Parent", "VersionId", "Version", + }); + internal_static_google_cloud_apihub_v1_GetVersionRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_apihub_v1_GetVersionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_GetVersionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_apihub_v1_UpdateVersionRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_apihub_v1_UpdateVersionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_UpdateVersionRequest_descriptor, + new java.lang.String[] { + "Version", "UpdateMask", + }); + internal_static_google_cloud_apihub_v1_DeleteVersionRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_apihub_v1_DeleteVersionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_DeleteVersionRequest_descriptor, + new java.lang.String[] { + "Name", "Force", + }); + internal_static_google_cloud_apihub_v1_ListVersionsRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_apihub_v1_ListVersionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_ListVersionsRequest_descriptor, + new java.lang.String[] { + "Parent", "Filter", "PageSize", "PageToken", + }); + internal_static_google_cloud_apihub_v1_ListVersionsResponse_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_apihub_v1_ListVersionsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_ListVersionsResponse_descriptor, + new java.lang.String[] { + "Versions", "NextPageToken", + }); + internal_static_google_cloud_apihub_v1_CreateSpecRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_apihub_v1_CreateSpecRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_CreateSpecRequest_descriptor, + new java.lang.String[] { + "Parent", "SpecId", "Spec", + }); + internal_static_google_cloud_apihub_v1_GetSpecRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_apihub_v1_GetSpecRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_GetSpecRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_apihub_v1_UpdateSpecRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_apihub_v1_UpdateSpecRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_UpdateSpecRequest_descriptor, + new java.lang.String[] { + "Spec", "UpdateMask", + }); + internal_static_google_cloud_apihub_v1_DeleteSpecRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_apihub_v1_DeleteSpecRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_DeleteSpecRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_apihub_v1_ListSpecsRequest_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_apihub_v1_ListSpecsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_ListSpecsRequest_descriptor, + new java.lang.String[] { + "Parent", "Filter", "PageSize", "PageToken", + }); + internal_static_google_cloud_apihub_v1_ListSpecsResponse_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_apihub_v1_ListSpecsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_ListSpecsResponse_descriptor, + new java.lang.String[] { + "Specs", "NextPageToken", + }); + internal_static_google_cloud_apihub_v1_GetSpecContentsRequest_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_apihub_v1_GetSpecContentsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_GetSpecContentsRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_apihub_v1_GetApiOperationRequest_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_cloud_apihub_v1_GetApiOperationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_GetApiOperationRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_apihub_v1_ListApiOperationsRequest_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_cloud_apihub_v1_ListApiOperationsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_ListApiOperationsRequest_descriptor, + new java.lang.String[] { + "Parent", "Filter", "PageSize", "PageToken", + }); + internal_static_google_cloud_apihub_v1_ListApiOperationsResponse_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_cloud_apihub_v1_ListApiOperationsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_ListApiOperationsResponse_descriptor, + new java.lang.String[] { + "ApiOperations", "NextPageToken", + }); + internal_static_google_cloud_apihub_v1_GetDefinitionRequest_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_google_cloud_apihub_v1_GetDefinitionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_GetDefinitionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_apihub_v1_CreateDeploymentRequest_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_google_cloud_apihub_v1_CreateDeploymentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_CreateDeploymentRequest_descriptor, + new java.lang.String[] { + "Parent", "DeploymentId", "Deployment", + }); + internal_static_google_cloud_apihub_v1_GetDeploymentRequest_descriptor = + getDescriptor().getMessageTypes().get(24); + internal_static_google_cloud_apihub_v1_GetDeploymentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_GetDeploymentRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_apihub_v1_UpdateDeploymentRequest_descriptor = + getDescriptor().getMessageTypes().get(25); + internal_static_google_cloud_apihub_v1_UpdateDeploymentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_UpdateDeploymentRequest_descriptor, + new java.lang.String[] { + "Deployment", "UpdateMask", + }); + internal_static_google_cloud_apihub_v1_DeleteDeploymentRequest_descriptor = + getDescriptor().getMessageTypes().get(26); + internal_static_google_cloud_apihub_v1_DeleteDeploymentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_DeleteDeploymentRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_apihub_v1_ListDeploymentsRequest_descriptor = + getDescriptor().getMessageTypes().get(27); + internal_static_google_cloud_apihub_v1_ListDeploymentsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_ListDeploymentsRequest_descriptor, + new java.lang.String[] { + "Parent", "Filter", "PageSize", "PageToken", + }); + internal_static_google_cloud_apihub_v1_ListDeploymentsResponse_descriptor = + getDescriptor().getMessageTypes().get(28); + internal_static_google_cloud_apihub_v1_ListDeploymentsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_ListDeploymentsResponse_descriptor, + new java.lang.String[] { + "Deployments", "NextPageToken", + }); + internal_static_google_cloud_apihub_v1_CreateAttributeRequest_descriptor = + getDescriptor().getMessageTypes().get(29); + internal_static_google_cloud_apihub_v1_CreateAttributeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_CreateAttributeRequest_descriptor, + new java.lang.String[] { + "Parent", "AttributeId", "Attribute", + }); + internal_static_google_cloud_apihub_v1_GetAttributeRequest_descriptor = + getDescriptor().getMessageTypes().get(30); + internal_static_google_cloud_apihub_v1_GetAttributeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_GetAttributeRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_apihub_v1_UpdateAttributeRequest_descriptor = + getDescriptor().getMessageTypes().get(31); + internal_static_google_cloud_apihub_v1_UpdateAttributeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_UpdateAttributeRequest_descriptor, + new java.lang.String[] { + "Attribute", "UpdateMask", + }); + internal_static_google_cloud_apihub_v1_DeleteAttributeRequest_descriptor = + getDescriptor().getMessageTypes().get(32); + internal_static_google_cloud_apihub_v1_DeleteAttributeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_DeleteAttributeRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_apihub_v1_ListAttributesRequest_descriptor = + getDescriptor().getMessageTypes().get(33); + internal_static_google_cloud_apihub_v1_ListAttributesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_ListAttributesRequest_descriptor, + new java.lang.String[] { + "Parent", "Filter", "PageSize", "PageToken", + }); + internal_static_google_cloud_apihub_v1_ListAttributesResponse_descriptor = + getDescriptor().getMessageTypes().get(34); + internal_static_google_cloud_apihub_v1_ListAttributesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_ListAttributesResponse_descriptor, + new java.lang.String[] { + "Attributes", "NextPageToken", + }); + internal_static_google_cloud_apihub_v1_SearchResourcesRequest_descriptor = + getDescriptor().getMessageTypes().get(35); + internal_static_google_cloud_apihub_v1_SearchResourcesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_SearchResourcesRequest_descriptor, + new java.lang.String[] { + "Location", "Query", "Filter", "PageSize", "PageToken", + }); + internal_static_google_cloud_apihub_v1_ApiHubResource_descriptor = + getDescriptor().getMessageTypes().get(36); + internal_static_google_cloud_apihub_v1_ApiHubResource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_ApiHubResource_descriptor, + new java.lang.String[] { + "Api", "Operation", "Deployment", "Spec", "Definition", "Version", "Resource", + }); + internal_static_google_cloud_apihub_v1_SearchResult_descriptor = + getDescriptor().getMessageTypes().get(37); + internal_static_google_cloud_apihub_v1_SearchResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_SearchResult_descriptor, + new java.lang.String[] { + "Resource", + }); + internal_static_google_cloud_apihub_v1_SearchResourcesResponse_descriptor = + getDescriptor().getMessageTypes().get(38); + internal_static_google_cloud_apihub_v1_SearchResourcesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_SearchResourcesResponse_descriptor, + new java.lang.String[] { + "SearchResults", "NextPageToken", + }); + internal_static_google_cloud_apihub_v1_CreateDependencyRequest_descriptor = + getDescriptor().getMessageTypes().get(39); + internal_static_google_cloud_apihub_v1_CreateDependencyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_CreateDependencyRequest_descriptor, + new java.lang.String[] { + "Parent", "DependencyId", "Dependency", + }); + internal_static_google_cloud_apihub_v1_GetDependencyRequest_descriptor = + getDescriptor().getMessageTypes().get(40); + internal_static_google_cloud_apihub_v1_GetDependencyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_GetDependencyRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_apihub_v1_UpdateDependencyRequest_descriptor = + getDescriptor().getMessageTypes().get(41); + internal_static_google_cloud_apihub_v1_UpdateDependencyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_UpdateDependencyRequest_descriptor, + new java.lang.String[] { + "Dependency", "UpdateMask", + }); + internal_static_google_cloud_apihub_v1_DeleteDependencyRequest_descriptor = + getDescriptor().getMessageTypes().get(42); + internal_static_google_cloud_apihub_v1_DeleteDependencyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_DeleteDependencyRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_apihub_v1_ListDependenciesRequest_descriptor = + getDescriptor().getMessageTypes().get(43); + internal_static_google_cloud_apihub_v1_ListDependenciesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_ListDependenciesRequest_descriptor, + new java.lang.String[] { + "Parent", "Filter", "PageSize", "PageToken", + }); + internal_static_google_cloud_apihub_v1_ListDependenciesResponse_descriptor = + getDescriptor().getMessageTypes().get(44); + internal_static_google_cloud_apihub_v1_ListDependenciesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_ListDependenciesResponse_descriptor, + new java.lang.String[] { + "Dependencies", "NextPageToken", + }); + internal_static_google_cloud_apihub_v1_CreateExternalApiRequest_descriptor = + getDescriptor().getMessageTypes().get(45); + internal_static_google_cloud_apihub_v1_CreateExternalApiRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_CreateExternalApiRequest_descriptor, + new java.lang.String[] { + "Parent", "ExternalApiId", "ExternalApi", + }); + internal_static_google_cloud_apihub_v1_GetExternalApiRequest_descriptor = + getDescriptor().getMessageTypes().get(46); + internal_static_google_cloud_apihub_v1_GetExternalApiRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_GetExternalApiRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_apihub_v1_UpdateExternalApiRequest_descriptor = + getDescriptor().getMessageTypes().get(47); + internal_static_google_cloud_apihub_v1_UpdateExternalApiRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_UpdateExternalApiRequest_descriptor, + new java.lang.String[] { + "ExternalApi", "UpdateMask", + }); + internal_static_google_cloud_apihub_v1_DeleteExternalApiRequest_descriptor = + getDescriptor().getMessageTypes().get(48); + internal_static_google_cloud_apihub_v1_DeleteExternalApiRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_DeleteExternalApiRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_apihub_v1_ListExternalApisRequest_descriptor = + getDescriptor().getMessageTypes().get(49); + internal_static_google_cloud_apihub_v1_ListExternalApisRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_ListExternalApisRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_apihub_v1_ListExternalApisResponse_descriptor = + getDescriptor().getMessageTypes().get(50); + internal_static_google_cloud_apihub_v1_ListExternalApisResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_ListExternalApisResponse_descriptor, + new java.lang.String[] { + "ExternalApis", "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.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.cloud.apihub.v1.CommonFieldsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiName.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiName.java new file mode 100644 index 000000000000..31a3b4c66937 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiName.java @@ -0,0 +1,216 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +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 ApiName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_API = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}/apis/{api}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String api; + + @Deprecated + protected ApiName() { + project = null; + location = null; + api = null; + } + + private ApiName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + api = Preconditions.checkNotNull(builder.getApi()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getApi() { + return api; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ApiName of(String project, String location, String api) { + return newBuilder().setProject(project).setLocation(location).setApi(api).build(); + } + + public static String format(String project, String location, String api) { + return newBuilder().setProject(project).setLocation(location).setApi(api).build().toString(); + } + + public static ApiName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_API.validatedMatch( + formattedString, "ApiName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("api")); + } + + 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 (ApiName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_API.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); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (api != null) { + fieldMapBuilder.put("api", api); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_API.instantiate("project", project, "location", location, "api", api); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + ApiName that = ((ApiName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.api, that.api); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(api); + return h; + } + + /** Builder for projects/{project}/locations/{location}/apis/{api}. */ + public static class Builder { + private String project; + private String location; + private String api; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getApi() { + return api; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setApi(String api) { + this.api = api; + return this; + } + + private Builder(ApiName apiName) { + this.project = apiName.project; + this.location = apiName.location; + this.api = apiName.api; + } + + public ApiName build() { + return new ApiName(this); + } + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiOperation.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiOperation.java new file mode 100644 index 000000000000..34583a659f45 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiOperation.java @@ -0,0 +1,2214 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * Represents an operation contained in an API version in the API Hub.
+ * An operation is added/updated/deleted in an API version when a new spec is
+ * added or an existing spec is updated/deleted in a version.
+ * Currently, an operation will be created only corresponding to OpenAPI spec as
+ * parsing is supported for OpenAPI spec.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ApiOperation} + */ +public final class ApiOperation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.ApiOperation) + ApiOperationOrBuilder { + private static final long serialVersionUID = 0L; + // Use ApiOperation.newBuilder() to construct. + private ApiOperation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ApiOperation() { + name_ = ""; + spec_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ApiOperation(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_ApiOperation_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 6: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_ApiOperation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ApiOperation.class, + com.google.cloud.apihub.v1.ApiOperation.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. The name of the operation.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+   * Identifier. The name of the operation.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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 SPEC_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object spec_ = ""; + /** + * + * + *
+   * Output only. The name of the spec from where the operation was parsed.
+   * Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * string spec = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The spec. + */ + @java.lang.Override + public java.lang.String getSpec() { + java.lang.Object ref = spec_; + 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(); + spec_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The name of the spec from where the operation was parsed.
+   * Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * string spec = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for spec. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSpecBytes() { + java.lang.Object ref = spec_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + spec_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DETAILS_FIELD_NUMBER = 3; + private com.google.cloud.apihub.v1.OperationDetails details_; + /** + * + * + *
+   * Output only. Operation details.
+   * 
+ * + * + * .google.cloud.apihub.v1.OperationDetails details = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the details field is set. + */ + @java.lang.Override + public boolean hasDetails() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. Operation details.
+   * 
+ * + * + * .google.cloud.apihub.v1.OperationDetails details = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The details. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.OperationDetails getDetails() { + return details_ == null + ? com.google.cloud.apihub.v1.OperationDetails.getDefaultInstance() + : details_; + } + /** + * + * + *
+   * Output only. Operation details.
+   * 
+ * + * + * .google.cloud.apihub.v1.OperationDetails details = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.OperationDetailsOrBuilder getDetailsOrBuilder() { + return details_ == null + ? com.google.cloud.apihub.v1.OperationDetails.getDefaultInstance() + : details_; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time at which the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Output only. The time at which the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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. The time at which the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The time at which the operation was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Output only. The time at which the operation was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.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 time at which the operation was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 6; + + private static final class AttributesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.apihub.v1.AttributeValues> + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_ApiOperation_AttributesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField + attributes_; + + private com.google.protobuf.MapField + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField(AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the API
+   * operation resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().getMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the API
+   * operation resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the API
+   * operation resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.apihub.v1.AttributeValues getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the API
+   * operation resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getAttributesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(spec_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, spec_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getDetails()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getCreateTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(5, getUpdateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAttributes(), AttributesDefaultEntryHolder.defaultEntry, 6); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(spec_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, spec_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getDetails()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); + } + for (java.util.Map.Entry entry : + internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry + attributes__ = + AttributesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, attributes__); + } + size += getUnknownFields().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.apihub.v1.ApiOperation)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.ApiOperation other = (com.google.cloud.apihub.v1.ApiOperation) obj; + + if (!getName().equals(other.getName())) return false; + if (!getSpec().equals(other.getSpec())) return false; + if (hasDetails() != other.hasDetails()) return false; + if (hasDetails()) { + if (!getDetails().equals(other.getDetails())) 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 (!internalGetAttributes().equals(other.internalGetAttributes())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SPEC_FIELD_NUMBER; + hash = (53 * hash) + getSpec().hashCode(); + if (hasDetails()) { + hash = (37 * hash) + DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getDetails().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 (!internalGetAttributes().getMap().isEmpty()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttributes().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.ApiOperation parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ApiOperation 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.apihub.v1.ApiOperation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ApiOperation 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.apihub.v1.ApiOperation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ApiOperation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.ApiOperation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ApiOperation 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.apihub.v1.ApiOperation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ApiOperation 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.apihub.v1.ApiOperation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ApiOperation 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.apihub.v1.ApiOperation 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; + } + /** + * + * + *
+   * Represents an operation contained in an API version in the API Hub.
+   * An operation is added/updated/deleted in an API version when a new spec is
+   * added or an existing spec is updated/deleted in a version.
+   * Currently, an operation will be created only corresponding to OpenAPI spec as
+   * parsing is supported for OpenAPI spec.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ApiOperation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.ApiOperation) + com.google.cloud.apihub.v1.ApiOperationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_ApiOperation_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 6: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 6: + return internalGetMutableAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_ApiOperation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ApiOperation.class, + com.google.cloud.apihub.v1.ApiOperation.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.ApiOperation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getDetailsFieldBuilder(); + getCreateTimeFieldBuilder(); + getUpdateTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + spec_ = ""; + details_ = null; + if (detailsBuilder_ != null) { + detailsBuilder_.dispose(); + detailsBuilder_ = null; + } + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + internalGetMutableAttributes().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_ApiOperation_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ApiOperation getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.ApiOperation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ApiOperation build() { + com.google.cloud.apihub.v1.ApiOperation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ApiOperation buildPartial() { + com.google.cloud.apihub.v1.ApiOperation result = + new com.google.cloud.apihub.v1.ApiOperation(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.ApiOperation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.spec_ = spec_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.details_ = detailsBuilder_ == null ? details_ : detailsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.attributes_ = + internalGetAttributes().build(AttributesDefaultEntryHolder.defaultEntry); + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.ApiOperation) { + return mergeFrom((com.google.cloud.apihub.v1.ApiOperation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.ApiOperation other) { + if (other == com.google.cloud.apihub.v1.ApiOperation.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getSpec().isEmpty()) { + spec_ = other.spec_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasDetails()) { + mergeDetails(other.getDetails()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + internalGetMutableAttributes().mergeFrom(other.internalGetAttributes()); + bitField0_ |= 0x00000020; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + spec_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getDetailsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.apihub.v1.AttributeValues> + attributes__ = + input.readMessage( + AttributesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAttributes() + .ensureBuilderMap() + .put(attributes__.getKey(), attributes__.getValue()); + bitField0_ |= 0x00000020; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. The name of the operation.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. The name of the operation.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. The name of the operation.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The name of the operation.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The name of the operation.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object spec_ = ""; + /** + * + * + *
+     * Output only. The name of the spec from where the operation was parsed.
+     * Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * string spec = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The spec. + */ + public java.lang.String getSpec() { + java.lang.Object ref = spec_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + spec_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The name of the spec from where the operation was parsed.
+     * Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * string spec = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for spec. + */ + public com.google.protobuf.ByteString getSpecBytes() { + java.lang.Object ref = spec_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + spec_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The name of the spec from where the operation was parsed.
+     * Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * string spec = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The spec to set. + * @return This builder for chaining. + */ + public Builder setSpec(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + spec_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the spec from where the operation was parsed.
+     * Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * string spec = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearSpec() { + spec_ = getDefaultInstance().getSpec(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the spec from where the operation was parsed.
+     * Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * string spec = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for spec to set. + * @return This builder for chaining. + */ + public Builder setSpecBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + spec_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.apihub.v1.OperationDetails details_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.OperationDetails, + com.google.cloud.apihub.v1.OperationDetails.Builder, + com.google.cloud.apihub.v1.OperationDetailsOrBuilder> + detailsBuilder_; + /** + * + * + *
+     * Output only. Operation details.
+     * 
+ * + * + * .google.cloud.apihub.v1.OperationDetails details = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the details field is set. + */ + public boolean hasDetails() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. Operation details.
+     * 
+ * + * + * .google.cloud.apihub.v1.OperationDetails details = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The details. + */ + public com.google.cloud.apihub.v1.OperationDetails getDetails() { + if (detailsBuilder_ == null) { + return details_ == null + ? com.google.cloud.apihub.v1.OperationDetails.getDefaultInstance() + : details_; + } else { + return detailsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Operation details.
+     * 
+ * + * + * .google.cloud.apihub.v1.OperationDetails details = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDetails(com.google.cloud.apihub.v1.OperationDetails value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + } else { + detailsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Operation details.
+     * 
+ * + * + * .google.cloud.apihub.v1.OperationDetails details = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDetails(com.google.cloud.apihub.v1.OperationDetails.Builder builderForValue) { + if (detailsBuilder_ == null) { + details_ = builderForValue.build(); + } else { + detailsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Operation details.
+     * 
+ * + * + * .google.cloud.apihub.v1.OperationDetails details = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeDetails(com.google.cloud.apihub.v1.OperationDetails value) { + if (detailsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && details_ != null + && details_ != com.google.cloud.apihub.v1.OperationDetails.getDefaultInstance()) { + getDetailsBuilder().mergeFrom(value); + } else { + details_ = value; + } + } else { + detailsBuilder_.mergeFrom(value); + } + if (details_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Operation details.
+     * 
+ * + * + * .google.cloud.apihub.v1.OperationDetails details = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDetails() { + bitField0_ = (bitField0_ & ~0x00000004); + details_ = null; + if (detailsBuilder_ != null) { + detailsBuilder_.dispose(); + detailsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Operation details.
+     * 
+ * + * + * .google.cloud.apihub.v1.OperationDetails details = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.apihub.v1.OperationDetails.Builder getDetailsBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getDetailsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Operation details.
+     * 
+ * + * + * .google.cloud.apihub.v1.OperationDetails details = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.apihub.v1.OperationDetailsOrBuilder getDetailsOrBuilder() { + if (detailsBuilder_ != null) { + return detailsBuilder_.getMessageOrBuilder(); + } else { + return details_ == null + ? com.google.cloud.apihub.v1.OperationDetails.getDefaultInstance() + : details_; + } + } + /** + * + * + *
+     * Output only. Operation details.
+     * 
+ * + * + * .google.cloud.apihub.v1.OperationDetails details = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.OperationDetails, + com.google.cloud.apihub.v1.OperationDetails.Builder, + com.google.cloud.apihub.v1.OperationDetailsOrBuilder> + getDetailsFieldBuilder() { + if (detailsBuilder_ == null) { + detailsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.OperationDetails, + com.google.cloud.apihub.v1.OperationDetails.Builder, + com.google.cloud.apihub.v1.OperationDetailsOrBuilder>( + getDetails(), getParentForChildren(), isClean()); + details_ = null; + } + return detailsBuilder_; + } + + 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. The time at which the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Output only. The time at which the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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. The time at which the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The time at which the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time at which the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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. The time at which the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 time at which the operation was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Output only. The time at which the operation was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.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 time at which the operation was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the operation was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the operation was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The time at which the operation was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000010); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the operation was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time at which the operation was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.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 time at which the operation was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_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> + 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 static final class AttributesConverter + implements com.google.protobuf.MapFieldBuilder.Converter< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues> { + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues build( + com.google.cloud.apihub.v1.AttributeValuesOrBuilder val) { + if (val instanceof com.google.cloud.apihub.v1.AttributeValues) { + return (com.google.cloud.apihub.v1.AttributeValues) val; + } + return ((com.google.cloud.apihub.v1.AttributeValues.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.apihub.v1.AttributeValues> + defaultEntry() { + return AttributesDefaultEntryHolder.defaultEntry; + } + }; + + private static final AttributesConverter attributesConverter = new AttributesConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder> + attributes_; + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder> + internalGetAttributes() { + if (attributes_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(attributesConverter); + } + return attributes_; + } + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder> + internalGetMutableAttributes() { + if (attributes_ == null) { + attributes_ = new com.google.protobuf.MapFieldBuilder<>(attributesConverter); + } + bitField0_ |= 0x00000020; + onChanged(); + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().ensureBuilderMap().size(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the API
+     * operation resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().ensureBuilderMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the API
+     * operation resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getImmutableMap(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the API
+     * operation resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.apihub.v1.AttributeValues getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableAttributes().ensureBuilderMap(); + return map.containsKey(key) ? attributesConverter.build(map.get(key)) : defaultValue; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the API
+     * operation resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getAttributesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableAttributes().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return attributesConverter.build(map.get(key)); + } + + public Builder clearAttributes() { + bitField0_ = (bitField0_ & ~0x00000020); + internalGetMutableAttributes().clear(); + return this; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the API
+     * operation resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAttributes().ensureBuilderMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableAttributes() { + bitField0_ |= 0x00000020; + return internalGetMutableAttributes().ensureMessageMap(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the API
+     * operation resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAttributes( + java.lang.String key, com.google.cloud.apihub.v1.AttributeValues value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAttributes().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00000020; + return this; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the API
+     * operation resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllAttributes( + java.util.Map values) { + for (java.util.Map.Entry e : + values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableAttributes().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00000020; + return this; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the API
+     * operation resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.AttributeValues.Builder putAttributesBuilderIfAbsent( + java.lang.String key) { + java.util.Map + builderMap = internalGetMutableAttributes().ensureBuilderMap(); + com.google.cloud.apihub.v1.AttributeValuesOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = com.google.cloud.apihub.v1.AttributeValues.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.cloud.apihub.v1.AttributeValues) { + entry = ((com.google.cloud.apihub.v1.AttributeValues) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.cloud.apihub.v1.AttributeValues.Builder) entry; + } + + @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.apihub.v1.ApiOperation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.ApiOperation) + private static final com.google.cloud.apihub.v1.ApiOperation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.ApiOperation(); + } + + public static com.google.cloud.apihub.v1.ApiOperation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ApiOperation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.ApiOperation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiOperationName.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiOperationName.java new file mode 100644 index 000000000000..cc05f516803b --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiOperationName.java @@ -0,0 +1,298 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +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 ApiOperationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_API_VERSION_OPERATION = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String api; + private final String version; + private final String operation; + + @Deprecated + protected ApiOperationName() { + project = null; + location = null; + api = null; + version = null; + operation = null; + } + + private ApiOperationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + api = Preconditions.checkNotNull(builder.getApi()); + version = Preconditions.checkNotNull(builder.getVersion()); + operation = Preconditions.checkNotNull(builder.getOperation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getApi() { + return api; + } + + public String getVersion() { + return version; + } + + public String getOperation() { + return operation; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ApiOperationName of( + String project, String location, String api, String version, String operation) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setApi(api) + .setVersion(version) + .setOperation(operation) + .build(); + } + + public static String format( + String project, String location, String api, String version, String operation) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setApi(api) + .setVersion(version) + .setOperation(operation) + .build() + .toString(); + } + + public static ApiOperationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_API_VERSION_OPERATION.validatedMatch( + formattedString, "ApiOperationName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("api"), + matchMap.get("version"), + matchMap.get("operation")); + } + + 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 (ApiOperationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_API_VERSION_OPERATION.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); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (api != null) { + fieldMapBuilder.put("api", api); + } + if (version != null) { + fieldMapBuilder.put("version", version); + } + if (operation != null) { + fieldMapBuilder.put("operation", operation); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_API_VERSION_OPERATION.instantiate( + "project", + project, + "location", + location, + "api", + api, + "version", + version, + "operation", + operation); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + ApiOperationName that = ((ApiOperationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.api, that.api) + && Objects.equals(this.version, that.version) + && Objects.equals(this.operation, that.operation); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(api); + h *= 1000003; + h ^= Objects.hashCode(version); + h *= 1000003; + h ^= Objects.hashCode(operation); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}. + */ + public static class Builder { + private String project; + private String location; + private String api; + private String version; + private String operation; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getApi() { + return api; + } + + public String getVersion() { + return version; + } + + public String getOperation() { + return operation; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setApi(String api) { + this.api = api; + return this; + } + + public Builder setVersion(String version) { + this.version = version; + return this; + } + + public Builder setOperation(String operation) { + this.operation = operation; + return this; + } + + private Builder(ApiOperationName apiOperationName) { + this.project = apiOperationName.project; + this.location = apiOperationName.location; + this.api = apiOperationName.api; + this.version = apiOperationName.version; + this.operation = apiOperationName.operation; + } + + public ApiOperationName build() { + return new ApiOperationName(this); + } + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiOperationOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiOperationOrBuilder.java new file mode 100644 index 000000000000..400fb36d88ec --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiOperationOrBuilder.java @@ -0,0 +1,290 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface ApiOperationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.ApiOperation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. The name of the operation.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. The name of the operation.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The name of the spec from where the operation was parsed.
+   * Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * string spec = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The spec. + */ + java.lang.String getSpec(); + /** + * + * + *
+   * Output only. The name of the spec from where the operation was parsed.
+   * Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * string spec = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for spec. + */ + com.google.protobuf.ByteString getSpecBytes(); + + /** + * + * + *
+   * Output only. Operation details.
+   * 
+ * + * + * .google.cloud.apihub.v1.OperationDetails details = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the details field is set. + */ + boolean hasDetails(); + /** + * + * + *
+   * Output only. Operation details.
+   * 
+ * + * + * .google.cloud.apihub.v1.OperationDetails details = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The details. + */ + com.google.cloud.apihub.v1.OperationDetails getDetails(); + /** + * + * + *
+   * Output only. Operation details.
+   * 
+ * + * + * .google.cloud.apihub.v1.OperationDetails details = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.apihub.v1.OperationDetailsOrBuilder getDetailsOrBuilder(); + + /** + * + * + *
+   * Output only. The time at which the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time at which the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time at which the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time at which the operation was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The time at which the operation was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The time at which the operation was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the API
+   * operation resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getAttributesCount(); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the API
+   * operation resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsAttributes(java.lang.String key); + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAttributes(); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the API
+   * operation resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getAttributesMap(); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the API
+   * operation resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues defaultValue); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the API
+   * operation resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.AttributeValues getAttributesOrThrow(java.lang.String key); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiOrBuilder.java new file mode 100644 index 000000000000..f337cb345bcd --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ApiOrBuilder.java @@ -0,0 +1,758 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface ApiOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.Api) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. The name of the API resource in the API Hub.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. The name of the API resource in the API Hub.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The display name of the API resource.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. The display name of the API resource.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Optional. The description of the API resource.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Optional. The description of the API resource.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Optional. The documentation for the API resource.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the documentation field is set. + */ + boolean hasDocumentation(); + /** + * + * + *
+   * Optional. The documentation for the API resource.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The documentation. + */ + com.google.cloud.apihub.v1.Documentation getDocumentation(); + /** + * + * + *
+   * Optional. The documentation for the API resource.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.DocumentationOrBuilder getDocumentationOrBuilder(); + + /** + * + * + *
+   * Optional. Owner details for the API resource.
+   * 
+ * + * .google.cloud.apihub.v1.Owner owner = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the owner field is set. + */ + boolean hasOwner(); + /** + * + * + *
+   * Optional. Owner details for the API resource.
+   * 
+ * + * .google.cloud.apihub.v1.Owner owner = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The owner. + */ + com.google.cloud.apihub.v1.Owner getOwner(); + /** + * + * + *
+   * Optional. Owner details for the API resource.
+   * 
+ * + * .google.cloud.apihub.v1.Owner owner = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + com.google.cloud.apihub.v1.OwnerOrBuilder getOwnerOrBuilder(); + + /** + * + * + *
+   * Output only. The list of versions present in an API resource.
+   * Note: An API resource can be associated with more than 1 version.
+   * Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * repeated string versions = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the versions. + */ + java.util.List getVersionsList(); + /** + * + * + *
+   * Output only. The list of versions present in an API resource.
+   * Note: An API resource can be associated with more than 1 version.
+   * Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * repeated string versions = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The count of versions. + */ + int getVersionsCount(); + /** + * + * + *
+   * Output only. The list of versions present in an API resource.
+   * Note: An API resource can be associated with more than 1 version.
+   * Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * repeated string versions = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The versions at the given index. + */ + java.lang.String getVersions(int index); + /** + * + * + *
+   * Output only. The list of versions present in an API resource.
+   * Note: An API resource can be associated with more than 1 version.
+   * Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * repeated string versions = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the versions at the given index. + */ + com.google.protobuf.ByteString getVersionsBytes(int index); + + /** + * + * + *
+   * Output only. The time at which the API resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time at which the API resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time at which the API resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time at which the API resource was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The time at which the API resource was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The time at which the API resource was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Optional. The target users for the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-target-user`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues target_user = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the targetUser field is set. + */ + boolean hasTargetUser(); + /** + * + * + *
+   * Optional. The target users for the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-target-user`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues target_user = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The targetUser. + */ + com.google.cloud.apihub.v1.AttributeValues getTargetUser(); + /** + * + * + *
+   * Optional. The target users for the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-target-user`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues target_user = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.AttributeValuesOrBuilder getTargetUserOrBuilder(); + + /** + * + * + *
+   * Optional. The team owning the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-team`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues team = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the team field is set. + */ + boolean hasTeam(); + /** + * + * + *
+   * Optional. The team owning the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-team`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues team = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The team. + */ + com.google.cloud.apihub.v1.AttributeValues getTeam(); + /** + * + * + *
+   * Optional. The team owning the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-team`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues team = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.AttributeValuesOrBuilder getTeamOrBuilder(); + + /** + * + * + *
+   * Optional. The business unit owning the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-business-unit`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues business_unit = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the businessUnit field is set. + */ + boolean hasBusinessUnit(); + /** + * + * + *
+   * Optional. The business unit owning the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-business-unit`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues business_unit = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The businessUnit. + */ + com.google.cloud.apihub.v1.AttributeValues getBusinessUnit(); + /** + * + * + *
+   * Optional. The business unit owning the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-business-unit`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues business_unit = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.AttributeValuesOrBuilder getBusinessUnitOrBuilder(); + + /** + * + * + *
+   * Optional. The maturity level of the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-maturity-level`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues maturity_level = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the maturityLevel field is set. + */ + boolean hasMaturityLevel(); + /** + * + * + *
+   * Optional. The maturity level of the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-maturity-level`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues maturity_level = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The maturityLevel. + */ + com.google.cloud.apihub.v1.AttributeValues getMaturityLevel(); + /** + * + * + *
+   * Optional. The maturity level of the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-maturity-level`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues maturity_level = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.AttributeValuesOrBuilder getMaturityLevelOrBuilder(); + + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the API
+   * resource. The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getAttributesCount(); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the API
+   * resource. The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsAttributes(java.lang.String key); + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAttributes(); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the API
+   * resource. The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getAttributesMap(); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the API
+   * resource. The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues defaultValue); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the API
+   * resource. The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.AttributeValues getAttributesOrThrow(java.lang.String key); + + /** + * + * + *
+   * Optional. The style of the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-api-style`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues api_style = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the apiStyle field is set. + */ + boolean hasApiStyle(); + /** + * + * + *
+   * Optional. The style of the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-api-style`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues api_style = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The apiStyle. + */ + com.google.cloud.apihub.v1.AttributeValues getApiStyle(); + /** + * + * + *
+   * Optional. The style of the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-api-style`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues api_style = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.AttributeValuesOrBuilder getApiStyleOrBuilder(); + + /** + * + * + *
+   * Optional. The selected version for an API resource.
+   * This can be used when special handling is needed on client side for
+   * particular version of the API. Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * string selected_version = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The selectedVersion. + */ + java.lang.String getSelectedVersion(); + /** + * + * + *
+   * Optional. The selected version for an API resource.
+   * This can be used when special handling is needed on client side for
+   * particular version of the API. Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * string selected_version = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for selectedVersion. + */ + com.google.protobuf.ByteString getSelectedVersionBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Attribute.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Attribute.java new file mode 100644 index 000000000000..e15b7653c596 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Attribute.java @@ -0,0 +1,4805 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * An attribute in the API Hub.
+ * An attribute is a name value pair which can be attached to different
+ * resources in the API hub based on the scope of the attribute. Attributes can
+ * either be pre-defined by the API Hub or created by users.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Attribute} + */ +public final class Attribute extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.Attribute) + AttributeOrBuilder { + private static final long serialVersionUID = 0L; + // Use Attribute.newBuilder() to construct. + private Attribute(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Attribute() { + name_ = ""; + displayName_ = ""; + description_ = ""; + definitionType_ = 0; + scope_ = 0; + dataType_ = 0; + allowedValues_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Attribute(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Attribute_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Attribute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Attribute.class, + com.google.cloud.apihub.v1.Attribute.Builder.class); + } + + /** + * + * + *
+   * Enumeration of attribute definition types.
+   * 
+ * + * Protobuf enum {@code google.cloud.apihub.v1.Attribute.DefinitionType} + */ + public enum DefinitionType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Attribute definition type unspecified.
+     * 
+ * + * DEFINITION_TYPE_UNSPECIFIED = 0; + */ + DEFINITION_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * The attribute is predefined by the API Hub. Note that only the list of
+     * allowed values can be updated in this case via UpdateAttribute method.
+     * 
+ * + * SYSTEM_DEFINED = 1; + */ + SYSTEM_DEFINED(1), + /** + * + * + *
+     * The attribute is defined by the user.
+     * 
+ * + * USER_DEFINED = 2; + */ + USER_DEFINED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Attribute definition type unspecified.
+     * 
+ * + * DEFINITION_TYPE_UNSPECIFIED = 0; + */ + public static final int DEFINITION_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The attribute is predefined by the API Hub. Note that only the list of
+     * allowed values can be updated in this case via UpdateAttribute method.
+     * 
+ * + * SYSTEM_DEFINED = 1; + */ + public static final int SYSTEM_DEFINED_VALUE = 1; + /** + * + * + *
+     * The attribute is defined by the user.
+     * 
+ * + * USER_DEFINED = 2; + */ + public static final int USER_DEFINED_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 DefinitionType 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 DefinitionType forNumber(int value) { + switch (value) { + case 0: + return DEFINITION_TYPE_UNSPECIFIED; + case 1: + return SYSTEM_DEFINED; + case 2: + return USER_DEFINED; + 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 DefinitionType findValueByNumber(int number) { + return DefinitionType.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.apihub.v1.Attribute.getDescriptor().getEnumTypes().get(0); + } + + private static final DefinitionType[] VALUES = values(); + + public static DefinitionType 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 DefinitionType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.apihub.v1.Attribute.DefinitionType) + } + + /** + * + * + *
+   * Enumeration for the scope of the attribute representing the resource in the
+   * API Hub to which the attribute can be linked.
+   * 
+ * + * Protobuf enum {@code google.cloud.apihub.v1.Attribute.Scope} + */ + public enum Scope implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Scope Unspecified.
+     * 
+ * + * SCOPE_UNSPECIFIED = 0; + */ + SCOPE_UNSPECIFIED(0), + /** + * + * + *
+     * Attribute can be linked to an API.
+     * 
+ * + * API = 1; + */ + API(1), + /** + * + * + *
+     * Attribute can be linked to an API version.
+     * 
+ * + * VERSION = 2; + */ + VERSION(2), + /** + * + * + *
+     * Attribute can be linked to a Spec.
+     * 
+ * + * SPEC = 3; + */ + SPEC(3), + /** + * + * + *
+     * Attribute can be linked to an API Operation.
+     * 
+ * + * API_OPERATION = 4; + */ + API_OPERATION(4), + /** + * + * + *
+     * Attribute can be linked to a Deployment.
+     * 
+ * + * DEPLOYMENT = 5; + */ + DEPLOYMENT(5), + /** + * + * + *
+     * Attribute can be linked to a Dependency.
+     * 
+ * + * DEPENDENCY = 6; + */ + DEPENDENCY(6), + /** + * + * + *
+     * Attribute can be linked to a definition.
+     * 
+ * + * DEFINITION = 7; + */ + DEFINITION(7), + /** + * + * + *
+     * Attribute can be linked to a ExternalAPI.
+     * 
+ * + * EXTERNAL_API = 8; + */ + EXTERNAL_API(8), + /** + * + * + *
+     * Attribute can be linked to a Plugin.
+     * 
+ * + * PLUGIN = 9; + */ + PLUGIN(9), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Scope Unspecified.
+     * 
+ * + * SCOPE_UNSPECIFIED = 0; + */ + public static final int SCOPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Attribute can be linked to an API.
+     * 
+ * + * API = 1; + */ + public static final int API_VALUE = 1; + /** + * + * + *
+     * Attribute can be linked to an API version.
+     * 
+ * + * VERSION = 2; + */ + public static final int VERSION_VALUE = 2; + /** + * + * + *
+     * Attribute can be linked to a Spec.
+     * 
+ * + * SPEC = 3; + */ + public static final int SPEC_VALUE = 3; + /** + * + * + *
+     * Attribute can be linked to an API Operation.
+     * 
+ * + * API_OPERATION = 4; + */ + public static final int API_OPERATION_VALUE = 4; + /** + * + * + *
+     * Attribute can be linked to a Deployment.
+     * 
+ * + * DEPLOYMENT = 5; + */ + public static final int DEPLOYMENT_VALUE = 5; + /** + * + * + *
+     * Attribute can be linked to a Dependency.
+     * 
+ * + * DEPENDENCY = 6; + */ + public static final int DEPENDENCY_VALUE = 6; + /** + * + * + *
+     * Attribute can be linked to a definition.
+     * 
+ * + * DEFINITION = 7; + */ + public static final int DEFINITION_VALUE = 7; + /** + * + * + *
+     * Attribute can be linked to a ExternalAPI.
+     * 
+ * + * EXTERNAL_API = 8; + */ + public static final int EXTERNAL_API_VALUE = 8; + /** + * + * + *
+     * Attribute can be linked to a Plugin.
+     * 
+ * + * PLUGIN = 9; + */ + public static final int PLUGIN_VALUE = 9; + + 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 Scope 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 Scope forNumber(int value) { + switch (value) { + case 0: + return SCOPE_UNSPECIFIED; + case 1: + return API; + case 2: + return VERSION; + case 3: + return SPEC; + case 4: + return API_OPERATION; + case 5: + return DEPLOYMENT; + case 6: + return DEPENDENCY; + case 7: + return DEFINITION; + case 8: + return EXTERNAL_API; + case 9: + return PLUGIN; + 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 Scope findValueByNumber(int number) { + return Scope.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.apihub.v1.Attribute.getDescriptor().getEnumTypes().get(1); + } + + private static final Scope[] VALUES = values(); + + public static Scope 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 Scope(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.apihub.v1.Attribute.Scope) + } + + /** + * + * + *
+   * Enumeration of attribute's data type.
+   * 
+ * + * Protobuf enum {@code google.cloud.apihub.v1.Attribute.DataType} + */ + public enum DataType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Attribute data type unspecified.
+     * 
+ * + * DATA_TYPE_UNSPECIFIED = 0; + */ + DATA_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Attribute's value is of type enum.
+     * 
+ * + * ENUM = 1; + */ + ENUM(1), + /** + * + * + *
+     * Attribute's value is of type json.
+     * 
+ * + * JSON = 2; + */ + JSON(2), + /** + * + * + *
+     * Attribute's value is of type string.
+     * 
+ * + * STRING = 3; + */ + STRING(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Attribute data type unspecified.
+     * 
+ * + * DATA_TYPE_UNSPECIFIED = 0; + */ + public static final int DATA_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Attribute's value is of type enum.
+     * 
+ * + * ENUM = 1; + */ + public static final int ENUM_VALUE = 1; + /** + * + * + *
+     * Attribute's value is of type json.
+     * 
+ * + * JSON = 2; + */ + public static final int JSON_VALUE = 2; + /** + * + * + *
+     * Attribute's value is of type string.
+     * 
+ * + * STRING = 3; + */ + public static final int STRING_VALUE = 3; + + 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 DataType 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 DataType forNumber(int value) { + switch (value) { + case 0: + return DATA_TYPE_UNSPECIFIED; + case 1: + return ENUM; + case 2: + return JSON; + case 3: + return STRING; + 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 DataType findValueByNumber(int number) { + return DataType.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.apihub.v1.Attribute.getDescriptor().getEnumTypes().get(2); + } + + private static final DataType[] VALUES = values(); + + public static DataType 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 DataType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.apihub.v1.Attribute.DataType) + } + + public interface AllowedValueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.Attribute.AllowedValue) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The ID of the allowed value.
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another allowed value in the same
+     * attribute resource.
+     * * If not provided, a system generated id derived from the display name
+     * will be used. In this case, the service will handle conflict resolution
+     * by adding a system generated suffix in case of duplicates.
+     *
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+     * Required. The ID of the allowed value.
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another allowed value in the same
+     * attribute resource.
+     * * If not provided, a system generated id derived from the display name
+     * will be used. In this case, the service will handle conflict resolution
+     * by adding a system generated suffix in case of duplicates.
+     *
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+     * Required. The display name of the allowed value.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+     * Required. The display name of the allowed value.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+     * Optional. The detailed description of the allowed value.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+     * Optional. The detailed description of the allowed value.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+     * Optional. When set to true, the allowed value cannot be updated or
+     * deleted by the user. It can only be true for System defined attributes.
+     * 
+ * + * bool immutable = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The immutable. + */ + boolean getImmutable(); + } + /** + * + * + *
+   * The value that can be assigned to the attribute when the data type is
+   * enum.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Attribute.AllowedValue} + */ + public static final class AllowedValue extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.Attribute.AllowedValue) + AllowedValueOrBuilder { + private static final long serialVersionUID = 0L; + // Use AllowedValue.newBuilder() to construct. + private AllowedValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AllowedValue() { + id_ = ""; + displayName_ = ""; + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AllowedValue(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Attribute_AllowedValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Attribute_AllowedValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Attribute.AllowedValue.class, + com.google.cloud.apihub.v1.Attribute.AllowedValue.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + * + * + *
+     * Required. The ID of the allowed value.
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another allowed value in the same
+     * attribute resource.
+     * * If not provided, a system generated id derived from the display name
+     * will be used. In this case, the service will handle conflict resolution
+     * by adding a system generated suffix in case of duplicates.
+     *
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + * + * + *
+     * Required. The ID of the allowed value.
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another allowed value in the same
+     * attribute resource.
+     * * If not provided, a system generated id derived from the display name
+     * will be used. In this case, the service will handle conflict resolution
+     * by adding a system generated suffix in case of duplicates.
+     *
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Required. The display name of the allowed value.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. The display name of the allowed value.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 DESCRIPTION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+     * Optional. The detailed description of the allowed value.
+     * 
+ * + * string description = 3 [(.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. The detailed description of the allowed value.
+     * 
+ * + * string description = 3 [(.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 IMMUTABLE_FIELD_NUMBER = 4; + private boolean immutable_ = false; + /** + * + * + *
+     * Optional. When set to true, the allowed value cannot be updated or
+     * deleted by the user. It can only be true for System defined attributes.
+     * 
+ * + * bool immutable = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The immutable. + */ + @java.lang.Override + public boolean getImmutable() { + return immutable_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (immutable_ != false) { + output.writeBool(4, immutable_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (immutable_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, immutable_); + } + size += getUnknownFields().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.apihub.v1.Attribute.AllowedValue)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.Attribute.AllowedValue other = + (com.google.cloud.apihub.v1.Attribute.AllowedValue) obj; + + if (!getId().equals(other.getId())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (getImmutable() != other.getImmutable()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + IMMUTABLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getImmutable()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.Attribute.AllowedValue parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Attribute.AllowedValue 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.apihub.v1.Attribute.AllowedValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Attribute.AllowedValue 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.apihub.v1.Attribute.AllowedValue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Attribute.AllowedValue parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.Attribute.AllowedValue parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Attribute.AllowedValue 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.apihub.v1.Attribute.AllowedValue parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Attribute.AllowedValue 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.apihub.v1.Attribute.AllowedValue parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Attribute.AllowedValue 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.apihub.v1.Attribute.AllowedValue 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 value that can be assigned to the attribute when the data type is
+     * enum.
+     * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Attribute.AllowedValue} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.Attribute.AllowedValue) + com.google.cloud.apihub.v1.Attribute.AllowedValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Attribute_AllowedValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Attribute_AllowedValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Attribute.AllowedValue.class, + com.google.cloud.apihub.v1.Attribute.AllowedValue.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.Attribute.AllowedValue.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = ""; + displayName_ = ""; + description_ = ""; + immutable_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Attribute_AllowedValue_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Attribute.AllowedValue getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.Attribute.AllowedValue.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Attribute.AllowedValue build() { + com.google.cloud.apihub.v1.Attribute.AllowedValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Attribute.AllowedValue buildPartial() { + com.google.cloud.apihub.v1.Attribute.AllowedValue result = + new com.google.cloud.apihub.v1.Attribute.AllowedValue(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.Attribute.AllowedValue result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.immutable_ = immutable_; + } + } + + @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.apihub.v1.Attribute.AllowedValue) { + return mergeFrom((com.google.cloud.apihub.v1.Attribute.AllowedValue) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.Attribute.AllowedValue other) { + if (other == com.google.cloud.apihub.v1.Attribute.AllowedValue.getDefaultInstance()) + return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getImmutable() != false) { + setImmutable(other.getImmutable()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + immutable_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object id_ = ""; + /** + * + * + *
+       * Required. The ID of the allowed value.
+       * * If provided, the same will be used. The service will throw an error if
+       * the specified id is already used by another allowed value in the same
+       * attribute resource.
+       * * If not provided, a system generated id derived from the display name
+       * will be used. In this case, the service will handle conflict resolution
+       * by adding a system generated suffix in case of duplicates.
+       *
+       * This value should be 4-63 characters, and valid characters
+       * are /[a-z][0-9]-/.
+       * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Required. The ID of the allowed value.
+       * * If provided, the same will be used. The service will throw an error if
+       * the specified id is already used by another allowed value in the same
+       * attribute resource.
+       * * If not provided, a system generated id derived from the display name
+       * will be used. In this case, the service will handle conflict resolution
+       * by adding a system generated suffix in case of duplicates.
+       *
+       * This value should be 4-63 characters, and valid characters
+       * are /[a-z][0-9]-/.
+       * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Required. The ID of the allowed value.
+       * * If provided, the same will be used. The service will throw an error if
+       * the specified id is already used by another allowed value in the same
+       * attribute resource.
+       * * If not provided, a system generated id derived from the display name
+       * will be used. In this case, the service will handle conflict resolution
+       * by adding a system generated suffix in case of duplicates.
+       *
+       * This value should be 4-63 characters, and valid characters
+       * are /[a-z][0-9]-/.
+       * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The ID of the allowed value.
+       * * If provided, the same will be used. The service will throw an error if
+       * the specified id is already used by another allowed value in the same
+       * attribute resource.
+       * * If not provided, a system generated id derived from the display name
+       * will be used. In this case, the service will handle conflict resolution
+       * by adding a system generated suffix in case of duplicates.
+       *
+       * This value should be 4-63 characters, and valid characters
+       * are /[a-z][0-9]-/.
+       * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The ID of the allowed value.
+       * * If provided, the same will be used. The service will throw an error if
+       * the specified id is already used by another allowed value in the same
+       * attribute resource.
+       * * If not provided, a system generated id derived from the display name
+       * will be used. In this case, the service will handle conflict resolution
+       * by adding a system generated suffix in case of duplicates.
+       *
+       * This value should be 4-63 characters, and valid characters
+       * are /[a-z][0-9]-/.
+       * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+       * Required. The display name of the allowed value.
+       * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+       * Required. The display name of the allowed value.
+       * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+       * Required. The display name of the allowed value.
+       * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The display name of the allowed value.
+       * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The display name of the allowed value.
+       * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+       * Optional. The detailed description of the allowed value.
+       * 
+ * + * string description = 3 [(.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. The detailed description of the allowed value.
+       * 
+ * + * string description = 3 [(.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. The detailed description of the allowed value.
+       * 
+ * + * string description = 3 [(.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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. The detailed description of the allowed value.
+       * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. The detailed description of the allowed value.
+       * 
+ * + * string description = 3 [(.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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean immutable_; + /** + * + * + *
+       * Optional. When set to true, the allowed value cannot be updated or
+       * deleted by the user. It can only be true for System defined attributes.
+       * 
+ * + * bool immutable = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The immutable. + */ + @java.lang.Override + public boolean getImmutable() { + return immutable_; + } + /** + * + * + *
+       * Optional. When set to true, the allowed value cannot be updated or
+       * deleted by the user. It can only be true for System defined attributes.
+       * 
+ * + * bool immutable = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The immutable to set. + * @return This builder for chaining. + */ + public Builder setImmutable(boolean value) { + + immutable_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. When set to true, the allowed value cannot be updated or
+       * deleted by the user. It can only be true for System defined attributes.
+       * 
+ * + * bool immutable = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearImmutable() { + bitField0_ = (bitField0_ & ~0x00000008); + immutable_ = 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.apihub.v1.Attribute.AllowedValue) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.Attribute.AllowedValue) + private static final com.google.cloud.apihub.v1.Attribute.AllowedValue DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.Attribute.AllowedValue(); + } + + public static com.google.cloud.apihub.v1.Attribute.AllowedValue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AllowedValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.Attribute.AllowedValue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. The name of the attribute in the API Hub.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+   * Identifier. The name of the attribute in the API Hub.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * Required. The display name of the attribute.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+   * Required. The display name of the attribute.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 DESCRIPTION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * Optional. The description of the attribute.
+   * 
+ * + * string description = 3 [(.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. The description of the attribute.
+   * 
+ * + * string description = 3 [(.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 DEFINITION_TYPE_FIELD_NUMBER = 4; + private int definitionType_ = 0; + /** + * + * + *
+   * Output only. The definition type of the attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.Attribute.DefinitionType definition_type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for definitionType. + */ + @java.lang.Override + public int getDefinitionTypeValue() { + return definitionType_; + } + /** + * + * + *
+   * Output only. The definition type of the attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.Attribute.DefinitionType definition_type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The definitionType. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Attribute.DefinitionType getDefinitionType() { + com.google.cloud.apihub.v1.Attribute.DefinitionType result = + com.google.cloud.apihub.v1.Attribute.DefinitionType.forNumber(definitionType_); + return result == null + ? com.google.cloud.apihub.v1.Attribute.DefinitionType.UNRECOGNIZED + : result; + } + + public static final int SCOPE_FIELD_NUMBER = 5; + private int scope_ = 0; + /** + * + * + *
+   * Required. The scope of the attribute. It represents the resource in the API
+   * Hub to which the attribute can be linked.
+   * 
+ * + * + * .google.cloud.apihub.v1.Attribute.Scope scope = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for scope. + */ + @java.lang.Override + public int getScopeValue() { + return scope_; + } + /** + * + * + *
+   * Required. The scope of the attribute. It represents the resource in the API
+   * Hub to which the attribute can be linked.
+   * 
+ * + * + * .google.cloud.apihub.v1.Attribute.Scope scope = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The scope. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Attribute.Scope getScope() { + com.google.cloud.apihub.v1.Attribute.Scope result = + com.google.cloud.apihub.v1.Attribute.Scope.forNumber(scope_); + return result == null ? com.google.cloud.apihub.v1.Attribute.Scope.UNRECOGNIZED : result; + } + + public static final int DATA_TYPE_FIELD_NUMBER = 6; + private int dataType_ = 0; + /** + * + * + *
+   * Required. The type of the data of the attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.Attribute.DataType data_type = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for dataType. + */ + @java.lang.Override + public int getDataTypeValue() { + return dataType_; + } + /** + * + * + *
+   * Required. The type of the data of the attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.Attribute.DataType data_type = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dataType. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Attribute.DataType getDataType() { + com.google.cloud.apihub.v1.Attribute.DataType result = + com.google.cloud.apihub.v1.Attribute.DataType.forNumber(dataType_); + return result == null ? com.google.cloud.apihub.v1.Attribute.DataType.UNRECOGNIZED : result; + } + + public static final int ALLOWED_VALUES_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private java.util.List allowedValues_; + /** + * + * + *
+   * Optional. The list of allowed values when the attribute value is of type
+   * enum. This is required when the data_type of the attribute is ENUM. The
+   * maximum number of allowed values of an attribute will be 1000.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List getAllowedValuesList() { + return allowedValues_; + } + /** + * + * + *
+   * Optional. The list of allowed values when the attribute value is of type
+   * enum. This is required when the data_type of the attribute is ENUM. The
+   * maximum number of allowed values of an attribute will be 1000.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getAllowedValuesOrBuilderList() { + return allowedValues_; + } + /** + * + * + *
+   * Optional. The list of allowed values when the attribute value is of type
+   * enum. This is required when the data_type of the attribute is ENUM. The
+   * maximum number of allowed values of an attribute will be 1000.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getAllowedValuesCount() { + return allowedValues_.size(); + } + /** + * + * + *
+   * Optional. The list of allowed values when the attribute value is of type
+   * enum. This is required when the data_type of the attribute is ENUM. The
+   * maximum number of allowed values of an attribute will be 1000.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Attribute.AllowedValue getAllowedValues(int index) { + return allowedValues_.get(index); + } + /** + * + * + *
+   * Optional. The list of allowed values when the attribute value is of type
+   * enum. This is required when the data_type of the attribute is ENUM. The
+   * maximum number of allowed values of an attribute will be 1000.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Attribute.AllowedValueOrBuilder getAllowedValuesOrBuilder( + int index) { + return allowedValues_.get(index); + } + + public static final int CARDINALITY_FIELD_NUMBER = 8; + private int cardinality_ = 0; + /** + * + * + *
+   * Optional. The maximum number of values that the attribute can have when
+   * associated with an API Hub resource. Cardinality 1 would represent a
+   * single-valued attribute. It must not be less than 1 or greater than 20. If
+   * not specified, the cardinality would be set to 1 by default and represent a
+   * single-valued attribute.
+   * 
+ * + * int32 cardinality = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The cardinality. + */ + @java.lang.Override + public int getCardinality() { + return cardinality_; + } + + public static final int MANDATORY_FIELD_NUMBER = 9; + private boolean mandatory_ = false; + /** + * + * + *
+   * Output only. When mandatory is true, the attribute is mandatory for the
+   * resource specified in the scope. Only System defined attributes can be
+   * mandatory.
+   * 
+ * + * bool mandatory = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The mandatory. + */ + @java.lang.Override + public boolean getMandatory() { + return mandatory_; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 10; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time at which the attribute was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. The time at which the attribute was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 10 [(.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. The time at which the attribute was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 11; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The time at which the attribute was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Output only. The time at which the attribute was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 11 [(.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 time at which the attribute was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (definitionType_ + != com.google.cloud.apihub.v1.Attribute.DefinitionType.DEFINITION_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, definitionType_); + } + if (scope_ != com.google.cloud.apihub.v1.Attribute.Scope.SCOPE_UNSPECIFIED.getNumber()) { + output.writeEnum(5, scope_); + } + if (dataType_ + != com.google.cloud.apihub.v1.Attribute.DataType.DATA_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(6, dataType_); + } + for (int i = 0; i < allowedValues_.size(); i++) { + output.writeMessage(7, allowedValues_.get(i)); + } + if (cardinality_ != 0) { + output.writeInt32(8, cardinality_); + } + if (mandatory_ != false) { + output.writeBool(9, mandatory_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(10, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(11, getUpdateTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (definitionType_ + != com.google.cloud.apihub.v1.Attribute.DefinitionType.DEFINITION_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, definitionType_); + } + if (scope_ != com.google.cloud.apihub.v1.Attribute.Scope.SCOPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, scope_); + } + if (dataType_ + != com.google.cloud.apihub.v1.Attribute.DataType.DATA_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, dataType_); + } + for (int i = 0; i < allowedValues_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, allowedValues_.get(i)); + } + if (cardinality_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(8, cardinality_); + } + if (mandatory_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(9, mandatory_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getUpdateTime()); + } + size += getUnknownFields().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.apihub.v1.Attribute)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.Attribute other = (com.google.cloud.apihub.v1.Attribute) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (definitionType_ != other.definitionType_) return false; + if (scope_ != other.scope_) return false; + if (dataType_ != other.dataType_) return false; + if (!getAllowedValuesList().equals(other.getAllowedValuesList())) return false; + if (getCardinality() != other.getCardinality()) return false; + if (getMandatory() != other.getMandatory()) 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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + DEFINITION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + definitionType_; + hash = (37 * hash) + SCOPE_FIELD_NUMBER; + hash = (53 * hash) + scope_; + hash = (37 * hash) + DATA_TYPE_FIELD_NUMBER; + hash = (53 * hash) + dataType_; + if (getAllowedValuesCount() > 0) { + hash = (37 * hash) + ALLOWED_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getAllowedValuesList().hashCode(); + } + hash = (37 * hash) + CARDINALITY_FIELD_NUMBER; + hash = (53 * hash) + getCardinality(); + hash = (37 * hash) + MANDATORY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getMandatory()); + 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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.Attribute parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Attribute 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.apihub.v1.Attribute parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Attribute 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.apihub.v1.Attribute parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Attribute parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.Attribute parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Attribute 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.apihub.v1.Attribute parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Attribute 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.apihub.v1.Attribute parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Attribute 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.apihub.v1.Attribute 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; + } + /** + * + * + *
+   * An attribute in the API Hub.
+   * An attribute is a name value pair which can be attached to different
+   * resources in the API hub based on the scope of the attribute. Attributes can
+   * either be pre-defined by the API Hub or created by users.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Attribute} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.Attribute) + com.google.cloud.apihub.v1.AttributeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Attribute_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Attribute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Attribute.class, + com.google.cloud.apihub.v1.Attribute.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.Attribute.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAllowedValuesFieldBuilder(); + getCreateTimeFieldBuilder(); + getUpdateTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + description_ = ""; + definitionType_ = 0; + scope_ = 0; + dataType_ = 0; + if (allowedValuesBuilder_ == null) { + allowedValues_ = java.util.Collections.emptyList(); + } else { + allowedValues_ = null; + allowedValuesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000040); + cardinality_ = 0; + mandatory_ = false; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Attribute_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Attribute getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.Attribute.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Attribute build() { + com.google.cloud.apihub.v1.Attribute result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Attribute buildPartial() { + com.google.cloud.apihub.v1.Attribute result = new com.google.cloud.apihub.v1.Attribute(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.apihub.v1.Attribute result) { + if (allowedValuesBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0)) { + allowedValues_ = java.util.Collections.unmodifiableList(allowedValues_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.allowedValues_ = allowedValues_; + } else { + result.allowedValues_ = allowedValuesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.apihub.v1.Attribute result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.definitionType_ = definitionType_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.scope_ = scope_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.dataType_ = dataType_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.cardinality_ = cardinality_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.mandatory_ = mandatory_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000200) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.Attribute) { + return mergeFrom((com.google.cloud.apihub.v1.Attribute) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.Attribute other) { + if (other == com.google.cloud.apihub.v1.Attribute.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.definitionType_ != 0) { + setDefinitionTypeValue(other.getDefinitionTypeValue()); + } + if (other.scope_ != 0) { + setScopeValue(other.getScopeValue()); + } + if (other.dataType_ != 0) { + setDataTypeValue(other.getDataTypeValue()); + } + if (allowedValuesBuilder_ == null) { + if (!other.allowedValues_.isEmpty()) { + if (allowedValues_.isEmpty()) { + allowedValues_ = other.allowedValues_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureAllowedValuesIsMutable(); + allowedValues_.addAll(other.allowedValues_); + } + onChanged(); + } + } else { + if (!other.allowedValues_.isEmpty()) { + if (allowedValuesBuilder_.isEmpty()) { + allowedValuesBuilder_.dispose(); + allowedValuesBuilder_ = null; + allowedValues_ = other.allowedValues_; + bitField0_ = (bitField0_ & ~0x00000040); + allowedValuesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAllowedValuesFieldBuilder() + : null; + } else { + allowedValuesBuilder_.addAllMessages(other.allowedValues_); + } + } + } + if (other.getCardinality() != 0) { + setCardinality(other.getCardinality()); + } + if (other.getMandatory() != false) { + setMandatory(other.getMandatory()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + definitionType_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + scope_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: + { + dataType_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: + { + com.google.cloud.apihub.v1.Attribute.AllowedValue m = + input.readMessage( + com.google.cloud.apihub.v1.Attribute.AllowedValue.parser(), + extensionRegistry); + if (allowedValuesBuilder_ == null) { + ensureAllowedValuesIsMutable(); + allowedValues_.add(m); + } else { + allowedValuesBuilder_.addMessage(m); + } + break; + } // case 58 + case 64: + { + cardinality_ = input.readInt32(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: + { + mandatory_ = input.readBool(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 82: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 90: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 90 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. The name of the attribute in the API Hub.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. The name of the attribute in the API Hub.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. The name of the attribute in the API Hub.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The name of the attribute in the API Hub.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The name of the attribute in the API Hub.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Required. The display name of the attribute.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. The display name of the attribute.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. The display name of the attribute.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The display name of the attribute.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The display name of the attribute.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Optional. The description of the attribute.
+     * 
+ * + * string description = 3 [(.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. The description of the attribute.
+     * 
+ * + * string description = 3 [(.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. The description of the attribute.
+     * 
+ * + * string description = 3 [(.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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The description of the attribute.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The description of the attribute.
+     * 
+ * + * string description = 3 [(.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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int definitionType_ = 0; + /** + * + * + *
+     * Output only. The definition type of the attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute.DefinitionType definition_type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for definitionType. + */ + @java.lang.Override + public int getDefinitionTypeValue() { + return definitionType_; + } + /** + * + * + *
+     * Output only. The definition type of the attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute.DefinitionType definition_type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for definitionType to set. + * @return This builder for chaining. + */ + public Builder setDefinitionTypeValue(int value) { + definitionType_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The definition type of the attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute.DefinitionType definition_type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The definitionType. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Attribute.DefinitionType getDefinitionType() { + com.google.cloud.apihub.v1.Attribute.DefinitionType result = + com.google.cloud.apihub.v1.Attribute.DefinitionType.forNumber(definitionType_); + return result == null + ? com.google.cloud.apihub.v1.Attribute.DefinitionType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The definition type of the attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute.DefinitionType definition_type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The definitionType to set. + * @return This builder for chaining. + */ + public Builder setDefinitionType(com.google.cloud.apihub.v1.Attribute.DefinitionType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + definitionType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The definition type of the attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute.DefinitionType definition_type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearDefinitionType() { + bitField0_ = (bitField0_ & ~0x00000008); + definitionType_ = 0; + onChanged(); + return this; + } + + private int scope_ = 0; + /** + * + * + *
+     * Required. The scope of the attribute. It represents the resource in the API
+     * Hub to which the attribute can be linked.
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute.Scope scope = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for scope. + */ + @java.lang.Override + public int getScopeValue() { + return scope_; + } + /** + * + * + *
+     * Required. The scope of the attribute. It represents the resource in the API
+     * Hub to which the attribute can be linked.
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute.Scope scope = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for scope to set. + * @return This builder for chaining. + */ + public Builder setScopeValue(int value) { + scope_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The scope of the attribute. It represents the resource in the API
+     * Hub to which the attribute can be linked.
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute.Scope scope = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The scope. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Attribute.Scope getScope() { + com.google.cloud.apihub.v1.Attribute.Scope result = + com.google.cloud.apihub.v1.Attribute.Scope.forNumber(scope_); + return result == null ? com.google.cloud.apihub.v1.Attribute.Scope.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Required. The scope of the attribute. It represents the resource in the API
+     * Hub to which the attribute can be linked.
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute.Scope scope = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The scope to set. + * @return This builder for chaining. + */ + public Builder setScope(com.google.cloud.apihub.v1.Attribute.Scope value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + scope_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The scope of the attribute. It represents the resource in the API
+     * Hub to which the attribute can be linked.
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute.Scope scope = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearScope() { + bitField0_ = (bitField0_ & ~0x00000010); + scope_ = 0; + onChanged(); + return this; + } + + private int dataType_ = 0; + /** + * + * + *
+     * Required. The type of the data of the attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute.DataType data_type = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for dataType. + */ + @java.lang.Override + public int getDataTypeValue() { + return dataType_; + } + /** + * + * + *
+     * Required. The type of the data of the attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute.DataType data_type = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for dataType to set. + * @return This builder for chaining. + */ + public Builder setDataTypeValue(int value) { + dataType_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of the data of the attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute.DataType data_type = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dataType. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Attribute.DataType getDataType() { + com.google.cloud.apihub.v1.Attribute.DataType result = + com.google.cloud.apihub.v1.Attribute.DataType.forNumber(dataType_); + return result == null ? com.google.cloud.apihub.v1.Attribute.DataType.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Required. The type of the data of the attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute.DataType data_type = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The dataType to set. + * @return This builder for chaining. + */ + public Builder setDataType(com.google.cloud.apihub.v1.Attribute.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + dataType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of the data of the attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute.DataType data_type = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearDataType() { + bitField0_ = (bitField0_ & ~0x00000020); + dataType_ = 0; + onChanged(); + return this; + } + + private java.util.List allowedValues_ = + java.util.Collections.emptyList(); + + private void ensureAllowedValuesIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + allowedValues_ = + new java.util.ArrayList( + allowedValues_); + bitField0_ |= 0x00000040; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.Attribute.AllowedValue, + com.google.cloud.apihub.v1.Attribute.AllowedValue.Builder, + com.google.cloud.apihub.v1.Attribute.AllowedValueOrBuilder> + allowedValuesBuilder_; + + /** + * + * + *
+     * Optional. The list of allowed values when the attribute value is of type
+     * enum. This is required when the data_type of the attribute is ENUM. The
+     * maximum number of allowed values of an attribute will be 1000.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getAllowedValuesList() { + if (allowedValuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(allowedValues_); + } else { + return allowedValuesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Optional. The list of allowed values when the attribute value is of type
+     * enum. This is required when the data_type of the attribute is ENUM. The
+     * maximum number of allowed values of an attribute will be 1000.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getAllowedValuesCount() { + if (allowedValuesBuilder_ == null) { + return allowedValues_.size(); + } else { + return allowedValuesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Optional. The list of allowed values when the attribute value is of type
+     * enum. This is required when the data_type of the attribute is ENUM. The
+     * maximum number of allowed values of an attribute will be 1000.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.Attribute.AllowedValue getAllowedValues(int index) { + if (allowedValuesBuilder_ == null) { + return allowedValues_.get(index); + } else { + return allowedValuesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Optional. The list of allowed values when the attribute value is of type
+     * enum. This is required when the data_type of the attribute is ENUM. The
+     * maximum number of allowed values of an attribute will be 1000.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setAllowedValues( + int index, com.google.cloud.apihub.v1.Attribute.AllowedValue value) { + if (allowedValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedValuesIsMutable(); + allowedValues_.set(index, value); + onChanged(); + } else { + allowedValuesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. The list of allowed values when the attribute value is of type
+     * enum. This is required when the data_type of the attribute is ENUM. The
+     * maximum number of allowed values of an attribute will be 1000.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setAllowedValues( + int index, com.google.cloud.apihub.v1.Attribute.AllowedValue.Builder builderForValue) { + if (allowedValuesBuilder_ == null) { + ensureAllowedValuesIsMutable(); + allowedValues_.set(index, builderForValue.build()); + onChanged(); + } else { + allowedValuesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. The list of allowed values when the attribute value is of type
+     * enum. This is required when the data_type of the attribute is ENUM. The
+     * maximum number of allowed values of an attribute will be 1000.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllowedValues(com.google.cloud.apihub.v1.Attribute.AllowedValue value) { + if (allowedValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedValuesIsMutable(); + allowedValues_.add(value); + onChanged(); + } else { + allowedValuesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Optional. The list of allowed values when the attribute value is of type
+     * enum. This is required when the data_type of the attribute is ENUM. The
+     * maximum number of allowed values of an attribute will be 1000.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllowedValues( + int index, com.google.cloud.apihub.v1.Attribute.AllowedValue value) { + if (allowedValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedValuesIsMutable(); + allowedValues_.add(index, value); + onChanged(); + } else { + allowedValuesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. The list of allowed values when the attribute value is of type
+     * enum. This is required when the data_type of the attribute is ENUM. The
+     * maximum number of allowed values of an attribute will be 1000.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllowedValues( + com.google.cloud.apihub.v1.Attribute.AllowedValue.Builder builderForValue) { + if (allowedValuesBuilder_ == null) { + ensureAllowedValuesIsMutable(); + allowedValues_.add(builderForValue.build()); + onChanged(); + } else { + allowedValuesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. The list of allowed values when the attribute value is of type
+     * enum. This is required when the data_type of the attribute is ENUM. The
+     * maximum number of allowed values of an attribute will be 1000.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllowedValues( + int index, com.google.cloud.apihub.v1.Attribute.AllowedValue.Builder builderForValue) { + if (allowedValuesBuilder_ == null) { + ensureAllowedValuesIsMutable(); + allowedValues_.add(index, builderForValue.build()); + onChanged(); + } else { + allowedValuesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. The list of allowed values when the attribute value is of type
+     * enum. This is required when the data_type of the attribute is ENUM. The
+     * maximum number of allowed values of an attribute will be 1000.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllAllowedValues( + java.lang.Iterable values) { + if (allowedValuesBuilder_ == null) { + ensureAllowedValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedValues_); + onChanged(); + } else { + allowedValuesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Optional. The list of allowed values when the attribute value is of type
+     * enum. This is required when the data_type of the attribute is ENUM. The
+     * maximum number of allowed values of an attribute will be 1000.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearAllowedValues() { + if (allowedValuesBuilder_ == null) { + allowedValues_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + } else { + allowedValuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. The list of allowed values when the attribute value is of type
+     * enum. This is required when the data_type of the attribute is ENUM. The
+     * maximum number of allowed values of an attribute will be 1000.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeAllowedValues(int index) { + if (allowedValuesBuilder_ == null) { + ensureAllowedValuesIsMutable(); + allowedValues_.remove(index); + onChanged(); + } else { + allowedValuesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Optional. The list of allowed values when the attribute value is of type
+     * enum. This is required when the data_type of the attribute is ENUM. The
+     * maximum number of allowed values of an attribute will be 1000.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.Attribute.AllowedValue.Builder getAllowedValuesBuilder( + int index) { + return getAllowedValuesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Optional. The list of allowed values when the attribute value is of type
+     * enum. This is required when the data_type of the attribute is ENUM. The
+     * maximum number of allowed values of an attribute will be 1000.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.Attribute.AllowedValueOrBuilder getAllowedValuesOrBuilder( + int index) { + if (allowedValuesBuilder_ == null) { + return allowedValues_.get(index); + } else { + return allowedValuesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Optional. The list of allowed values when the attribute value is of type
+     * enum. This is required when the data_type of the attribute is ENUM. The
+     * maximum number of allowed values of an attribute will be 1000.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getAllowedValuesOrBuilderList() { + if (allowedValuesBuilder_ != null) { + return allowedValuesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(allowedValues_); + } + } + /** + * + * + *
+     * Optional. The list of allowed values when the attribute value is of type
+     * enum. This is required when the data_type of the attribute is ENUM. The
+     * maximum number of allowed values of an attribute will be 1000.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.Attribute.AllowedValue.Builder addAllowedValuesBuilder() { + return getAllowedValuesFieldBuilder() + .addBuilder(com.google.cloud.apihub.v1.Attribute.AllowedValue.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. The list of allowed values when the attribute value is of type
+     * enum. This is required when the data_type of the attribute is ENUM. The
+     * maximum number of allowed values of an attribute will be 1000.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.Attribute.AllowedValue.Builder addAllowedValuesBuilder( + int index) { + return getAllowedValuesFieldBuilder() + .addBuilder( + index, com.google.cloud.apihub.v1.Attribute.AllowedValue.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. The list of allowed values when the attribute value is of type
+     * enum. This is required when the data_type of the attribute is ENUM. The
+     * maximum number of allowed values of an attribute will be 1000.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getAllowedValuesBuilderList() { + return getAllowedValuesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.Attribute.AllowedValue, + com.google.cloud.apihub.v1.Attribute.AllowedValue.Builder, + com.google.cloud.apihub.v1.Attribute.AllowedValueOrBuilder> + getAllowedValuesFieldBuilder() { + if (allowedValuesBuilder_ == null) { + allowedValuesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.Attribute.AllowedValue, + com.google.cloud.apihub.v1.Attribute.AllowedValue.Builder, + com.google.cloud.apihub.v1.Attribute.AllowedValueOrBuilder>( + allowedValues_, + ((bitField0_ & 0x00000040) != 0), + getParentForChildren(), + isClean()); + allowedValues_ = null; + } + return allowedValuesBuilder_; + } + + private int cardinality_; + /** + * + * + *
+     * Optional. The maximum number of values that the attribute can have when
+     * associated with an API Hub resource. Cardinality 1 would represent a
+     * single-valued attribute. It must not be less than 1 or greater than 20. If
+     * not specified, the cardinality would be set to 1 by default and represent a
+     * single-valued attribute.
+     * 
+ * + * int32 cardinality = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The cardinality. + */ + @java.lang.Override + public int getCardinality() { + return cardinality_; + } + /** + * + * + *
+     * Optional. The maximum number of values that the attribute can have when
+     * associated with an API Hub resource. Cardinality 1 would represent a
+     * single-valued attribute. It must not be less than 1 or greater than 20. If
+     * not specified, the cardinality would be set to 1 by default and represent a
+     * single-valued attribute.
+     * 
+ * + * int32 cardinality = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The cardinality to set. + * @return This builder for chaining. + */ + public Builder setCardinality(int value) { + + cardinality_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of values that the attribute can have when
+     * associated with an API Hub resource. Cardinality 1 would represent a
+     * single-valued attribute. It must not be less than 1 or greater than 20. If
+     * not specified, the cardinality would be set to 1 by default and represent a
+     * single-valued attribute.
+     * 
+ * + * int32 cardinality = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearCardinality() { + bitField0_ = (bitField0_ & ~0x00000080); + cardinality_ = 0; + onChanged(); + return this; + } + + private boolean mandatory_; + /** + * + * + *
+     * Output only. When mandatory is true, the attribute is mandatory for the
+     * resource specified in the scope. Only System defined attributes can be
+     * mandatory.
+     * 
+ * + * bool mandatory = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The mandatory. + */ + @java.lang.Override + public boolean getMandatory() { + return mandatory_; + } + /** + * + * + *
+     * Output only. When mandatory is true, the attribute is mandatory for the
+     * resource specified in the scope. Only System defined attributes can be
+     * mandatory.
+     * 
+ * + * bool mandatory = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The mandatory to set. + * @return This builder for chaining. + */ + public Builder setMandatory(boolean value) { + + mandatory_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. When mandatory is true, the attribute is mandatory for the
+     * resource specified in the scope. Only System defined attributes can be
+     * mandatory.
+     * 
+ * + * bool mandatory = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearMandatory() { + bitField0_ = (bitField0_ & ~0x00000100); + mandatory_ = false; + 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. The time at which the attribute was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * + * + *
+     * Output only. The time at which the attribute was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 10 [(.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. The time at which the attribute was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 10 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the attribute was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the attribute was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The time at which the attribute was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000200); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the attribute was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time at which the attribute was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 10 [(.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. The time at which the attribute was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 10 [(.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 time at which the attribute was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + * + * + *
+     * Output only. The time at which the attribute was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 11 [(.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 time at which the attribute was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 11 [(.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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the attribute was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the attribute was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000400; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The time at which the attribute was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000400); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the attribute was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time at which the attribute was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 11 [(.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 time at which the attribute was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 11 [(.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_; + } + + @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.apihub.v1.Attribute) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.Attribute) + private static final com.google.cloud.apihub.v1.Attribute DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.Attribute(); + } + + public static com.google.cloud.apihub.v1.Attribute getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Attribute parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.Attribute getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/AttributeName.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/AttributeName.java new file mode 100644 index 000000000000..3f0b2a32343a --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/AttributeName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +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 AttributeName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_ATTRIBUTE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/attributes/{attribute}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String attribute; + + @Deprecated + protected AttributeName() { + project = null; + location = null; + attribute = null; + } + + private AttributeName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + attribute = Preconditions.checkNotNull(builder.getAttribute()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAttribute() { + return attribute; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static AttributeName of(String project, String location, String attribute) { + return newBuilder().setProject(project).setLocation(location).setAttribute(attribute).build(); + } + + public static String format(String project, String location, String attribute) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAttribute(attribute) + .build() + .toString(); + } + + public static AttributeName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_ATTRIBUTE.validatedMatch( + formattedString, "AttributeName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("attribute")); + } + + 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 (AttributeName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_ATTRIBUTE.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); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (attribute != null) { + fieldMapBuilder.put("attribute", attribute); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_ATTRIBUTE.instantiate( + "project", project, "location", location, "attribute", attribute); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + AttributeName that = ((AttributeName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.attribute, that.attribute); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(attribute); + return h; + } + + /** Builder for projects/{project}/locations/{location}/attributes/{attribute}. */ + public static class Builder { + private String project; + private String location; + private String attribute; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAttribute() { + return attribute; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setAttribute(String attribute) { + this.attribute = attribute; + return this; + } + + private Builder(AttributeName attributeName) { + this.project = attributeName.project; + this.location = attributeName.location; + this.attribute = attributeName.attribute; + } + + public AttributeName build() { + return new AttributeName(this); + } + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/AttributeOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/AttributeOrBuilder.java new file mode 100644 index 000000000000..e33efec25c69 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/AttributeOrBuilder.java @@ -0,0 +1,376 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface AttributeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.Attribute) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. The name of the attribute in the API Hub.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. The name of the attribute in the API Hub.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The display name of the attribute.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. The display name of the attribute.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Optional. The description of the attribute.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Optional. The description of the attribute.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. The definition type of the attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.Attribute.DefinitionType definition_type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for definitionType. + */ + int getDefinitionTypeValue(); + /** + * + * + *
+   * Output only. The definition type of the attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.Attribute.DefinitionType definition_type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The definitionType. + */ + com.google.cloud.apihub.v1.Attribute.DefinitionType getDefinitionType(); + + /** + * + * + *
+   * Required. The scope of the attribute. It represents the resource in the API
+   * Hub to which the attribute can be linked.
+   * 
+ * + * + * .google.cloud.apihub.v1.Attribute.Scope scope = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for scope. + */ + int getScopeValue(); + /** + * + * + *
+   * Required. The scope of the attribute. It represents the resource in the API
+   * Hub to which the attribute can be linked.
+   * 
+ * + * + * .google.cloud.apihub.v1.Attribute.Scope scope = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The scope. + */ + com.google.cloud.apihub.v1.Attribute.Scope getScope(); + + /** + * + * + *
+   * Required. The type of the data of the attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.Attribute.DataType data_type = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for dataType. + */ + int getDataTypeValue(); + /** + * + * + *
+   * Required. The type of the data of the attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.Attribute.DataType data_type = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dataType. + */ + com.google.cloud.apihub.v1.Attribute.DataType getDataType(); + + /** + * + * + *
+   * Optional. The list of allowed values when the attribute value is of type
+   * enum. This is required when the data_type of the attribute is ENUM. The
+   * maximum number of allowed values of an attribute will be 1000.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getAllowedValuesList(); + /** + * + * + *
+   * Optional. The list of allowed values when the attribute value is of type
+   * enum. This is required when the data_type of the attribute is ENUM. The
+   * maximum number of allowed values of an attribute will be 1000.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.Attribute.AllowedValue getAllowedValues(int index); + /** + * + * + *
+   * Optional. The list of allowed values when the attribute value is of type
+   * enum. This is required when the data_type of the attribute is ENUM. The
+   * maximum number of allowed values of an attribute will be 1000.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getAllowedValuesCount(); + /** + * + * + *
+   * Optional. The list of allowed values when the attribute value is of type
+   * enum. This is required when the data_type of the attribute is ENUM. The
+   * maximum number of allowed values of an attribute will be 1000.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getAllowedValuesOrBuilderList(); + /** + * + * + *
+   * Optional. The list of allowed values when the attribute value is of type
+   * enum. This is required when the data_type of the attribute is ENUM. The
+   * maximum number of allowed values of an attribute will be 1000.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.Attribute.AllowedValueOrBuilder getAllowedValuesOrBuilder(int index); + + /** + * + * + *
+   * Optional. The maximum number of values that the attribute can have when
+   * associated with an API Hub resource. Cardinality 1 would represent a
+   * single-valued attribute. It must not be less than 1 or greater than 20. If
+   * not specified, the cardinality would be set to 1 by default and represent a
+   * single-valued attribute.
+   * 
+ * + * int32 cardinality = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The cardinality. + */ + int getCardinality(); + + /** + * + * + *
+   * Output only. When mandatory is true, the attribute is mandatory for the
+   * resource specified in the scope. Only System defined attributes can be
+   * mandatory.
+   * 
+ * + * bool mandatory = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The mandatory. + */ + boolean getMandatory(); + + /** + * + * + *
+   * Output only. The time at which the attribute was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time at which the attribute was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time at which the attribute was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time at which the attribute was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The time at which the attribute was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The time at which the attribute was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/AttributeValues.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/AttributeValues.java new file mode 100644 index 000000000000..129b4585184e --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/AttributeValues.java @@ -0,0 +1,3519 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The attribute values associated with resource.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.AttributeValues} + */ +public final class AttributeValues extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.AttributeValues) + AttributeValuesOrBuilder { + private static final long serialVersionUID = 0L; + // Use AttributeValues.newBuilder() to construct. + private AttributeValues(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AttributeValues() { + attribute_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AttributeValues(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_AttributeValues_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_AttributeValues_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.AttributeValues.class, + com.google.cloud.apihub.v1.AttributeValues.Builder.class); + } + + public interface EnumAttributeValuesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.AttributeValues.EnumAttributeValues) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The attribute values in case attribute data type is enum.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getValuesList(); + /** + * + * + *
+     * Required. The attribute values in case attribute data type is enum.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.apihub.v1.Attribute.AllowedValue getValues(int index); + /** + * + * + *
+     * Required. The attribute values in case attribute data type is enum.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getValuesCount(); + /** + * + * + *
+     * Required. The attribute values in case attribute data type is enum.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getValuesOrBuilderList(); + /** + * + * + *
+     * Required. The attribute values in case attribute data type is enum.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.apihub.v1.Attribute.AllowedValueOrBuilder getValuesOrBuilder(int index); + } + /** + * + * + *
+   * The attribute values of data type enum.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.AttributeValues.EnumAttributeValues} + */ + public static final class EnumAttributeValues extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.AttributeValues.EnumAttributeValues) + EnumAttributeValuesOrBuilder { + private static final long serialVersionUID = 0L; + // Use EnumAttributeValues.newBuilder() to construct. + private EnumAttributeValues(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EnumAttributeValues() { + values_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EnumAttributeValues(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_AttributeValues_EnumAttributeValues_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_AttributeValues_EnumAttributeValues_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.class, + com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.Builder.class); + } + + public static final int VALUES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List values_; + /** + * + * + *
+     * Required. The attribute values in case attribute data type is enum.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getValuesList() { + return values_; + } + /** + * + * + *
+     * Required. The attribute values in case attribute data type is enum.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getValuesOrBuilderList() { + return values_; + } + /** + * + * + *
+     * Required. The attribute values in case attribute data type is enum.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+     * Required. The attribute values in case attribute data type is enum.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Attribute.AllowedValue getValues(int index) { + return values_.get(index); + } + /** + * + * + *
+     * Required. The attribute values in case attribute data type is enum.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Attribute.AllowedValueOrBuilder getValuesOrBuilder( + int index) { + return values_.get(index); + } + + 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 < values_.size(); i++) { + output.writeMessage(1, values_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < values_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, values_.get(i)); + } + size += getUnknownFields().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.apihub.v1.AttributeValues.EnumAttributeValues)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues other = + (com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues) obj; + + if (!getValuesList().equals(other.getValuesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues 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.apihub.v1.AttributeValues.EnumAttributeValues parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues 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.apihub.v1.AttributeValues.EnumAttributeValues parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues 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.apihub.v1.AttributeValues.EnumAttributeValues parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues 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.apihub.v1.AttributeValues.EnumAttributeValues parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues 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.apihub.v1.AttributeValues.EnumAttributeValues 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 attribute values of data type enum.
+     * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.AttributeValues.EnumAttributeValues} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.AttributeValues.EnumAttributeValues) + com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValuesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_AttributeValues_EnumAttributeValues_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_AttributeValues_EnumAttributeValues_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.class, + com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + } else { + values_ = null; + valuesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_AttributeValues_EnumAttributeValues_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues + getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues build() { + com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues buildPartial() { + com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues result = + new com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues result) { + if (valuesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + values_ = java.util.Collections.unmodifiableList(values_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.values_ = values_; + } else { + result.values_ = valuesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues result) { + int from_bitField0_ = bitField0_; + } + + @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.apihub.v1.AttributeValues.EnumAttributeValues) { + return mergeFrom((com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues other) { + if (other + == com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.getDefaultInstance()) + return this; + if (valuesBuilder_ == null) { + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + } else { + if (!other.values_.isEmpty()) { + if (valuesBuilder_.isEmpty()) { + valuesBuilder_.dispose(); + valuesBuilder_ = null; + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + valuesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getValuesFieldBuilder() + : null; + } else { + valuesBuilder_.addAllMessages(other.values_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.apihub.v1.Attribute.AllowedValue m = + input.readMessage( + com.google.cloud.apihub.v1.Attribute.AllowedValue.parser(), + extensionRegistry); + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(m); + } else { + valuesBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List values_ = + java.util.Collections.emptyList(); + + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + values_ = + new java.util.ArrayList(values_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.Attribute.AllowedValue, + com.google.cloud.apihub.v1.Attribute.AllowedValue.Builder, + com.google.cloud.apihub.v1.Attribute.AllowedValueOrBuilder> + valuesBuilder_; + + /** + * + * + *
+       * Required. The attribute values in case attribute data type is enum.
+       * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getValuesList() { + if (valuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(values_); + } else { + return valuesBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Required. The attribute values in case attribute data type is enum.
+       * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getValuesCount() { + if (valuesBuilder_ == null) { + return values_.size(); + } else { + return valuesBuilder_.getCount(); + } + } + /** + * + * + *
+       * Required. The attribute values in case attribute data type is enum.
+       * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.Attribute.AllowedValue getValues(int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Required. The attribute values in case attribute data type is enum.
+       * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setValues(int index, com.google.cloud.apihub.v1.Attribute.AllowedValue value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.set(index, value); + onChanged(); + } else { + valuesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Required. The attribute values in case attribute data type is enum.
+       * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setValues( + int index, com.google.cloud.apihub.v1.Attribute.AllowedValue.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.set(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Required. The attribute values in case attribute data type is enum.
+       * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addValues(com.google.cloud.apihub.v1.Attribute.AllowedValue value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(value); + onChanged(); + } else { + valuesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Required. The attribute values in case attribute data type is enum.
+       * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addValues(int index, com.google.cloud.apihub.v1.Attribute.AllowedValue value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(index, value); + onChanged(); + } else { + valuesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Required. The attribute values in case attribute data type is enum.
+       * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addValues( + com.google.cloud.apihub.v1.Attribute.AllowedValue.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Required. The attribute values in case attribute data type is enum.
+       * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addValues( + int index, com.google.cloud.apihub.v1.Attribute.AllowedValue.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Required. The attribute values in case attribute data type is enum.
+       * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllValues( + java.lang.Iterable values) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); + onChanged(); + } else { + valuesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Required. The attribute values in case attribute data type is enum.
+       * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearValues() { + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + valuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Required. The attribute values in case attribute data type is enum.
+       * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeValues(int index) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.remove(index); + onChanged(); + } else { + valuesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Required. The attribute values in case attribute data type is enum.
+       * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.Attribute.AllowedValue.Builder getValuesBuilder(int index) { + return getValuesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Required. The attribute values in case attribute data type is enum.
+       * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.Attribute.AllowedValueOrBuilder getValuesOrBuilder( + int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Required. The attribute values in case attribute data type is enum.
+       * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getValuesOrBuilderList() { + if (valuesBuilder_ != null) { + return valuesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(values_); + } + } + /** + * + * + *
+       * Required. The attribute values in case attribute data type is enum.
+       * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.Attribute.AllowedValue.Builder addValuesBuilder() { + return getValuesFieldBuilder() + .addBuilder(com.google.cloud.apihub.v1.Attribute.AllowedValue.getDefaultInstance()); + } + /** + * + * + *
+       * Required. The attribute values in case attribute data type is enum.
+       * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.Attribute.AllowedValue.Builder addValuesBuilder(int index) { + return getValuesFieldBuilder() + .addBuilder( + index, com.google.cloud.apihub.v1.Attribute.AllowedValue.getDefaultInstance()); + } + /** + * + * + *
+       * Required. The attribute values in case attribute data type is enum.
+       * 
+ * + * + * repeated .google.cloud.apihub.v1.Attribute.AllowedValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getValuesBuilderList() { + return getValuesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.Attribute.AllowedValue, + com.google.cloud.apihub.v1.Attribute.AllowedValue.Builder, + com.google.cloud.apihub.v1.Attribute.AllowedValueOrBuilder> + getValuesFieldBuilder() { + if (valuesBuilder_ == null) { + valuesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.Attribute.AllowedValue, + com.google.cloud.apihub.v1.Attribute.AllowedValue.Builder, + com.google.cloud.apihub.v1.Attribute.AllowedValueOrBuilder>( + values_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + values_ = null; + } + return valuesBuilder_; + } + + @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.apihub.v1.AttributeValues.EnumAttributeValues) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.AttributeValues.EnumAttributeValues) + private static final com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues(); + } + + public static com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EnumAttributeValues parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.AttributeValues.EnumAttributeValues + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface StringAttributeValuesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.AttributeValues.StringAttributeValues) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The attribute values in case attribute data type is string or
+     * JSON.
+     * 
+ * + * repeated string values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the values. + */ + java.util.List getValuesList(); + /** + * + * + *
+     * Required. The attribute values in case attribute data type is string or
+     * JSON.
+     * 
+ * + * repeated string values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of values. + */ + int getValuesCount(); + /** + * + * + *
+     * Required. The attribute values in case attribute data type is string or
+     * JSON.
+     * 
+ * + * repeated string values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + java.lang.String getValues(int index); + /** + * + * + *
+     * Required. The attribute values in case attribute data type is string or
+     * JSON.
+     * 
+ * + * repeated string values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the values at the given index. + */ + com.google.protobuf.ByteString getValuesBytes(int index); + } + /** + * + * + *
+   * The attribute values of data type string or JSON.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.AttributeValues.StringAttributeValues} + */ + public static final class StringAttributeValues extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.AttributeValues.StringAttributeValues) + StringAttributeValuesOrBuilder { + private static final long serialVersionUID = 0L; + // Use StringAttributeValues.newBuilder() to construct. + private StringAttributeValues(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StringAttributeValues() { + values_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StringAttributeValues(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_AttributeValues_StringAttributeValues_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_AttributeValues_StringAttributeValues_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.class, + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.Builder.class); + } + + public static final int VALUES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList values_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+     * Required. The attribute values in case attribute data type is string or
+     * JSON.
+     * 
+ * + * repeated string values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the values. + */ + public com.google.protobuf.ProtocolStringList getValuesList() { + return values_; + } + /** + * + * + *
+     * Required. The attribute values in case attribute data type is string or
+     * JSON.
+     * 
+ * + * repeated string values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+     * Required. The attribute values in case attribute data type is string or
+     * JSON.
+     * 
+ * + * repeated string values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public java.lang.String getValues(int index) { + return values_.get(index); + } + /** + * + * + *
+     * Required. The attribute values in case attribute data type is string or
+     * JSON.
+     * 
+ * + * repeated string values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the values at the given index. + */ + public com.google.protobuf.ByteString getValuesBytes(int index) { + return values_.getByteString(index); + } + + 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 < values_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, values_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < values_.size(); i++) { + dataSize += computeStringSizeNoTag(values_.getRaw(i)); + } + size += dataSize; + size += 1 * getValuesList().size(); + } + size += getUnknownFields().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.apihub.v1.AttributeValues.StringAttributeValues)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues other = + (com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues) obj; + + if (!getValuesList().equals(other.getValuesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues 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.apihub.v1.AttributeValues.StringAttributeValues parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues 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.apihub.v1.AttributeValues.StringAttributeValues parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues 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.apihub.v1.AttributeValues.StringAttributeValues + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues + 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.apihub.v1.AttributeValues.StringAttributeValues parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues 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.apihub.v1.AttributeValues.StringAttributeValues 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 attribute values of data type string or JSON.
+     * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.AttributeValues.StringAttributeValues} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.AttributeValues.StringAttributeValues) + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValuesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_AttributeValues_StringAttributeValues_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_AttributeValues_StringAttributeValues_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.class, + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.Builder.class); + } + + // Construct using + // com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + values_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_AttributeValues_StringAttributeValues_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues + getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues build() { + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues buildPartial() { + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues result = + new com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + values_.makeImmutable(); + result.values_ = values_; + } + } + + @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.apihub.v1.AttributeValues.StringAttributeValues) { + return mergeFrom( + (com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues other) { + if (other + == com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues + .getDefaultInstance()) return this; + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ |= 0x00000001; + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + 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(); + ensureValuesIsMutable(); + values_.add(s); + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList values_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureValuesIsMutable() { + if (!values_.isModifiable()) { + values_ = new com.google.protobuf.LazyStringArrayList(values_); + } + bitField0_ |= 0x00000001; + } + /** + * + * + *
+       * Required. The attribute values in case attribute data type is string or
+       * JSON.
+       * 
+ * + * repeated string values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the values. + */ + public com.google.protobuf.ProtocolStringList getValuesList() { + values_.makeImmutable(); + return values_; + } + /** + * + * + *
+       * Required. The attribute values in case attribute data type is string or
+       * JSON.
+       * 
+ * + * repeated string values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+       * Required. The attribute values in case attribute data type is string or
+       * JSON.
+       * 
+ * + * repeated string values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public java.lang.String getValues(int index) { + return values_.get(index); + } + /** + * + * + *
+       * Required. The attribute values in case attribute data type is string or
+       * JSON.
+       * 
+ * + * repeated string values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the values at the given index. + */ + public com.google.protobuf.ByteString getValuesBytes(int index) { + return values_.getByteString(index); + } + /** + * + * + *
+       * Required. The attribute values in case attribute data type is string or
+       * JSON.
+       * 
+ * + * repeated string values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The values to set. + * @return This builder for chaining. + */ + public Builder setValues(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The attribute values in case attribute data type is string or
+       * JSON.
+       * 
+ * + * repeated string values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The values to add. + * @return This builder for chaining. + */ + public Builder addValues(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The attribute values in case attribute data type is string or
+       * JSON.
+       * 
+ * + * repeated string values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The values to add. + * @return This builder for chaining. + */ + public Builder addAllValues(java.lang.Iterable values) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The attribute values in case attribute data type is string or
+       * JSON.
+       * 
+ * + * repeated string values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearValues() { + values_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The attribute values in case attribute data type is string or
+       * JSON.
+       * 
+ * + * repeated string values = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the values to add. + * @return This builder for chaining. + */ + public Builder addValuesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureValuesIsMutable(); + values_.add(value); + bitField0_ |= 0x00000001; + 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.apihub.v1.AttributeValues.StringAttributeValues) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.AttributeValues.StringAttributeValues) + private static final com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues(); + } + + public static com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StringAttributeValues parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.AttributeValues.StringAttributeValues + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int valueCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object value_; + + public enum ValueCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + ENUM_VALUES(2), + STRING_VALUES(3), + JSON_VALUES(4), + VALUE_NOT_SET(0); + private final int value; + + private ValueCase(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 ValueCase valueOf(int value) { + return forNumber(value); + } + + public static ValueCase forNumber(int value) { + switch (value) { + case 2: + return ENUM_VALUES; + case 3: + return STRING_VALUES; + case 4: + return JSON_VALUES; + case 0: + return VALUE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ValueCase getValueCase() { + return ValueCase.forNumber(valueCase_); + } + + public static final int ENUM_VALUES_FIELD_NUMBER = 2; + /** + * + * + *
+   * The attribute values associated with a resource in case attribute data
+   * type is enum.
+   * 
+ * + * .google.cloud.apihub.v1.AttributeValues.EnumAttributeValues enum_values = 2; + * + * @return Whether the enumValues field is set. + */ + @java.lang.Override + public boolean hasEnumValues() { + return valueCase_ == 2; + } + /** + * + * + *
+   * The attribute values associated with a resource in case attribute data
+   * type is enum.
+   * 
+ * + * .google.cloud.apihub.v1.AttributeValues.EnumAttributeValues enum_values = 2; + * + * @return The enumValues. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues getEnumValues() { + if (valueCase_ == 2) { + return (com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues) value_; + } + return com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.getDefaultInstance(); + } + /** + * + * + *
+   * The attribute values associated with a resource in case attribute data
+   * type is enum.
+   * 
+ * + * .google.cloud.apihub.v1.AttributeValues.EnumAttributeValues enum_values = 2; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValuesOrBuilder + getEnumValuesOrBuilder() { + if (valueCase_ == 2) { + return (com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues) value_; + } + return com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.getDefaultInstance(); + } + + public static final int STRING_VALUES_FIELD_NUMBER = 3; + /** + * + * + *
+   * The attribute values associated with a resource in case attribute data
+   * type is string.
+   * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues string_values = 3; + * + * @return Whether the stringValues field is set. + */ + @java.lang.Override + public boolean hasStringValues() { + return valueCase_ == 3; + } + /** + * + * + *
+   * The attribute values associated with a resource in case attribute data
+   * type is string.
+   * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues string_values = 3; + * + * @return The stringValues. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues getStringValues() { + if (valueCase_ == 3) { + return (com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues) value_; + } + return com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.getDefaultInstance(); + } + /** + * + * + *
+   * The attribute values associated with a resource in case attribute data
+   * type is string.
+   * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues string_values = 3; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues.StringAttributeValuesOrBuilder + getStringValuesOrBuilder() { + if (valueCase_ == 3) { + return (com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues) value_; + } + return com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.getDefaultInstance(); + } + + public static final int JSON_VALUES_FIELD_NUMBER = 4; + /** + * + * + *
+   * The attribute values associated with a resource in case attribute data
+   * type is JSON.
+   * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues json_values = 4; + * + * @return Whether the jsonValues field is set. + */ + @java.lang.Override + public boolean hasJsonValues() { + return valueCase_ == 4; + } + /** + * + * + *
+   * The attribute values associated with a resource in case attribute data
+   * type is JSON.
+   * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues json_values = 4; + * + * @return The jsonValues. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues getJsonValues() { + if (valueCase_ == 4) { + return (com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues) value_; + } + return com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.getDefaultInstance(); + } + /** + * + * + *
+   * The attribute values associated with a resource in case attribute data
+   * type is JSON.
+   * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues json_values = 4; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues.StringAttributeValuesOrBuilder + getJsonValuesOrBuilder() { + if (valueCase_ == 4) { + return (com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues) value_; + } + return com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.getDefaultInstance(); + } + + public static final int ATTRIBUTE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object attribute_ = ""; + /** + * + * + *
+   * Output only. The name of the attribute.
+   * Format: projects/{project}/locations/{location}/attributes/{attribute}
+   * 
+ * + * + * string attribute = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The attribute. + */ + @java.lang.Override + public java.lang.String getAttribute() { + java.lang.Object ref = attribute_; + 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(); + attribute_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The name of the attribute.
+   * Format: projects/{project}/locations/{location}/attributes/{attribute}
+   * 
+ * + * + * string attribute = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for attribute. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAttributeBytes() { + java.lang.Object ref = attribute_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attribute_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attribute_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, attribute_); + } + if (valueCase_ == 2) { + output.writeMessage( + 2, (com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues) value_); + } + if (valueCase_ == 3) { + output.writeMessage( + 3, (com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues) value_); + } + if (valueCase_ == 4) { + output.writeMessage( + 4, (com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues) value_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attribute_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, attribute_); + } + if (valueCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues) value_); + } + if (valueCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues) value_); + } + if (valueCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues) value_); + } + size += getUnknownFields().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.apihub.v1.AttributeValues)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.AttributeValues other = + (com.google.cloud.apihub.v1.AttributeValues) obj; + + if (!getAttribute().equals(other.getAttribute())) return false; + if (!getValueCase().equals(other.getValueCase())) return false; + switch (valueCase_) { + case 2: + if (!getEnumValues().equals(other.getEnumValues())) return false; + break; + case 3: + if (!getStringValues().equals(other.getStringValues())) return false; + break; + case 4: + if (!getJsonValues().equals(other.getJsonValues())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ATTRIBUTE_FIELD_NUMBER; + hash = (53 * hash) + getAttribute().hashCode(); + switch (valueCase_) { + case 2: + hash = (37 * hash) + ENUM_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getEnumValues().hashCode(); + break; + case 3: + hash = (37 * hash) + STRING_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getStringValues().hashCode(); + break; + case 4: + hash = (37 * hash) + JSON_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getJsonValues().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.AttributeValues parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.AttributeValues 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.apihub.v1.AttributeValues parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.AttributeValues 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.apihub.v1.AttributeValues parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.AttributeValues parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.AttributeValues parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.AttributeValues 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.apihub.v1.AttributeValues parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.AttributeValues 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.apihub.v1.AttributeValues parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.AttributeValues 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.apihub.v1.AttributeValues 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 attribute values associated with resource.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.AttributeValues} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.AttributeValues) + com.google.cloud.apihub.v1.AttributeValuesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_AttributeValues_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_AttributeValues_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.AttributeValues.class, + com.google.cloud.apihub.v1.AttributeValues.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.AttributeValues.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (enumValuesBuilder_ != null) { + enumValuesBuilder_.clear(); + } + if (stringValuesBuilder_ != null) { + stringValuesBuilder_.clear(); + } + if (jsonValuesBuilder_ != null) { + jsonValuesBuilder_.clear(); + } + attribute_ = ""; + valueCase_ = 0; + value_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_AttributeValues_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues build() { + com.google.cloud.apihub.v1.AttributeValues result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues buildPartial() { + com.google.cloud.apihub.v1.AttributeValues result = + new com.google.cloud.apihub.v1.AttributeValues(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.AttributeValues result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.attribute_ = attribute_; + } + } + + private void buildPartialOneofs(com.google.cloud.apihub.v1.AttributeValues result) { + result.valueCase_ = valueCase_; + result.value_ = this.value_; + if (valueCase_ == 2 && enumValuesBuilder_ != null) { + result.value_ = enumValuesBuilder_.build(); + } + if (valueCase_ == 3 && stringValuesBuilder_ != null) { + result.value_ = stringValuesBuilder_.build(); + } + if (valueCase_ == 4 && jsonValuesBuilder_ != null) { + result.value_ = jsonValuesBuilder_.build(); + } + } + + @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.apihub.v1.AttributeValues) { + return mergeFrom((com.google.cloud.apihub.v1.AttributeValues) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.AttributeValues other) { + if (other == com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance()) return this; + if (!other.getAttribute().isEmpty()) { + attribute_ = other.attribute_; + bitField0_ |= 0x00000008; + onChanged(); + } + switch (other.getValueCase()) { + case ENUM_VALUES: + { + mergeEnumValues(other.getEnumValues()); + break; + } + case STRING_VALUES: + { + mergeStringValues(other.getStringValues()); + break; + } + case JSON_VALUES: + { + mergeJsonValues(other.getJsonValues()); + break; + } + case VALUE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + attribute_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 10 + case 18: + { + input.readMessage(getEnumValuesFieldBuilder().getBuilder(), extensionRegistry); + valueCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(getStringValuesFieldBuilder().getBuilder(), extensionRegistry); + valueCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage(getJsonValuesFieldBuilder().getBuilder(), extensionRegistry); + valueCase_ = 4; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int valueCase_ = 0; + private java.lang.Object value_; + + public ValueCase getValueCase() { + return ValueCase.forNumber(valueCase_); + } + + public Builder clearValue() { + valueCase_ = 0; + value_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues, + com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValuesOrBuilder> + enumValuesBuilder_; + /** + * + * + *
+     * The attribute values associated with a resource in case attribute data
+     * type is enum.
+     * 
+ * + * .google.cloud.apihub.v1.AttributeValues.EnumAttributeValues enum_values = 2; + * + * @return Whether the enumValues field is set. + */ + @java.lang.Override + public boolean hasEnumValues() { + return valueCase_ == 2; + } + /** + * + * + *
+     * The attribute values associated with a resource in case attribute data
+     * type is enum.
+     * 
+ * + * .google.cloud.apihub.v1.AttributeValues.EnumAttributeValues enum_values = 2; + * + * @return The enumValues. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues getEnumValues() { + if (enumValuesBuilder_ == null) { + if (valueCase_ == 2) { + return (com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues) value_; + } + return com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.getDefaultInstance(); + } else { + if (valueCase_ == 2) { + return enumValuesBuilder_.getMessage(); + } + return com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.getDefaultInstance(); + } + } + /** + * + * + *
+     * The attribute values associated with a resource in case attribute data
+     * type is enum.
+     * 
+ * + * .google.cloud.apihub.v1.AttributeValues.EnumAttributeValues enum_values = 2; + */ + public Builder setEnumValues( + com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues value) { + if (enumValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + onChanged(); + } else { + enumValuesBuilder_.setMessage(value); + } + valueCase_ = 2; + return this; + } + /** + * + * + *
+     * The attribute values associated with a resource in case attribute data
+     * type is enum.
+     * 
+ * + * .google.cloud.apihub.v1.AttributeValues.EnumAttributeValues enum_values = 2; + */ + public Builder setEnumValues( + com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.Builder builderForValue) { + if (enumValuesBuilder_ == null) { + value_ = builderForValue.build(); + onChanged(); + } else { + enumValuesBuilder_.setMessage(builderForValue.build()); + } + valueCase_ = 2; + return this; + } + /** + * + * + *
+     * The attribute values associated with a resource in case attribute data
+     * type is enum.
+     * 
+ * + * .google.cloud.apihub.v1.AttributeValues.EnumAttributeValues enum_values = 2; + */ + public Builder mergeEnumValues( + com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues value) { + if (enumValuesBuilder_ == null) { + if (valueCase_ == 2 + && value_ + != com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues + .getDefaultInstance()) { + value_ = + com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.newBuilder( + (com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues) value_) + .mergeFrom(value) + .buildPartial(); + } else { + value_ = value; + } + onChanged(); + } else { + if (valueCase_ == 2) { + enumValuesBuilder_.mergeFrom(value); + } else { + enumValuesBuilder_.setMessage(value); + } + } + valueCase_ = 2; + return this; + } + /** + * + * + *
+     * The attribute values associated with a resource in case attribute data
+     * type is enum.
+     * 
+ * + * .google.cloud.apihub.v1.AttributeValues.EnumAttributeValues enum_values = 2; + */ + public Builder clearEnumValues() { + if (enumValuesBuilder_ == null) { + if (valueCase_ == 2) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + } else { + if (valueCase_ == 2) { + valueCase_ = 0; + value_ = null; + } + enumValuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The attribute values associated with a resource in case attribute data
+     * type is enum.
+     * 
+ * + * .google.cloud.apihub.v1.AttributeValues.EnumAttributeValues enum_values = 2; + */ + public com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.Builder + getEnumValuesBuilder() { + return getEnumValuesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The attribute values associated with a resource in case attribute data
+     * type is enum.
+     * 
+ * + * .google.cloud.apihub.v1.AttributeValues.EnumAttributeValues enum_values = 2; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValuesOrBuilder + getEnumValuesOrBuilder() { + if ((valueCase_ == 2) && (enumValuesBuilder_ != null)) { + return enumValuesBuilder_.getMessageOrBuilder(); + } else { + if (valueCase_ == 2) { + return (com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues) value_; + } + return com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.getDefaultInstance(); + } + } + /** + * + * + *
+     * The attribute values associated with a resource in case attribute data
+     * type is enum.
+     * 
+ * + * .google.cloud.apihub.v1.AttributeValues.EnumAttributeValues enum_values = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues, + com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValuesOrBuilder> + getEnumValuesFieldBuilder() { + if (enumValuesBuilder_ == null) { + if (!(valueCase_ == 2)) { + value_ = + com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.getDefaultInstance(); + } + enumValuesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues, + com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValuesOrBuilder>( + (com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues) value_, + getParentForChildren(), + isClean()); + value_ = null; + } + valueCase_ = 2; + onChanged(); + return enumValuesBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues, + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValuesOrBuilder> + stringValuesBuilder_; + /** + * + * + *
+     * The attribute values associated with a resource in case attribute data
+     * type is string.
+     * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues string_values = 3; + * + * @return Whether the stringValues field is set. + */ + @java.lang.Override + public boolean hasStringValues() { + return valueCase_ == 3; + } + /** + * + * + *
+     * The attribute values associated with a resource in case attribute data
+     * type is string.
+     * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues string_values = 3; + * + * @return The stringValues. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues getStringValues() { + if (stringValuesBuilder_ == null) { + if (valueCase_ == 3) { + return (com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues) value_; + } + return com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues + .getDefaultInstance(); + } else { + if (valueCase_ == 3) { + return stringValuesBuilder_.getMessage(); + } + return com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues + .getDefaultInstance(); + } + } + /** + * + * + *
+     * The attribute values associated with a resource in case attribute data
+     * type is string.
+     * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues string_values = 3; + */ + public Builder setStringValues( + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues value) { + if (stringValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + onChanged(); + } else { + stringValuesBuilder_.setMessage(value); + } + valueCase_ = 3; + return this; + } + /** + * + * + *
+     * The attribute values associated with a resource in case attribute data
+     * type is string.
+     * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues string_values = 3; + */ + public Builder setStringValues( + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.Builder builderForValue) { + if (stringValuesBuilder_ == null) { + value_ = builderForValue.build(); + onChanged(); + } else { + stringValuesBuilder_.setMessage(builderForValue.build()); + } + valueCase_ = 3; + return this; + } + /** + * + * + *
+     * The attribute values associated with a resource in case attribute data
+     * type is string.
+     * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues string_values = 3; + */ + public Builder mergeStringValues( + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues value) { + if (stringValuesBuilder_ == null) { + if (valueCase_ == 3 + && value_ + != com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues + .getDefaultInstance()) { + value_ = + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.newBuilder( + (com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues) value_) + .mergeFrom(value) + .buildPartial(); + } else { + value_ = value; + } + onChanged(); + } else { + if (valueCase_ == 3) { + stringValuesBuilder_.mergeFrom(value); + } else { + stringValuesBuilder_.setMessage(value); + } + } + valueCase_ = 3; + return this; + } + /** + * + * + *
+     * The attribute values associated with a resource in case attribute data
+     * type is string.
+     * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues string_values = 3; + */ + public Builder clearStringValues() { + if (stringValuesBuilder_ == null) { + if (valueCase_ == 3) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + } else { + if (valueCase_ == 3) { + valueCase_ = 0; + value_ = null; + } + stringValuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The attribute values associated with a resource in case attribute data
+     * type is string.
+     * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues string_values = 3; + */ + public com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.Builder + getStringValuesBuilder() { + return getStringValuesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The attribute values associated with a resource in case attribute data
+     * type is string.
+     * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues string_values = 3; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues.StringAttributeValuesOrBuilder + getStringValuesOrBuilder() { + if ((valueCase_ == 3) && (stringValuesBuilder_ != null)) { + return stringValuesBuilder_.getMessageOrBuilder(); + } else { + if (valueCase_ == 3) { + return (com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues) value_; + } + return com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues + .getDefaultInstance(); + } + } + /** + * + * + *
+     * The attribute values associated with a resource in case attribute data
+     * type is string.
+     * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues string_values = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues, + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValuesOrBuilder> + getStringValuesFieldBuilder() { + if (stringValuesBuilder_ == null) { + if (!(valueCase_ == 3)) { + value_ = + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.getDefaultInstance(); + } + stringValuesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues, + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValuesOrBuilder>( + (com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues) value_, + getParentForChildren(), + isClean()); + value_ = null; + } + valueCase_ = 3; + onChanged(); + return stringValuesBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues, + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValuesOrBuilder> + jsonValuesBuilder_; + /** + * + * + *
+     * The attribute values associated with a resource in case attribute data
+     * type is JSON.
+     * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues json_values = 4; + * + * @return Whether the jsonValues field is set. + */ + @java.lang.Override + public boolean hasJsonValues() { + return valueCase_ == 4; + } + /** + * + * + *
+     * The attribute values associated with a resource in case attribute data
+     * type is JSON.
+     * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues json_values = 4; + * + * @return The jsonValues. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues getJsonValues() { + if (jsonValuesBuilder_ == null) { + if (valueCase_ == 4) { + return (com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues) value_; + } + return com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues + .getDefaultInstance(); + } else { + if (valueCase_ == 4) { + return jsonValuesBuilder_.getMessage(); + } + return com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues + .getDefaultInstance(); + } + } + /** + * + * + *
+     * The attribute values associated with a resource in case attribute data
+     * type is JSON.
+     * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues json_values = 4; + */ + public Builder setJsonValues( + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues value) { + if (jsonValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + onChanged(); + } else { + jsonValuesBuilder_.setMessage(value); + } + valueCase_ = 4; + return this; + } + /** + * + * + *
+     * The attribute values associated with a resource in case attribute data
+     * type is JSON.
+     * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues json_values = 4; + */ + public Builder setJsonValues( + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.Builder builderForValue) { + if (jsonValuesBuilder_ == null) { + value_ = builderForValue.build(); + onChanged(); + } else { + jsonValuesBuilder_.setMessage(builderForValue.build()); + } + valueCase_ = 4; + return this; + } + /** + * + * + *
+     * The attribute values associated with a resource in case attribute data
+     * type is JSON.
+     * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues json_values = 4; + */ + public Builder mergeJsonValues( + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues value) { + if (jsonValuesBuilder_ == null) { + if (valueCase_ == 4 + && value_ + != com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues + .getDefaultInstance()) { + value_ = + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.newBuilder( + (com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues) value_) + .mergeFrom(value) + .buildPartial(); + } else { + value_ = value; + } + onChanged(); + } else { + if (valueCase_ == 4) { + jsonValuesBuilder_.mergeFrom(value); + } else { + jsonValuesBuilder_.setMessage(value); + } + } + valueCase_ = 4; + return this; + } + /** + * + * + *
+     * The attribute values associated with a resource in case attribute data
+     * type is JSON.
+     * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues json_values = 4; + */ + public Builder clearJsonValues() { + if (jsonValuesBuilder_ == null) { + if (valueCase_ == 4) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + } else { + if (valueCase_ == 4) { + valueCase_ = 0; + value_ = null; + } + jsonValuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The attribute values associated with a resource in case attribute data
+     * type is JSON.
+     * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues json_values = 4; + */ + public com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.Builder + getJsonValuesBuilder() { + return getJsonValuesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The attribute values associated with a resource in case attribute data
+     * type is JSON.
+     * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues json_values = 4; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues.StringAttributeValuesOrBuilder + getJsonValuesOrBuilder() { + if ((valueCase_ == 4) && (jsonValuesBuilder_ != null)) { + return jsonValuesBuilder_.getMessageOrBuilder(); + } else { + if (valueCase_ == 4) { + return (com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues) value_; + } + return com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues + .getDefaultInstance(); + } + } + /** + * + * + *
+     * The attribute values associated with a resource in case attribute data
+     * type is JSON.
+     * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues json_values = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues, + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValuesOrBuilder> + getJsonValuesFieldBuilder() { + if (jsonValuesBuilder_ == null) { + if (!(valueCase_ == 4)) { + value_ = + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.getDefaultInstance(); + } + jsonValuesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues, + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValuesOrBuilder>( + (com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues) value_, + getParentForChildren(), + isClean()); + value_ = null; + } + valueCase_ = 4; + onChanged(); + return jsonValuesBuilder_; + } + + private java.lang.Object attribute_ = ""; + /** + * + * + *
+     * Output only. The name of the attribute.
+     * Format: projects/{project}/locations/{location}/attributes/{attribute}
+     * 
+ * + * + * string attribute = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The attribute. + */ + public java.lang.String getAttribute() { + java.lang.Object ref = attribute_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attribute_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The name of the attribute.
+     * Format: projects/{project}/locations/{location}/attributes/{attribute}
+     * 
+ * + * + * string attribute = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for attribute. + */ + public com.google.protobuf.ByteString getAttributeBytes() { + java.lang.Object ref = attribute_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attribute_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The name of the attribute.
+     * Format: projects/{project}/locations/{location}/attributes/{attribute}
+     * 
+ * + * + * string attribute = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The attribute to set. + * @return This builder for chaining. + */ + public Builder setAttribute(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + attribute_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the attribute.
+     * Format: projects/{project}/locations/{location}/attributes/{attribute}
+     * 
+ * + * + * string attribute = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearAttribute() { + attribute_ = getDefaultInstance().getAttribute(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the attribute.
+     * Format: projects/{project}/locations/{location}/attributes/{attribute}
+     * 
+ * + * + * string attribute = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for attribute to set. + * @return This builder for chaining. + */ + public Builder setAttributeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + attribute_ = value; + bitField0_ |= 0x00000008; + 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.apihub.v1.AttributeValues) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.AttributeValues) + private static final com.google.cloud.apihub.v1.AttributeValues DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.AttributeValues(); + } + + public static com.google.cloud.apihub.v1.AttributeValues getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AttributeValues parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.AttributeValues getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/AttributeValuesOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/AttributeValuesOrBuilder.java new file mode 100644 index 000000000000..155f1339af1d --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/AttributeValuesOrBuilder.java @@ -0,0 +1,175 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface AttributeValuesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.AttributeValues) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The attribute values associated with a resource in case attribute data
+   * type is enum.
+   * 
+ * + * .google.cloud.apihub.v1.AttributeValues.EnumAttributeValues enum_values = 2; + * + * @return Whether the enumValues field is set. + */ + boolean hasEnumValues(); + /** + * + * + *
+   * The attribute values associated with a resource in case attribute data
+   * type is enum.
+   * 
+ * + * .google.cloud.apihub.v1.AttributeValues.EnumAttributeValues enum_values = 2; + * + * @return The enumValues. + */ + com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues getEnumValues(); + /** + * + * + *
+   * The attribute values associated with a resource in case attribute data
+   * type is enum.
+   * 
+ * + * .google.cloud.apihub.v1.AttributeValues.EnumAttributeValues enum_values = 2; + */ + com.google.cloud.apihub.v1.AttributeValues.EnumAttributeValuesOrBuilder getEnumValuesOrBuilder(); + + /** + * + * + *
+   * The attribute values associated with a resource in case attribute data
+   * type is string.
+   * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues string_values = 3; + * + * @return Whether the stringValues field is set. + */ + boolean hasStringValues(); + /** + * + * + *
+   * The attribute values associated with a resource in case attribute data
+   * type is string.
+   * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues string_values = 3; + * + * @return The stringValues. + */ + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues getStringValues(); + /** + * + * + *
+   * The attribute values associated with a resource in case attribute data
+   * type is string.
+   * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues string_values = 3; + */ + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValuesOrBuilder + getStringValuesOrBuilder(); + + /** + * + * + *
+   * The attribute values associated with a resource in case attribute data
+   * type is JSON.
+   * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues json_values = 4; + * + * @return Whether the jsonValues field is set. + */ + boolean hasJsonValues(); + /** + * + * + *
+   * The attribute values associated with a resource in case attribute data
+   * type is JSON.
+   * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues json_values = 4; + * + * @return The jsonValues. + */ + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValues getJsonValues(); + /** + * + * + *
+   * The attribute values associated with a resource in case attribute data
+   * type is JSON.
+   * 
+ * + * .google.cloud.apihub.v1.AttributeValues.StringAttributeValues json_values = 4; + */ + com.google.cloud.apihub.v1.AttributeValues.StringAttributeValuesOrBuilder + getJsonValuesOrBuilder(); + + /** + * + * + *
+   * Output only. The name of the attribute.
+   * Format: projects/{project}/locations/{location}/attributes/{attribute}
+   * 
+ * + * + * string attribute = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The attribute. + */ + java.lang.String getAttribute(); + /** + * + * + *
+   * Output only. The name of the attribute.
+   * Format: projects/{project}/locations/{location}/attributes/{attribute}
+   * 
+ * + * + * string attribute = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for attribute. + */ + com.google.protobuf.ByteString getAttributeBytes(); + + com.google.cloud.apihub.v1.AttributeValues.ValueCase getValueCase(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CommonFieldsProto.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CommonFieldsProto.java new file mode 100644 index 000000000000..b89c943ce988 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CommonFieldsProto.java @@ -0,0 +1,954 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public final class CommonFieldsProto { + private CommonFieldsProto() {} + + 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_apihub_v1_Api_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_Api_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_Api_AttributesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_Api_AttributesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_Version_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_Version_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_Version_AttributesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_Version_AttributesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_Spec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_Spec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_Spec_AttributesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_Spec_AttributesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_Deployment_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_Deployment_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_Deployment_AttributesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_Deployment_AttributesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_ApiOperation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_ApiOperation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_ApiOperation_AttributesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_ApiOperation_AttributesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_Definition_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_Definition_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_Definition_AttributesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_Definition_AttributesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_Attribute_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_Attribute_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_Attribute_AllowedValue_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_Attribute_AllowedValue_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_SpecContents_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_SpecContents_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_SpecDetails_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_SpecDetails_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_OpenApiSpecDetails_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_OpenApiSpecDetails_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_OperationDetails_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_OperationDetails_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_HttpOperation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_HttpOperation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_Path_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_Path_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_Schema_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_Schema_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_Owner_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_Owner_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_Documentation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_Documentation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_AttributeValues_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_AttributeValues_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_AttributeValues_EnumAttributeValues_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_AttributeValues_EnumAttributeValues_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_AttributeValues_StringAttributeValues_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_AttributeValues_StringAttributeValues_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_Dependency_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_Dependency_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_Dependency_AttributesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_Dependency_AttributesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_DependencyEntityReference_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_DependencyEntityReference_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_DependencyErrorDetail_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_DependencyErrorDetail_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_LintResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_LintResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_LintResponse_SummaryEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_LintResponse_SummaryEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_Issue_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_Issue_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_Range_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_Range_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_Point_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_Point_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_OperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_ApiHubInstance_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_ApiHubInstance_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_ApiHubInstance_Config_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_ApiHubInstance_Config_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_ApiHubInstance_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_ApiHubInstance_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_ExternalApi_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_ExternalApi_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_ExternalApi_AttributesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_ExternalApi_AttributesEntry_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/apihub/v1/common_fields.p" + + "roto\022\026google.cloud.apihub.v1\032\037google/api" + + "/field_behavior.proto\032\031google/api/resour" + + "ce.proto\032\037google/protobuf/timestamp.prot" + + "o\"\365\007\n\003Api\022\021\n\004name\030\001 \001(\tB\003\340A\010\022\031\n\014display_" + + "name\030\002 \001(\tB\003\340A\002\022\030\n\013description\030\003 \001(\tB\003\340A" + + "\001\022A\n\rdocumentation\030\004 \001(\0132%.google.cloud." + + "apihub.v1.DocumentationB\003\340A\001\0221\n\005owner\030\005 " + + "\001(\0132\035.google.cloud.apihub.v1.OwnerB\003\340A\001\022" + + "7\n\010versions\030\006 \003(\tB%\340A\003\372A\037\n\035apihub.google" + + "apis.com/Version\0224\n\013create_time\030\007 \001(\0132\032." + + "google.protobuf.TimestampB\003\340A\003\0224\n\013update" + + "_time\030\010 \001(\0132\032.google.protobuf.TimestampB" + + "\003\340A\003\022A\n\013target_user\030\t \001(\0132\'.google.cloud" + + ".apihub.v1.AttributeValuesB\003\340A\001\022:\n\004team\030" + + "\n \001(\0132\'.google.cloud.apihub.v1.Attribute" + + "ValuesB\003\340A\001\022C\n\rbusiness_unit\030\013 \001(\0132\'.goo" + + "gle.cloud.apihub.v1.AttributeValuesB\003\340A\001" + + "\022D\n\016maturity_level\030\014 \001(\0132\'.google.cloud." + + "apihub.v1.AttributeValuesB\003\340A\001\022D\n\nattrib" + + "utes\030\r \003(\0132+.google.cloud.apihub.v1.Api." + + "AttributesEntryB\003\340A\001\022?\n\tapi_style\030\016 \001(\0132" + + "\'.google.cloud.apihub.v1.AttributeValues" + + "B\003\340A\001\022?\n\020selected_version\030\017 \001(\tB%\340A\001\372A\037\n" + + "\035apihub.googleapis.com/Version\032Z\n\017Attrib" + + "utesEntry\022\013\n\003key\030\001 \001(\t\0226\n\005value\030\002 \001(\0132\'." + + "google.cloud.apihub.v1.AttributeValues:\002" + + "8\001:]\352AZ\n\031apihub.googleapis.com/Api\0222proj" + + "ects/{project}/locations/{location}/apis" + + "/{api}*\004apis2\003api\"\250\010\n\007Version\022\021\n\004name\030\001 " + + "\001(\tB\003\340A\010\022\031\n\014display_name\030\002 \001(\tB\003\340A\002\022\030\n\013d" + + "escription\030\003 \001(\tB\003\340A\001\022A\n\rdocumentation\030\004" + + " \001(\0132%.google.cloud.apihub.v1.Documentat" + + "ionB\003\340A\001\0221\n\005specs\030\005 \003(\tB\"\340A\003\372A\034\n\032apihub." + + "googleapis.com/Spec\022B\n\016api_operations\030\006 " + + "\003(\tB*\340A\003\372A$\n\"apihub.googleapis.com/ApiOp" + + "eration\022=\n\013definitions\030\007 \003(\tB(\340A\003\372A\"\n ap" + + "ihub.googleapis.com/Definition\022=\n\013deploy" + + "ments\030\010 \003(\tB(\340A\001\372A\"\n apihub.googleapis.c" + + "om/Deployment\0224\n\013create_time\030\t \001(\0132\032.goo" + + "gle.protobuf.TimestampB\003\340A\003\0224\n\013update_ti" + + "me\030\n \001(\0132\032.google.protobuf.TimestampB\003\340A" + + "\003\022?\n\tlifecycle\030\013 \001(\0132\'.google.cloud.apih" + + "ub.v1.AttributeValuesB\003\340A\001\022@\n\ncompliance" + + "\030\014 \001(\0132\'.google.cloud.apihub.v1.Attribut" + + "eValuesB\003\340A\001\022C\n\raccreditation\030\r \001(\0132\'.go" + + "ogle.cloud.apihub.v1.AttributeValuesB\003\340A" + + "\001\022H\n\nattributes\030\016 \003(\0132/.google.cloud.api" + + "hub.v1.Version.AttributesEntryB\003\340A\001\022E\n\023s" + + "elected_deployment\030\020 \001(\tB(\340A\001\372A\"\n apihub" + + ".googleapis.com/Deployment\032Z\n\017Attributes" + + "Entry\022\013\n\003key\030\001 \001(\t\0226\n\005value\030\002 \001(\0132\'.goog" + + "le.cloud.apihub.v1.AttributeValues:\0028\001:|" + + "\352Ay\n\035apihub.googleapis.com/Version\022Eproj" + + "ects/{project}/locations/{location}/apis" + + "/{api}/versions/{version}*\010versions2\007ver" + + "sion\"\256\007\n\004Spec\022\021\n\004name\030\001 \001(\tB\003\340A\010\022\031\n\014disp" + + "lay_name\030\002 \001(\tB\003\340A\002\022?\n\tspec_type\030\003 \001(\0132\'" + + ".google.cloud.apihub.v1.AttributeValuesB" + + "\003\340A\002\022>\n\010contents\030\004 \001(\0132$.google.cloud.ap" + + "ihub.v1.SpecContentsB\006\340A\001\340A\004\0229\n\007details\030" + + "\005 \001(\0132#.google.cloud.apihub.v1.SpecDetai" + + "lsB\003\340A\003\022\027\n\nsource_uri\030\006 \001(\tB\003\340A\001\0224\n\013crea" + + "te_time\030\007 \001(\0132\032.google.protobuf.Timestam" + + "pB\003\340A\003\0224\n\013update_time\030\010 \001(\0132\032.google.pro" + + "tobuf.TimestampB\003\340A\003\022@\n\rlint_response\030\t " + + "\001(\0132$.google.cloud.apihub.v1.LintRespons" + + "eB\003\340A\001\022E\n\nattributes\030\n \003(\0132,.google.clou" + + "d.apihub.v1.Spec.AttributesEntryB\003\340A\001\022A\n" + + "\rdocumentation\030\013 \001(\0132%.google.cloud.apih" + + "ub.v1.DocumentationB\003\340A\001\022F\n\014parsing_mode" + + "\030\014 \001(\0162(.google.cloud.apihub.v1.Spec.Par" + + "singModeB\006\340A\001\340A\004\032Z\n\017AttributesEntry\022\013\n\003k" + + "ey\030\001 \001(\t\0226\n\005value\030\002 \001(\0132\'.google.cloud.a" + + "pihub.v1.AttributeValues:\0028\001\"D\n\013ParsingM" + + "ode\022\034\n\030PARSING_MODE_UNSPECIFIED\020\000\022\013\n\007REL" + + "AXED\020\001\022\n\n\006STRICT\020\002:\200\001\352A}\n\032apihub.googlea" + + "pis.com/Spec\022Rprojects/{project}/locatio" + + "ns/{location}/apis/{api}/versions/{versi" + + "on}/specs/{spec}*\005specs2\004spec\"\302\006\n\nDeploy" + + "ment\022\021\n\004name\030\001 \001(\tB\003\340A\010\022\031\n\014display_name\030" + + "\002 \001(\tB\003\340A\002\022\030\n\013description\030\003 \001(\tB\003\340A\001\022A\n\r" + + "documentation\030\004 \001(\0132%.google.cloud.apihu" + + "b.v1.DocumentationB\003\340A\001\022E\n\017deployment_ty" + + "pe\030\005 \001(\0132\'.google.cloud.apihub.v1.Attrib" + + "uteValuesB\003\340A\002\022\031\n\014resource_uri\030\006 \001(\tB\003\340A" + + "\002\022\026\n\tendpoints\030\007 \003(\tB\003\340A\002\022\031\n\014api_version" + + "s\030\010 \003(\tB\003\340A\003\0224\n\013create_time\030\t \001(\0132\032.goog" + + "le.protobuf.TimestampB\003\340A\003\0224\n\013update_tim" + + "e\030\n \001(\0132\032.google.protobuf.TimestampB\003\340A\003" + + "\0229\n\003slo\030\013 \001(\0132\'.google.cloud.apihub.v1.A" + + "ttributeValuesB\003\340A\001\022A\n\013environment\030\014 \001(\013" + + "2\'.google.cloud.apihub.v1.AttributeValue" + + "sB\003\340A\001\022K\n\nattributes\030\r \003(\01322.google.clou" + + "d.apihub.v1.Deployment.AttributesEntryB\003" + + "\340A\001\032Z\n\017AttributesEntry\022\013\n\003key\030\001 \001(\t\0226\n\005v" + + "alue\030\002 \001(\0132\'.google.cloud.apihub.v1.Attr" + + "ibuteValues:\0028\001:\200\001\352A}\n apihub.googleapis" + + ".com/Deployment\022@projects/{project}/loca" + + "tions/{location}/deployments/{deployment" + + "}*\013deployments2\ndeployment\"\320\004\n\014ApiOperat" + + "ion\022\021\n\004name\030\001 \001(\tB\003\340A\010\0220\n\004spec\030\002 \001(\tB\"\340A" + + "\003\372A\034\n\032apihub.googleapis.com/Spec\022>\n\007deta" + + "ils\030\003 \001(\0132(.google.cloud.apihub.v1.Opera" + + "tionDetailsB\003\340A\003\0224\n\013create_time\030\004 \001(\0132\032." + + "google.protobuf.TimestampB\003\340A\003\0224\n\013update" + + "_time\030\005 \001(\0132\032.google.protobuf.TimestampB" + + "\003\340A\003\022M\n\nattributes\030\006 \003(\01324.google.cloud." + + "apihub.v1.ApiOperation.AttributesEntryB\003" + + "\340A\001\032Z\n\017AttributesEntry\022\013\n\003key\030\001 \001(\t\0226\n\005v" + + "alue\030\002 \001(\0132\'.google.cloud.apihub.v1.Attr" + + "ibuteValues:\0028\001:\243\001\352A\237\001\n\"apihub.googleapi" + + "s.com/ApiOperation\022\\projects/{project}/l" + + "ocations/{location}/apis/{api}/versions/" + + "{version}/operations/{operation}*\rapiOpe" + + "rations2\014apiOperation\"\256\005\n\nDefinition\0225\n\006" + + "schema\030\004 \001(\0132\036.google.cloud.apihub.v1.Sc" + + "hemaB\003\340A\003H\000\022\021\n\004name\030\001 \001(\tB\003\340A\010\0220\n\004spec\030\002" + + " \001(\tB\"\340A\003\372A\034\n\032apihub.googleapis.com/Spec" + + "\022:\n\004type\030\003 \001(\0162\'.google.cloud.apihub.v1." + + "Definition.TypeB\003\340A\003\0224\n\013create_time\030\005 \001(" + + "\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n\013up" + + "date_time\030\006 \001(\0132\032.google.protobuf.Timest" + + "ampB\003\340A\003\022K\n\nattributes\030\007 \003(\01322.google.cl" + + "oud.apihub.v1.Definition.AttributesEntry" + + "B\003\340A\001\032Z\n\017AttributesEntry\022\013\n\003key\030\001 \001(\t\0226\n" + + "\005value\030\002 \001(\0132\'.google.cloud.apihub.v1.At" + + "tributeValues:\0028\001\"(\n\004Type\022\024\n\020TYPE_UNSPEC" + + "IFIED\020\000\022\n\n\006SCHEMA\020\001:\237\001\352A\233\001\n apihub.googl" + + "eapis.com/Definition\022^projects/{project}" + + "/locations/{location}/apis/{api}/version" + + "s/{version}/definitions/{definition}*\013de" + + "finitions2\ndefinitionB\007\n\005value\"\274\010\n\tAttri" + + "bute\022\021\n\004name\030\001 \001(\tB\003\340A\010\022\031\n\014display_name\030" + + "\002 \001(\tB\003\340A\002\022\030\n\013description\030\003 \001(\tB\003\340A\001\022N\n\017" + + "definition_type\030\004 \001(\01620.google.cloud.api" + + "hub.v1.Attribute.DefinitionTypeB\003\340A\003\022;\n\005" + + "scope\030\005 \001(\0162\'.google.cloud.apihub.v1.Att" + + "ribute.ScopeB\003\340A\002\022B\n\tdata_type\030\006 \001(\0162*.g" + + "oogle.cloud.apihub.v1.Attribute.DataType" + + "B\003\340A\002\022K\n\016allowed_values\030\007 \003(\0132..google.c" + + "loud.apihub.v1.Attribute.AllowedValueB\003\340" + + "A\001\022\030\n\013cardinality\030\010 \001(\005B\003\340A\001\022\026\n\tmandator" + + "y\030\t \001(\010B\003\340A\003\0224\n\013create_time\030\n \001(\0132\032.goog" + + "le.protobuf.TimestampB\003\340A\003\0224\n\013update_tim" + + "e\030\013 \001(\0132\032.google.protobuf.TimestampB\003\340A\003" + + "\032l\n\014AllowedValue\022\017\n\002id\030\001 \001(\tB\003\340A\002\022\031\n\014dis" + + "play_name\030\002 \001(\tB\003\340A\002\022\030\n\013description\030\003 \001(" + + "\tB\003\340A\001\022\026\n\timmutable\030\004 \001(\010B\003\340A\001\"W\n\016Defini" + + "tionType\022\037\n\033DEFINITION_TYPE_UNSPECIFIED\020" + + "\000\022\022\n\016SYSTEM_DEFINED\020\001\022\020\n\014USER_DEFINED\020\002\"" + + "\237\001\n\005Scope\022\025\n\021SCOPE_UNSPECIFIED\020\000\022\007\n\003API\020" + + "\001\022\013\n\007VERSION\020\002\022\010\n\004SPEC\020\003\022\021\n\rAPI_OPERATIO" + + "N\020\004\022\016\n\nDEPLOYMENT\020\005\022\016\n\nDEPENDENCY\020\006\022\016\n\nD" + + "EFINITION\020\007\022\020\n\014EXTERNAL_API\020\010\022\n\n\006PLUGIN\020" + + "\t\"E\n\010DataType\022\031\n\025DATA_TYPE_UNSPECIFIED\020\000" + + "\022\010\n\004ENUM\020\001\022\010\n\004JSON\020\002\022\n\n\006STRING\020\003:{\352Ax\n\037a" + + "pihub.googleapis.com/Attribute\022>projects" + + "/{project}/locations/{location}/attribut" + + "es/{attribute}*\nattributes2\tattribute\"=\n" + + "\014SpecContents\022\025\n\010contents\030\001 \001(\014B\003\340A\002\022\026\n\t" + + "mime_type\030\002 \001(\tB\003\340A\002\"\204\001\n\013SpecDetails\022P\n\025" + + "open_api_spec_details\030\002 \001(\0132*.google.clo" + + "ud.apihub.v1.OpenApiSpecDetailsB\003\340A\003H\000\022\030" + + "\n\013description\030\001 \001(\tB\003\340A\003B\t\n\007details\"\214\002\n\022" + + "OpenApiSpecDetails\022F\n\006format\030\001 \001(\01621.goo" + + "gle.cloud.apihub.v1.OpenApiSpecDetails.F" + + "ormatB\003\340A\003\022\024\n\007version\030\002 \001(\tB\003\340A\003\0221\n\005owne" + + "r\030\003 \001(\0132\035.google.cloud.apihub.v1.OwnerB\003" + + "\340A\003\"e\n\006Format\022\026\n\022FORMAT_UNSPECIFIED\020\000\022\025\n" + + "\021OPEN_API_SPEC_2_0\020\001\022\025\n\021OPEN_API_SPEC_3_" + + "0\020\002\022\025\n\021OPEN_API_SPEC_3_1\020\003\"\326\001\n\020Operation" + + "Details\022?\n\016http_operation\030\004 \001(\0132%.google" + + ".cloud.apihub.v1.HttpOperationH\000\022\030\n\013desc" + + "ription\030\001 \001(\tB\003\340A\003\022A\n\rdocumentation\030\002 \001(" + + "\0132%.google.cloud.apihub.v1.Documentation" + + "B\003\340A\003\022\027\n\ndeprecated\030\003 \001(\010B\003\340A\003B\013\n\toperat" + + "ion\"\372\001\n\rHttpOperation\022/\n\004path\030\001 \001(\0132\034.go" + + "ogle.cloud.apihub.v1.PathB\003\340A\003\022A\n\006method" + + "\030\002 \001(\0162,.google.cloud.apihub.v1.HttpOper" + + "ation.MethodB\003\340A\003\"u\n\006Method\022\026\n\022METHOD_UN" + + "SPECIFIED\020\000\022\007\n\003GET\020\001\022\007\n\003PUT\020\002\022\010\n\004POST\020\003\022" + + "\n\n\006DELETE\020\004\022\013\n\007OPTIONS\020\005\022\010\n\004HEAD\020\006\022\t\n\005PA" + + "TCH\020\007\022\t\n\005TRACE\020\010\"3\n\004Path\022\021\n\004path\030\001 \001(\tB\003" + + "\340A\003\022\030\n\013description\030\002 \001(\tB\003\340A\003\";\n\006Schema\022" + + "\031\n\014display_name\030\001 \001(\tB\003\340A\003\022\026\n\traw_value\030" + + "\002 \001(\014B\003\340A\003\"6\n\005Owner\022\031\n\014display_name\030\001 \001(" + + "\tB\003\340A\001\022\022\n\005email\030\002 \001(\tB\003\340A\002\"*\n\rDocumentat" + + "ion\022\031\n\014external_uri\030\001 \001(\tB\003\340A\001\"\342\003\n\017Attri" + + "buteValues\022R\n\013enum_values\030\002 \001(\0132;.google" + + ".cloud.apihub.v1.AttributeValues.EnumAtt" + + "ributeValuesH\000\022V\n\rstring_values\030\003 \001(\0132=." + + "google.cloud.apihub.v1.AttributeValues.S" + + "tringAttributeValuesH\000\022T\n\013json_values\030\004 " + + "\001(\0132=.google.cloud.apihub.v1.AttributeVa" + + "lues.StringAttributeValuesH\000\022:\n\tattribut" + + "e\030\001 \001(\tB\'\340A\003\372A!\n\037apihub.googleapis.com/A" + + "ttribute\032Z\n\023EnumAttributeValues\022C\n\006value" + + "s\030\001 \003(\0132..google.cloud.apihub.v1.Attribu" + + "te.AllowedValueB\003\340A\002\032,\n\025StringAttributeV" + + "alues\022\023\n\006values\030\001 \003(\tB\003\340A\002B\007\n\005Value\"\276\007\n\n" + + "Dependency\022\021\n\004name\030\001 \001(\tB\003\340A\010\022K\n\010consume" + + "r\030\002 \001(\01321.google.cloud.apihub.v1.Depende" + + "ncyEntityReferenceB\006\340A\005\340A\002\022K\n\010supplier\030\003" + + " \001(\01321.google.cloud.apihub.v1.Dependency" + + "EntityReferenceB\006\340A\005\340A\002\022<\n\005state\030\004 \001(\0162(" + + ".google.cloud.apihub.v1.Dependency.State" + + "B\003\340A\003\022\030\n\013description\030\005 \001(\tB\003\340A\001\022M\n\016disco" + + "very_mode\030\006 \001(\01620.google.cloud.apihub.v1" + + ".Dependency.DiscoveryModeB\003\340A\003\022H\n\014error_" + + "detail\030\007 \001(\0132-.google.cloud.apihub.v1.De" + + "pendencyErrorDetailB\003\340A\003\0224\n\013create_time\030" + + "\010 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0224" + + "\n\013update_time\030\t \001(\0132\032.google.protobuf.Ti" + + "mestampB\003\340A\003\022K\n\nattributes\030\n \003(\01322.googl" + + "e.cloud.apihub.v1.Dependency.AttributesE" + + "ntryB\003\340A\001\032Z\n\017AttributesEntry\022\013\n\003key\030\001 \001(" + + "\t\0226\n\005value\030\002 \001(\0132\'.google.cloud.apihub.v" + + "1.AttributeValues:\0028\001\";\n\005State\022\025\n\021STATE_" + + "UNSPECIFIED\020\000\022\014\n\010PROPOSED\020\001\022\r\n\tVALIDATED" + + "\020\002\";\n\rDiscoveryMode\022\036\n\032DISCOVERY_MODE_UN" + + "SPECIFIED\020\000\022\n\n\006MANUAL\020\001:\202\001\352A\177\n apihub.go" + + "ogleapis.com/Dependency\022Aprojects/{proje" + + "ct}/locations/{location}/dependencies/{d" + + "ependency}*\014dependencies2\ndependency\"\215\001\n" + + "\031DependencyEntityReference\022!\n\027operation_" + + "resource_name\030\002 \001(\tH\000\022$\n\032external_api_re" + + "source_name\030\003 \001(\tH\000\022\031\n\014display_name\030\001 \001(" + + "\tB\003\340A\003B\014\n\nidentifier\"\345\001\n\025DependencyError" + + "Detail\022G\n\005error\030\001 \001(\01623.google.cloud.api" + + "hub.v1.DependencyErrorDetail.ErrorB\003\340A\001\022" + + "3\n\nerror_time\030\002 \001(\0132\032.google.protobuf.Ti" + + "mestampB\003\340A\001\"N\n\005Error\022\025\n\021ERROR_UNSPECIFI" + + "ED\020\000\022\026\n\022SUPPLIER_NOT_FOUND\020\001\022\026\n\022SUPPLIER" + + "_RECREATED\020\002\"\237\003\n\014LintResponse\0222\n\006issues\030" + + "\001 \003(\0132\035.google.cloud.apihub.v1.IssueB\003\340A" + + "\001\022G\n\007summary\030\002 \003(\01321.google.cloud.apihub" + + ".v1.LintResponse.SummaryEntryB\003\340A\001\0225\n\005st" + + "ate\030\003 \001(\0162!.google.cloud.apihub.v1.LintS" + + "tateB\003\340A\002\022\023\n\006source\030\004 \001(\tB\003\340A\002\0223\n\006linter" + + "\030\005 \001(\0162\036.google.cloud.apihub.v1.LinterB\003" + + "\340A\002\0224\n\013create_time\030\006 \001(\0132\032.google.protob" + + "uf.TimestampB\003\340A\002\032[\n\014SummaryEntry\0227\n\010sev" + + "erity\030\001 \001(\0162 .google.cloud.apihub.v1.Sev" + + "erityB\003\340A\002\022\022\n\005count\030\002 \001(\005B\003\340A\002\"\257\001\n\005Issue" + + "\022\021\n\004code\030\001 \001(\tB\003\340A\002\022\021\n\004path\030\002 \003(\tB\003\340A\002\022\024" + + "\n\007message\030\003 \001(\tB\003\340A\002\0227\n\010severity\030\004 \001(\0162 " + + ".google.cloud.apihub.v1.SeverityB\003\340A\002\0221\n" + + "\005range\030\005 \001(\0132\035.google.cloud.apihub.v1.Ra" + + "ngeB\003\340A\002\"k\n\005Range\0221\n\005start\030\001 \001(\0132\035.googl" + + "e.cloud.apihub.v1.PointB\003\340A\002\022/\n\003end\030\002 \001(" + + "\0132\035.google.cloud.apihub.v1.PointB\003\340A\002\"2\n" + + "\005Point\022\021\n\004line\030\001 \001(\005B\003\340A\002\022\026\n\tcharacter\030\002" + + " \001(\005B\003\340A\002\"\200\002\n\021OperationMetadata\0224\n\013creat" + + "e_time\030\001 \001(\0132\032.google.protobuf.Timestamp" + + "B\003\340A\003\0221\n\010end_time\030\002 \001(\0132\032.google.protobu" + + "f.TimestampB\003\340A\003\022\023\n\006target\030\003 \001(\tB\003\340A\003\022\021\n" + + "\004verb\030\004 \001(\tB\003\340A\003\022\033\n\016status_message\030\005 \001(\t" + + "B\003\340A\003\022#\n\026requested_cancellation\030\006 \001(\010B\003\340" + + "A\003\022\030\n\013api_version\030\007 \001(\tB\003\340A\003\"\363\005\n\016ApiHubI" + + "nstance\022\021\n\004name\030\001 \001(\tB\003\340A\010\0224\n\013create_tim" + + "e\030\002 \001(\0132\032.google.protobuf.TimestampB\003\340A\003" + + "\0224\n\013update_time\030\003 \001(\0132\032.google.protobuf." + + "TimestampB\003\340A\003\022@\n\005state\030\004 \001(\0162,.google.c" + + "loud.apihub.v1.ApiHubInstance.StateB\003\340A\003" + + "\022\032\n\rstate_message\030\005 \001(\tB\003\340A\003\022B\n\006config\030\006" + + " \001(\0132-.google.cloud.apihub.v1.ApiHubInst" + + "ance.ConfigB\003\340A\002\022G\n\006labels\030\007 \003(\01322.googl" + + "e.cloud.apihub.v1.ApiHubInstance.LabelsE" + + "ntryB\003\340A\001\022\030\n\013description\030\010 \001(\tB\003\340A\001\032$\n\006C" + + "onfig\022\032\n\rcmek_key_name\030\001 \001(\tB\003\340A\002\032-\n\013Lab" + + "elsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001" + + "\"n\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\014\n\010INAC" + + "TIVE\020\001\022\014\n\010CREATING\020\002\022\n\n\006ACTIVE\020\003\022\014\n\010UPDA" + + "TING\020\004\022\014\n\010DELETING\020\005\022\n\n\006FAILED\020\006:\227\001\352A\223\001\n" + + "$apihub.googleapis.com/ApiHubInstance\022Jp" + + "rojects/{project}/locations/{location}/a" + + "piHubInstances/{api_hub_instance}*\017apiHu" + + "bInstances2\016apiHubInstance\"\344\004\n\013ExternalA" + + "pi\022\021\n\004name\030\001 \001(\tB\003\340A\010\022\031\n\014display_name\030\002 " + + "\001(\tB\003\340A\002\022\030\n\013description\030\003 \001(\tB\003\340A\001\022\026\n\ten" + + "dpoints\030\004 \003(\tB\003\340A\001\022\022\n\005paths\030\005 \003(\tB\003\340A\001\022A" + + "\n\rdocumentation\030\006 \001(\0132%.google.cloud.api" + + "hub.v1.DocumentationB\003\340A\001\022L\n\nattributes\030" + + "\007 \003(\01323.google.cloud.apihub.v1.ExternalA" + + "pi.AttributesEntryB\003\340A\001\0224\n\013create_time\030\010" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n" + + "\013update_time\030\t \001(\0132\032.google.protobuf.Tim" + + "estampB\003\340A\003\032Z\n\017AttributesEntry\022\013\n\003key\030\001 " + + "\001(\t\0226\n\005value\030\002 \001(\0132\'.google.cloud.apihub" + + ".v1.AttributeValues:\0028\001:\207\001\352A\203\001\n!apihub.g" + + "oogleapis.com/ExternalApi\022Cprojects/{pro" + + "ject}/locations/{location}/externalApis/" + + "{external_api}*\014externalApis2\013externalAp" + + "i*U\n\tLintState\022\032\n\026LINT_STATE_UNSPECIFIED" + + "\020\000\022\026\n\022LINT_STATE_SUCCESS\020\001\022\024\n\020LINT_STATE" + + "_ERROR\020\002*9\n\006Linter\022\026\n\022LINTER_UNSPECIFIED" + + "\020\000\022\014\n\010SPECTRAL\020\001\022\t\n\005OTHER\020\002*t\n\010Severity\022" + + "\030\n\024SEVERITY_UNSPECIFIED\020\000\022\022\n\016SEVERITY_ER" + + "ROR\020\001\022\024\n\020SEVERITY_WARNING\020\002\022\021\n\rSEVERITY_" + + "INFO\020\003\022\021\n\rSEVERITY_HINT\020\004B\233\002\n\032com.google" + + ".cloud.apihub.v1B\021CommonFieldsProtoP\001Z2c" + + "loud.google.com/go/apihub/apiv1/apihubpb" + + ";apihubpb\252\002\026Google.Cloud.ApiHub.V1\312\002\026Goo" + + "gle\\Cloud\\ApiHub\\V1\352\002\031Google::Cloud::Api" + + "Hub::V1\352Ae\n#aiplatform.googleapis.com/Ex" + + "tension\022>projects/{project}/locations/{l" + + "ocation}/extensions/{extension}b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_apihub_v1_Api_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_apihub_v1_Api_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_Api_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "Description", + "Documentation", + "Owner", + "Versions", + "CreateTime", + "UpdateTime", + "TargetUser", + "Team", + "BusinessUnit", + "MaturityLevel", + "Attributes", + "ApiStyle", + "SelectedVersion", + }); + internal_static_google_cloud_apihub_v1_Api_AttributesEntry_descriptor = + internal_static_google_cloud_apihub_v1_Api_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_apihub_v1_Api_AttributesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_Api_AttributesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_apihub_v1_Version_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_apihub_v1_Version_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_Version_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "Description", + "Documentation", + "Specs", + "ApiOperations", + "Definitions", + "Deployments", + "CreateTime", + "UpdateTime", + "Lifecycle", + "Compliance", + "Accreditation", + "Attributes", + "SelectedDeployment", + }); + internal_static_google_cloud_apihub_v1_Version_AttributesEntry_descriptor = + internal_static_google_cloud_apihub_v1_Version_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_apihub_v1_Version_AttributesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_Version_AttributesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_apihub_v1_Spec_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_apihub_v1_Spec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_Spec_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "SpecType", + "Contents", + "Details", + "SourceUri", + "CreateTime", + "UpdateTime", + "LintResponse", + "Attributes", + "Documentation", + "ParsingMode", + }); + internal_static_google_cloud_apihub_v1_Spec_AttributesEntry_descriptor = + internal_static_google_cloud_apihub_v1_Spec_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_apihub_v1_Spec_AttributesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_Spec_AttributesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_apihub_v1_Deployment_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_apihub_v1_Deployment_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_Deployment_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "Description", + "Documentation", + "DeploymentType", + "ResourceUri", + "Endpoints", + "ApiVersions", + "CreateTime", + "UpdateTime", + "Slo", + "Environment", + "Attributes", + }); + internal_static_google_cloud_apihub_v1_Deployment_AttributesEntry_descriptor = + internal_static_google_cloud_apihub_v1_Deployment_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_apihub_v1_Deployment_AttributesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_Deployment_AttributesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_apihub_v1_ApiOperation_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_apihub_v1_ApiOperation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_ApiOperation_descriptor, + new java.lang.String[] { + "Name", "Spec", "Details", "CreateTime", "UpdateTime", "Attributes", + }); + internal_static_google_cloud_apihub_v1_ApiOperation_AttributesEntry_descriptor = + internal_static_google_cloud_apihub_v1_ApiOperation_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_apihub_v1_ApiOperation_AttributesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_ApiOperation_AttributesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_apihub_v1_Definition_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_apihub_v1_Definition_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_Definition_descriptor, + new java.lang.String[] { + "Schema", "Name", "Spec", "Type", "CreateTime", "UpdateTime", "Attributes", "Value", + }); + internal_static_google_cloud_apihub_v1_Definition_AttributesEntry_descriptor = + internal_static_google_cloud_apihub_v1_Definition_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_apihub_v1_Definition_AttributesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_Definition_AttributesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_apihub_v1_Attribute_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_apihub_v1_Attribute_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_Attribute_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "Description", + "DefinitionType", + "Scope", + "DataType", + "AllowedValues", + "Cardinality", + "Mandatory", + "CreateTime", + "UpdateTime", + }); + internal_static_google_cloud_apihub_v1_Attribute_AllowedValue_descriptor = + internal_static_google_cloud_apihub_v1_Attribute_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_apihub_v1_Attribute_AllowedValue_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_Attribute_AllowedValue_descriptor, + new java.lang.String[] { + "Id", "DisplayName", "Description", "Immutable", + }); + internal_static_google_cloud_apihub_v1_SpecContents_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_apihub_v1_SpecContents_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_SpecContents_descriptor, + new java.lang.String[] { + "Contents", "MimeType", + }); + internal_static_google_cloud_apihub_v1_SpecDetails_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_apihub_v1_SpecDetails_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_SpecDetails_descriptor, + new java.lang.String[] { + "OpenApiSpecDetails", "Description", "Details", + }); + internal_static_google_cloud_apihub_v1_OpenApiSpecDetails_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_apihub_v1_OpenApiSpecDetails_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_OpenApiSpecDetails_descriptor, + new java.lang.String[] { + "Format", "Version", "Owner", + }); + internal_static_google_cloud_apihub_v1_OperationDetails_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_apihub_v1_OperationDetails_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_OperationDetails_descriptor, + new java.lang.String[] { + "HttpOperation", "Description", "Documentation", "Deprecated", "Operation", + }); + internal_static_google_cloud_apihub_v1_HttpOperation_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_apihub_v1_HttpOperation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_HttpOperation_descriptor, + new java.lang.String[] { + "Path", "Method", + }); + internal_static_google_cloud_apihub_v1_Path_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_apihub_v1_Path_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_Path_descriptor, + new java.lang.String[] { + "Path", "Description", + }); + internal_static_google_cloud_apihub_v1_Schema_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_apihub_v1_Schema_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_Schema_descriptor, + new java.lang.String[] { + "DisplayName", "RawValue", + }); + internal_static_google_cloud_apihub_v1_Owner_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_apihub_v1_Owner_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_Owner_descriptor, + new java.lang.String[] { + "DisplayName", "Email", + }); + internal_static_google_cloud_apihub_v1_Documentation_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_apihub_v1_Documentation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_Documentation_descriptor, + new java.lang.String[] { + "ExternalUri", + }); + internal_static_google_cloud_apihub_v1_AttributeValues_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_apihub_v1_AttributeValues_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_AttributeValues_descriptor, + new java.lang.String[] { + "EnumValues", "StringValues", "JsonValues", "Attribute", "Value", + }); + internal_static_google_cloud_apihub_v1_AttributeValues_EnumAttributeValues_descriptor = + internal_static_google_cloud_apihub_v1_AttributeValues_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_apihub_v1_AttributeValues_EnumAttributeValues_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_AttributeValues_EnumAttributeValues_descriptor, + new java.lang.String[] { + "Values", + }); + internal_static_google_cloud_apihub_v1_AttributeValues_StringAttributeValues_descriptor = + internal_static_google_cloud_apihub_v1_AttributeValues_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_apihub_v1_AttributeValues_StringAttributeValues_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_AttributeValues_StringAttributeValues_descriptor, + new java.lang.String[] { + "Values", + }); + internal_static_google_cloud_apihub_v1_Dependency_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_apihub_v1_Dependency_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_Dependency_descriptor, + new java.lang.String[] { + "Name", + "Consumer", + "Supplier", + "State", + "Description", + "DiscoveryMode", + "ErrorDetail", + "CreateTime", + "UpdateTime", + "Attributes", + }); + internal_static_google_cloud_apihub_v1_Dependency_AttributesEntry_descriptor = + internal_static_google_cloud_apihub_v1_Dependency_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_apihub_v1_Dependency_AttributesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_Dependency_AttributesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_apihub_v1_DependencyEntityReference_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_apihub_v1_DependencyEntityReference_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_DependencyEntityReference_descriptor, + new java.lang.String[] { + "OperationResourceName", "ExternalApiResourceName", "DisplayName", "Identifier", + }); + internal_static_google_cloud_apihub_v1_DependencyErrorDetail_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_cloud_apihub_v1_DependencyErrorDetail_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_DependencyErrorDetail_descriptor, + new java.lang.String[] { + "Error", "ErrorTime", + }); + internal_static_google_cloud_apihub_v1_LintResponse_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_cloud_apihub_v1_LintResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_LintResponse_descriptor, + new java.lang.String[] { + "Issues", "Summary", "State", "Source", "Linter", "CreateTime", + }); + internal_static_google_cloud_apihub_v1_LintResponse_SummaryEntry_descriptor = + internal_static_google_cloud_apihub_v1_LintResponse_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_apihub_v1_LintResponse_SummaryEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_LintResponse_SummaryEntry_descriptor, + new java.lang.String[] { + "Severity", "Count", + }); + internal_static_google_cloud_apihub_v1_Issue_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_cloud_apihub_v1_Issue_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_Issue_descriptor, + new java.lang.String[] { + "Code", "Path", "Message", "Severity", "Range", + }); + internal_static_google_cloud_apihub_v1_Range_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_google_cloud_apihub_v1_Range_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_Range_descriptor, + new java.lang.String[] { + "Start", "End", + }); + internal_static_google_cloud_apihub_v1_Point_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_google_cloud_apihub_v1_Point_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_Point_descriptor, + new java.lang.String[] { + "Line", "Character", + }); + internal_static_google_cloud_apihub_v1_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(24); + internal_static_google_cloud_apihub_v1_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_OperationMetadata_descriptor, + new java.lang.String[] { + "CreateTime", + "EndTime", + "Target", + "Verb", + "StatusMessage", + "RequestedCancellation", + "ApiVersion", + }); + internal_static_google_cloud_apihub_v1_ApiHubInstance_descriptor = + getDescriptor().getMessageTypes().get(25); + internal_static_google_cloud_apihub_v1_ApiHubInstance_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_ApiHubInstance_descriptor, + new java.lang.String[] { + "Name", + "CreateTime", + "UpdateTime", + "State", + "StateMessage", + "Config", + "Labels", + "Description", + }); + internal_static_google_cloud_apihub_v1_ApiHubInstance_Config_descriptor = + internal_static_google_cloud_apihub_v1_ApiHubInstance_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_apihub_v1_ApiHubInstance_Config_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_ApiHubInstance_Config_descriptor, + new java.lang.String[] { + "CmekKeyName", + }); + internal_static_google_cloud_apihub_v1_ApiHubInstance_LabelsEntry_descriptor = + internal_static_google_cloud_apihub_v1_ApiHubInstance_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_apihub_v1_ApiHubInstance_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_ApiHubInstance_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_apihub_v1_ExternalApi_descriptor = + getDescriptor().getMessageTypes().get(26); + internal_static_google_cloud_apihub_v1_ExternalApi_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_ExternalApi_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "Description", + "Endpoints", + "Paths", + "Documentation", + "Attributes", + "CreateTime", + "UpdateTime", + }); + internal_static_google_cloud_apihub_v1_ExternalApi_AttributesEntry_descriptor = + internal_static_google_cloud_apihub_v1_ExternalApi_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_apihub_v1_ExternalApi_AttributesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_ExternalApi_AttributesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceDefinition); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateApiHubInstanceRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateApiHubInstanceRequest.java new file mode 100644 index 000000000000..02ba81262de5 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateApiHubInstanceRequest.java @@ -0,0 +1,1173 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/provisioning_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The
+ * [CreateApiHubInstance][google.cloud.apihub.v1.Provisioning.CreateApiHubInstance]
+ * method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.CreateApiHubInstanceRequest} + */ +public final class CreateApiHubInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.CreateApiHubInstanceRequest) + CreateApiHubInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateApiHubInstanceRequest.newBuilder() to construct. + private CreateApiHubInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateApiHubInstanceRequest() { + parent_ = ""; + apiHubInstanceId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateApiHubInstanceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ProvisioningServiceProto + .internal_static_google_cloud_apihub_v1_CreateApiHubInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ProvisioningServiceProto + .internal_static_google_cloud_apihub_v1_CreateApiHubInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.CreateApiHubInstanceRequest.class, + com.google.cloud.apihub.v1.CreateApiHubInstanceRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent resource for the Api Hub instance resource.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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 parent resource for the Api Hub instance resource.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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 API_HUB_INSTANCE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object apiHubInstanceId_ = ""; + /** + * + * + *
+   * Optional. Identifier to assign to the Api Hub instance. Must be unique
+   * within scope of the parent resource. If the field is not provided, system
+   * generated id will be used.
+   *
+   * This value should be 4-40 characters, and valid characters
+   * are `/[a-z][A-Z][0-9]-_/`.
+   * 
+ * + * string api_hub_instance_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The apiHubInstanceId. + */ + @java.lang.Override + public java.lang.String getApiHubInstanceId() { + java.lang.Object ref = apiHubInstanceId_; + 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(); + apiHubInstanceId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Identifier to assign to the Api Hub instance. Must be unique
+   * within scope of the parent resource. If the field is not provided, system
+   * generated id will be used.
+   *
+   * This value should be 4-40 characters, and valid characters
+   * are `/[a-z][A-Z][0-9]-_/`.
+   * 
+ * + * string api_hub_instance_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for apiHubInstanceId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApiHubInstanceIdBytes() { + java.lang.Object ref = apiHubInstanceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiHubInstanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int API_HUB_INSTANCE_FIELD_NUMBER = 3; + private com.google.cloud.apihub.v1.ApiHubInstance apiHubInstance_; + /** + * + * + *
+   * Required. The ApiHub instance.
+   * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the apiHubInstance field is set. + */ + @java.lang.Override + public boolean hasApiHubInstance() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The ApiHub instance.
+   * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The apiHubInstance. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.ApiHubInstance getApiHubInstance() { + return apiHubInstance_ == null + ? com.google.cloud.apihub.v1.ApiHubInstance.getDefaultInstance() + : apiHubInstance_; + } + /** + * + * + *
+   * Required. The ApiHub instance.
+   * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.ApiHubInstanceOrBuilder getApiHubInstanceOrBuilder() { + return apiHubInstance_ == null + ? com.google.cloud.apihub.v1.ApiHubInstance.getDefaultInstance() + : apiHubInstance_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiHubInstanceId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, apiHubInstanceId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getApiHubInstance()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiHubInstanceId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, apiHubInstanceId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getApiHubInstance()); + } + size += getUnknownFields().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.apihub.v1.CreateApiHubInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.CreateApiHubInstanceRequest other = + (com.google.cloud.apihub.v1.CreateApiHubInstanceRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getApiHubInstanceId().equals(other.getApiHubInstanceId())) return false; + if (hasApiHubInstance() != other.hasApiHubInstance()) return false; + if (hasApiHubInstance()) { + if (!getApiHubInstance().equals(other.getApiHubInstance())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + API_HUB_INSTANCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getApiHubInstanceId().hashCode(); + if (hasApiHubInstance()) { + hash = (37 * hash) + API_HUB_INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getApiHubInstance().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.CreateApiHubInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateApiHubInstanceRequest 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.apihub.v1.CreateApiHubInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateApiHubInstanceRequest 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.apihub.v1.CreateApiHubInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateApiHubInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.CreateApiHubInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateApiHubInstanceRequest 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.apihub.v1.CreateApiHubInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateApiHubInstanceRequest 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.apihub.v1.CreateApiHubInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateApiHubInstanceRequest 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.apihub.v1.CreateApiHubInstanceRequest 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
+   * [CreateApiHubInstance][google.cloud.apihub.v1.Provisioning.CreateApiHubInstance]
+   * method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.CreateApiHubInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.CreateApiHubInstanceRequest) + com.google.cloud.apihub.v1.CreateApiHubInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ProvisioningServiceProto + .internal_static_google_cloud_apihub_v1_CreateApiHubInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ProvisioningServiceProto + .internal_static_google_cloud_apihub_v1_CreateApiHubInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.CreateApiHubInstanceRequest.class, + com.google.cloud.apihub.v1.CreateApiHubInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.CreateApiHubInstanceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getApiHubInstanceFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + apiHubInstanceId_ = ""; + apiHubInstance_ = null; + if (apiHubInstanceBuilder_ != null) { + apiHubInstanceBuilder_.dispose(); + apiHubInstanceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ProvisioningServiceProto + .internal_static_google_cloud_apihub_v1_CreateApiHubInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateApiHubInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.CreateApiHubInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateApiHubInstanceRequest build() { + com.google.cloud.apihub.v1.CreateApiHubInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateApiHubInstanceRequest buildPartial() { + com.google.cloud.apihub.v1.CreateApiHubInstanceRequest result = + new com.google.cloud.apihub.v1.CreateApiHubInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.CreateApiHubInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.apiHubInstanceId_ = apiHubInstanceId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.apiHubInstance_ = + apiHubInstanceBuilder_ == null ? apiHubInstance_ : apiHubInstanceBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.CreateApiHubInstanceRequest) { + return mergeFrom((com.google.cloud.apihub.v1.CreateApiHubInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.CreateApiHubInstanceRequest other) { + if (other == com.google.cloud.apihub.v1.CreateApiHubInstanceRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getApiHubInstanceId().isEmpty()) { + apiHubInstanceId_ = other.apiHubInstanceId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasApiHubInstance()) { + mergeApiHubInstance(other.getApiHubInstance()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + apiHubInstanceId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getApiHubInstanceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource for the Api Hub instance resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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 parent resource for the Api Hub instance resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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 parent resource for the Api Hub instance resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource for the Api Hub instance resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource for the Api Hub instance resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object apiHubInstanceId_ = ""; + /** + * + * + *
+     * Optional. Identifier to assign to the Api Hub instance. Must be unique
+     * within scope of the parent resource. If the field is not provided, system
+     * generated id will be used.
+     *
+     * This value should be 4-40 characters, and valid characters
+     * are `/[a-z][A-Z][0-9]-_/`.
+     * 
+ * + * string api_hub_instance_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The apiHubInstanceId. + */ + public java.lang.String getApiHubInstanceId() { + java.lang.Object ref = apiHubInstanceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiHubInstanceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Identifier to assign to the Api Hub instance. Must be unique
+     * within scope of the parent resource. If the field is not provided, system
+     * generated id will be used.
+     *
+     * This value should be 4-40 characters, and valid characters
+     * are `/[a-z][A-Z][0-9]-_/`.
+     * 
+ * + * string api_hub_instance_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for apiHubInstanceId. + */ + public com.google.protobuf.ByteString getApiHubInstanceIdBytes() { + java.lang.Object ref = apiHubInstanceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiHubInstanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Identifier to assign to the Api Hub instance. Must be unique
+     * within scope of the parent resource. If the field is not provided, system
+     * generated id will be used.
+     *
+     * This value should be 4-40 characters, and valid characters
+     * are `/[a-z][A-Z][0-9]-_/`.
+     * 
+ * + * string api_hub_instance_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The apiHubInstanceId to set. + * @return This builder for chaining. + */ + public Builder setApiHubInstanceId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + apiHubInstanceId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Identifier to assign to the Api Hub instance. Must be unique
+     * within scope of the parent resource. If the field is not provided, system
+     * generated id will be used.
+     *
+     * This value should be 4-40 characters, and valid characters
+     * are `/[a-z][A-Z][0-9]-_/`.
+     * 
+ * + * string api_hub_instance_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearApiHubInstanceId() { + apiHubInstanceId_ = getDefaultInstance().getApiHubInstanceId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Identifier to assign to the Api Hub instance. Must be unique
+     * within scope of the parent resource. If the field is not provided, system
+     * generated id will be used.
+     *
+     * This value should be 4-40 characters, and valid characters
+     * are `/[a-z][A-Z][0-9]-_/`.
+     * 
+ * + * string api_hub_instance_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for apiHubInstanceId to set. + * @return This builder for chaining. + */ + public Builder setApiHubInstanceIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + apiHubInstanceId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.apihub.v1.ApiHubInstance apiHubInstance_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.ApiHubInstance, + com.google.cloud.apihub.v1.ApiHubInstance.Builder, + com.google.cloud.apihub.v1.ApiHubInstanceOrBuilder> + apiHubInstanceBuilder_; + /** + * + * + *
+     * Required. The ApiHub instance.
+     * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the apiHubInstance field is set. + */ + public boolean hasApiHubInstance() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The ApiHub instance.
+     * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The apiHubInstance. + */ + public com.google.cloud.apihub.v1.ApiHubInstance getApiHubInstance() { + if (apiHubInstanceBuilder_ == null) { + return apiHubInstance_ == null + ? com.google.cloud.apihub.v1.ApiHubInstance.getDefaultInstance() + : apiHubInstance_; + } else { + return apiHubInstanceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The ApiHub instance.
+     * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setApiHubInstance(com.google.cloud.apihub.v1.ApiHubInstance value) { + if (apiHubInstanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + apiHubInstance_ = value; + } else { + apiHubInstanceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ApiHub instance.
+     * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setApiHubInstance( + com.google.cloud.apihub.v1.ApiHubInstance.Builder builderForValue) { + if (apiHubInstanceBuilder_ == null) { + apiHubInstance_ = builderForValue.build(); + } else { + apiHubInstanceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ApiHub instance.
+     * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeApiHubInstance(com.google.cloud.apihub.v1.ApiHubInstance value) { + if (apiHubInstanceBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && apiHubInstance_ != null + && apiHubInstance_ != com.google.cloud.apihub.v1.ApiHubInstance.getDefaultInstance()) { + getApiHubInstanceBuilder().mergeFrom(value); + } else { + apiHubInstance_ = value; + } + } else { + apiHubInstanceBuilder_.mergeFrom(value); + } + if (apiHubInstance_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The ApiHub instance.
+     * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearApiHubInstance() { + bitField0_ = (bitField0_ & ~0x00000004); + apiHubInstance_ = null; + if (apiHubInstanceBuilder_ != null) { + apiHubInstanceBuilder_.dispose(); + apiHubInstanceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ApiHub instance.
+     * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.ApiHubInstance.Builder getApiHubInstanceBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getApiHubInstanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The ApiHub instance.
+     * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.ApiHubInstanceOrBuilder getApiHubInstanceOrBuilder() { + if (apiHubInstanceBuilder_ != null) { + return apiHubInstanceBuilder_.getMessageOrBuilder(); + } else { + return apiHubInstance_ == null + ? com.google.cloud.apihub.v1.ApiHubInstance.getDefaultInstance() + : apiHubInstance_; + } + } + /** + * + * + *
+     * Required. The ApiHub instance.
+     * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.ApiHubInstance, + com.google.cloud.apihub.v1.ApiHubInstance.Builder, + com.google.cloud.apihub.v1.ApiHubInstanceOrBuilder> + getApiHubInstanceFieldBuilder() { + if (apiHubInstanceBuilder_ == null) { + apiHubInstanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.ApiHubInstance, + com.google.cloud.apihub.v1.ApiHubInstance.Builder, + com.google.cloud.apihub.v1.ApiHubInstanceOrBuilder>( + getApiHubInstance(), getParentForChildren(), isClean()); + apiHubInstance_ = null; + } + return apiHubInstanceBuilder_; + } + + @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.apihub.v1.CreateApiHubInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.CreateApiHubInstanceRequest) + private static final com.google.cloud.apihub.v1.CreateApiHubInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.CreateApiHubInstanceRequest(); + } + + public static com.google.cloud.apihub.v1.CreateApiHubInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateApiHubInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.CreateApiHubInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateApiHubInstanceRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateApiHubInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..2bbf0407bf3b --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateApiHubInstanceRequestOrBuilder.java @@ -0,0 +1,133 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/provisioning_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface CreateApiHubInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.CreateApiHubInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource for the Api Hub instance resource.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource for the Api Hub instance resource.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Identifier to assign to the Api Hub instance. Must be unique
+   * within scope of the parent resource. If the field is not provided, system
+   * generated id will be used.
+   *
+   * This value should be 4-40 characters, and valid characters
+   * are `/[a-z][A-Z][0-9]-_/`.
+   * 
+ * + * string api_hub_instance_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The apiHubInstanceId. + */ + java.lang.String getApiHubInstanceId(); + /** + * + * + *
+   * Optional. Identifier to assign to the Api Hub instance. Must be unique
+   * within scope of the parent resource. If the field is not provided, system
+   * generated id will be used.
+   *
+   * This value should be 4-40 characters, and valid characters
+   * are `/[a-z][A-Z][0-9]-_/`.
+   * 
+ * + * string api_hub_instance_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for apiHubInstanceId. + */ + com.google.protobuf.ByteString getApiHubInstanceIdBytes(); + + /** + * + * + *
+   * Required. The ApiHub instance.
+   * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the apiHubInstance field is set. + */ + boolean hasApiHubInstance(); + /** + * + * + *
+   * Required. The ApiHub instance.
+   * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The apiHubInstance. + */ + com.google.cloud.apihub.v1.ApiHubInstance getApiHubInstance(); + /** + * + * + *
+   * Required. The ApiHub instance.
+   * 
+ * + * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.apihub.v1.ApiHubInstanceOrBuilder getApiHubInstanceOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateApiRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateApiRequest.java new file mode 100644 index 000000000000..106fda2d6566 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateApiRequest.java @@ -0,0 +1,1154 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [CreateApi][google.cloud.apihub.v1.ApiHub.CreateApi] method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.CreateApiRequest} + */ +public final class CreateApiRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.CreateApiRequest) + CreateApiRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateApiRequest.newBuilder() to construct. + private CreateApiRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateApiRequest() { + parent_ = ""; + apiId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateApiRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateApiRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateApiRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.CreateApiRequest.class, + com.google.cloud.apihub.v1.CreateApiRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent resource for the API resource.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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 parent resource for the API resource.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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 API_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object apiId_ = ""; + /** + * + * + *
+   * Optional. The ID to use for the API resource, which will become the final
+   * component of the API's resource name. This field is optional.
+   *
+   * * If provided, the same will be used. The service will throw an error if
+   * the specified id is already used by another API resource in the API hub.
+   * * If not provided, a system generated id will be used.
+   *
+   * This value should be 4-500 characters, and valid characters
+   * are /[a-z][A-Z][0-9]-_/.
+   * 
+ * + * string api_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The apiId. + */ + @java.lang.Override + public java.lang.String getApiId() { + java.lang.Object ref = apiId_; + 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(); + apiId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The ID to use for the API resource, which will become the final
+   * component of the API's resource name. This field is optional.
+   *
+   * * If provided, the same will be used. The service will throw an error if
+   * the specified id is already used by another API resource in the API hub.
+   * * If not provided, a system generated id will be used.
+   *
+   * This value should be 4-500 characters, and valid characters
+   * are /[a-z][A-Z][0-9]-_/.
+   * 
+ * + * string api_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for apiId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApiIdBytes() { + java.lang.Object ref = apiId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int API_FIELD_NUMBER = 3; + private com.google.cloud.apihub.v1.Api api_; + /** + * + * + *
+   * Required. The API resource to create.
+   * 
+ * + * .google.cloud.apihub.v1.Api api = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the api field is set. + */ + @java.lang.Override + public boolean hasApi() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The API resource to create.
+   * 
+ * + * .google.cloud.apihub.v1.Api api = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The api. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Api getApi() { + return api_ == null ? com.google.cloud.apihub.v1.Api.getDefaultInstance() : api_; + } + /** + * + * + *
+   * Required. The API resource to create.
+   * 
+ * + * .google.cloud.apihub.v1.Api api = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.ApiOrBuilder getApiOrBuilder() { + return api_ == null ? com.google.cloud.apihub.v1.Api.getDefaultInstance() : api_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, apiId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getApi()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, apiId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getApi()); + } + size += getUnknownFields().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.apihub.v1.CreateApiRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.CreateApiRequest other = + (com.google.cloud.apihub.v1.CreateApiRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getApiId().equals(other.getApiId())) return false; + if (hasApi() != other.hasApi()) return false; + if (hasApi()) { + if (!getApi().equals(other.getApi())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + API_ID_FIELD_NUMBER; + hash = (53 * hash) + getApiId().hashCode(); + if (hasApi()) { + hash = (37 * hash) + API_FIELD_NUMBER; + hash = (53 * hash) + getApi().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.CreateApiRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateApiRequest 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.apihub.v1.CreateApiRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateApiRequest 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.apihub.v1.CreateApiRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateApiRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.CreateApiRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateApiRequest 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.apihub.v1.CreateApiRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateApiRequest 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.apihub.v1.CreateApiRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateApiRequest 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.apihub.v1.CreateApiRequest 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 [CreateApi][google.cloud.apihub.v1.ApiHub.CreateApi] method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.CreateApiRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.CreateApiRequest) + com.google.cloud.apihub.v1.CreateApiRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateApiRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateApiRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.CreateApiRequest.class, + com.google.cloud.apihub.v1.CreateApiRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.CreateApiRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getApiFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + apiId_ = ""; + api_ = null; + if (apiBuilder_ != null) { + apiBuilder_.dispose(); + apiBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateApiRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateApiRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.CreateApiRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateApiRequest build() { + com.google.cloud.apihub.v1.CreateApiRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateApiRequest buildPartial() { + com.google.cloud.apihub.v1.CreateApiRequest result = + new com.google.cloud.apihub.v1.CreateApiRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.CreateApiRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.apiId_ = apiId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.api_ = apiBuilder_ == null ? api_ : apiBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.CreateApiRequest) { + return mergeFrom((com.google.cloud.apihub.v1.CreateApiRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.CreateApiRequest other) { + if (other == com.google.cloud.apihub.v1.CreateApiRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getApiId().isEmpty()) { + apiId_ = other.apiId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasApi()) { + mergeApi(other.getApi()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + apiId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getApiFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource for the API resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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 parent resource for the API resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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 parent resource for the API resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource for the API resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource for the API resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object apiId_ = ""; + /** + * + * + *
+     * Optional. The ID to use for the API resource, which will become the final
+     * component of the API's resource name. This field is optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another API resource in the API hub.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string api_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The apiId. + */ + public java.lang.String getApiId() { + java.lang.Object ref = apiId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The ID to use for the API resource, which will become the final
+     * component of the API's resource name. This field is optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another API resource in the API hub.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string api_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for apiId. + */ + public com.google.protobuf.ByteString getApiIdBytes() { + java.lang.Object ref = apiId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The ID to use for the API resource, which will become the final
+     * component of the API's resource name. This field is optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another API resource in the API hub.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string api_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The apiId to set. + * @return This builder for chaining. + */ + public Builder setApiId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + apiId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The ID to use for the API resource, which will become the final
+     * component of the API's resource name. This field is optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another API resource in the API hub.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string api_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearApiId() { + apiId_ = getDefaultInstance().getApiId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The ID to use for the API resource, which will become the final
+     * component of the API's resource name. This field is optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another API resource in the API hub.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string api_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for apiId to set. + * @return This builder for chaining. + */ + public Builder setApiIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + apiId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.apihub.v1.Api api_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Api, + com.google.cloud.apihub.v1.Api.Builder, + com.google.cloud.apihub.v1.ApiOrBuilder> + apiBuilder_; + /** + * + * + *
+     * Required. The API resource to create.
+     * 
+ * + * .google.cloud.apihub.v1.Api api = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the api field is set. + */ + public boolean hasApi() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The API resource to create.
+     * 
+ * + * .google.cloud.apihub.v1.Api api = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The api. + */ + public com.google.cloud.apihub.v1.Api getApi() { + if (apiBuilder_ == null) { + return api_ == null ? com.google.cloud.apihub.v1.Api.getDefaultInstance() : api_; + } else { + return apiBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The API resource to create.
+     * 
+ * + * .google.cloud.apihub.v1.Api api = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setApi(com.google.cloud.apihub.v1.Api value) { + if (apiBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + api_ = value; + } else { + apiBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The API resource to create.
+     * 
+ * + * .google.cloud.apihub.v1.Api api = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setApi(com.google.cloud.apihub.v1.Api.Builder builderForValue) { + if (apiBuilder_ == null) { + api_ = builderForValue.build(); + } else { + apiBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The API resource to create.
+     * 
+ * + * .google.cloud.apihub.v1.Api api = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeApi(com.google.cloud.apihub.v1.Api value) { + if (apiBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && api_ != null + && api_ != com.google.cloud.apihub.v1.Api.getDefaultInstance()) { + getApiBuilder().mergeFrom(value); + } else { + api_ = value; + } + } else { + apiBuilder_.mergeFrom(value); + } + if (api_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The API resource to create.
+     * 
+ * + * .google.cloud.apihub.v1.Api api = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearApi() { + bitField0_ = (bitField0_ & ~0x00000004); + api_ = null; + if (apiBuilder_ != null) { + apiBuilder_.dispose(); + apiBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The API resource to create.
+     * 
+ * + * .google.cloud.apihub.v1.Api api = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.apihub.v1.Api.Builder getApiBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getApiFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The API resource to create.
+     * 
+ * + * .google.cloud.apihub.v1.Api api = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.apihub.v1.ApiOrBuilder getApiOrBuilder() { + if (apiBuilder_ != null) { + return apiBuilder_.getMessageOrBuilder(); + } else { + return api_ == null ? com.google.cloud.apihub.v1.Api.getDefaultInstance() : api_; + } + } + /** + * + * + *
+     * Required. The API resource to create.
+     * 
+ * + * .google.cloud.apihub.v1.Api api = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Api, + com.google.cloud.apihub.v1.Api.Builder, + com.google.cloud.apihub.v1.ApiOrBuilder> + getApiFieldBuilder() { + if (apiBuilder_ == null) { + apiBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Api, + com.google.cloud.apihub.v1.Api.Builder, + com.google.cloud.apihub.v1.ApiOrBuilder>( + getApi(), getParentForChildren(), isClean()); + api_ = null; + } + return apiBuilder_; + } + + @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.apihub.v1.CreateApiRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.CreateApiRequest) + private static final com.google.cloud.apihub.v1.CreateApiRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.CreateApiRequest(); + } + + public static com.google.cloud.apihub.v1.CreateApiRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateApiRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.CreateApiRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateApiRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateApiRequestOrBuilder.java new file mode 100644 index 000000000000..142a123a839c --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateApiRequestOrBuilder.java @@ -0,0 +1,133 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface CreateApiRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.CreateApiRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource for the API resource.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource for the API resource.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The ID to use for the API resource, which will become the final
+   * component of the API's resource name. This field is optional.
+   *
+   * * If provided, the same will be used. The service will throw an error if
+   * the specified id is already used by another API resource in the API hub.
+   * * If not provided, a system generated id will be used.
+   *
+   * This value should be 4-500 characters, and valid characters
+   * are /[a-z][A-Z][0-9]-_/.
+   * 
+ * + * string api_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The apiId. + */ + java.lang.String getApiId(); + /** + * + * + *
+   * Optional. The ID to use for the API resource, which will become the final
+   * component of the API's resource name. This field is optional.
+   *
+   * * If provided, the same will be used. The service will throw an error if
+   * the specified id is already used by another API resource in the API hub.
+   * * If not provided, a system generated id will be used.
+   *
+   * This value should be 4-500 characters, and valid characters
+   * are /[a-z][A-Z][0-9]-_/.
+   * 
+ * + * string api_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for apiId. + */ + com.google.protobuf.ByteString getApiIdBytes(); + + /** + * + * + *
+   * Required. The API resource to create.
+   * 
+ * + * .google.cloud.apihub.v1.Api api = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the api field is set. + */ + boolean hasApi(); + /** + * + * + *
+   * Required. The API resource to create.
+   * 
+ * + * .google.cloud.apihub.v1.Api api = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The api. + */ + com.google.cloud.apihub.v1.Api getApi(); + /** + * + * + *
+   * Required. The API resource to create.
+   * 
+ * + * .google.cloud.apihub.v1.Api api = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.apihub.v1.ApiOrBuilder getApiOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateAttributeRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateAttributeRequest.java new file mode 100644 index 000000000000..91a9b55adb48 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateAttributeRequest.java @@ -0,0 +1,1196 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [CreateAttribute][google.cloud.apihub.v1.ApiHub.CreateAttribute] method's
+ * request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.CreateAttributeRequest} + */ +public final class CreateAttributeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.CreateAttributeRequest) + CreateAttributeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateAttributeRequest.newBuilder() to construct. + private CreateAttributeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateAttributeRequest() { + parent_ = ""; + attributeId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateAttributeRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateAttributeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateAttributeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.CreateAttributeRequest.class, + com.google.cloud.apihub.v1.CreateAttributeRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent resource for Attribute.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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 parent resource for Attribute.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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 ATTRIBUTE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object attributeId_ = ""; + /** + * + * + *
+   * Optional. The ID to use for the attribute, which will become the final
+   * component of the attribute's resource name. This field is optional.
+   *
+   * * If provided, the same will be used. The service will throw an error if
+   * the specified id is already used by another attribute resource in the API
+   * hub.
+   * * If not provided, a system generated id will be used.
+   *
+   * This value should be 4-500 characters, and valid characters
+   * are /[a-z][A-Z][0-9]-_/.
+   * 
+ * + * string attribute_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The attributeId. + */ + @java.lang.Override + public java.lang.String getAttributeId() { + java.lang.Object ref = attributeId_; + 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(); + attributeId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The ID to use for the attribute, which will become the final
+   * component of the attribute's resource name. This field is optional.
+   *
+   * * If provided, the same will be used. The service will throw an error if
+   * the specified id is already used by another attribute resource in the API
+   * hub.
+   * * If not provided, a system generated id will be used.
+   *
+   * This value should be 4-500 characters, and valid characters
+   * are /[a-z][A-Z][0-9]-_/.
+   * 
+ * + * string attribute_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for attributeId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAttributeIdBytes() { + java.lang.Object ref = attributeId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributeId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ATTRIBUTE_FIELD_NUMBER = 3; + private com.google.cloud.apihub.v1.Attribute attribute_; + /** + * + * + *
+   * Required. The attribute to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the attribute field is set. + */ + @java.lang.Override + public boolean hasAttribute() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The attribute to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The attribute. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Attribute getAttribute() { + return attribute_ == null + ? com.google.cloud.apihub.v1.Attribute.getDefaultInstance() + : attribute_; + } + /** + * + * + *
+   * Required. The attribute to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeOrBuilder getAttributeOrBuilder() { + return attribute_ == null + ? com.google.cloud.apihub.v1.Attribute.getDefaultInstance() + : attribute_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributeId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, attributeId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getAttribute()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributeId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, attributeId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getAttribute()); + } + size += getUnknownFields().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.apihub.v1.CreateAttributeRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.CreateAttributeRequest other = + (com.google.cloud.apihub.v1.CreateAttributeRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getAttributeId().equals(other.getAttributeId())) return false; + if (hasAttribute() != other.hasAttribute()) return false; + if (hasAttribute()) { + if (!getAttribute().equals(other.getAttribute())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ATTRIBUTE_ID_FIELD_NUMBER; + hash = (53 * hash) + getAttributeId().hashCode(); + if (hasAttribute()) { + hash = (37 * hash) + ATTRIBUTE_FIELD_NUMBER; + hash = (53 * hash) + getAttribute().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.CreateAttributeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateAttributeRequest 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.apihub.v1.CreateAttributeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateAttributeRequest 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.apihub.v1.CreateAttributeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateAttributeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.CreateAttributeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateAttributeRequest 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.apihub.v1.CreateAttributeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateAttributeRequest 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.apihub.v1.CreateAttributeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateAttributeRequest 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.apihub.v1.CreateAttributeRequest 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 [CreateAttribute][google.cloud.apihub.v1.ApiHub.CreateAttribute] method's
+   * request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.CreateAttributeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.CreateAttributeRequest) + com.google.cloud.apihub.v1.CreateAttributeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateAttributeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateAttributeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.CreateAttributeRequest.class, + com.google.cloud.apihub.v1.CreateAttributeRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.CreateAttributeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAttributeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + attributeId_ = ""; + attribute_ = null; + if (attributeBuilder_ != null) { + attributeBuilder_.dispose(); + attributeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateAttributeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateAttributeRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.CreateAttributeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateAttributeRequest build() { + com.google.cloud.apihub.v1.CreateAttributeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateAttributeRequest buildPartial() { + com.google.cloud.apihub.v1.CreateAttributeRequest result = + new com.google.cloud.apihub.v1.CreateAttributeRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.CreateAttributeRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.attributeId_ = attributeId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.attribute_ = attributeBuilder_ == null ? attribute_ : attributeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.CreateAttributeRequest) { + return mergeFrom((com.google.cloud.apihub.v1.CreateAttributeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.CreateAttributeRequest other) { + if (other == com.google.cloud.apihub.v1.CreateAttributeRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAttributeId().isEmpty()) { + attributeId_ = other.attributeId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasAttribute()) { + mergeAttribute(other.getAttribute()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + attributeId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getAttributeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource for Attribute.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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 parent resource for Attribute.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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 parent resource for Attribute.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource for Attribute.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource for Attribute.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object attributeId_ = ""; + /** + * + * + *
+     * Optional. The ID to use for the attribute, which will become the final
+     * component of the attribute's resource name. This field is optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another attribute resource in the API
+     * hub.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string attribute_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The attributeId. + */ + public java.lang.String getAttributeId() { + java.lang.Object ref = attributeId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attributeId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The ID to use for the attribute, which will become the final
+     * component of the attribute's resource name. This field is optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another attribute resource in the API
+     * hub.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string attribute_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for attributeId. + */ + public com.google.protobuf.ByteString getAttributeIdBytes() { + java.lang.Object ref = attributeId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributeId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The ID to use for the attribute, which will become the final
+     * component of the attribute's resource name. This field is optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another attribute resource in the API
+     * hub.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string attribute_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The attributeId to set. + * @return This builder for chaining. + */ + public Builder setAttributeId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + attributeId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The ID to use for the attribute, which will become the final
+     * component of the attribute's resource name. This field is optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another attribute resource in the API
+     * hub.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string attribute_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAttributeId() { + attributeId_ = getDefaultInstance().getAttributeId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The ID to use for the attribute, which will become the final
+     * component of the attribute's resource name. This field is optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another attribute resource in the API
+     * hub.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string attribute_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for attributeId to set. + * @return This builder for chaining. + */ + public Builder setAttributeIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + attributeId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.apihub.v1.Attribute attribute_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Attribute, + com.google.cloud.apihub.v1.Attribute.Builder, + com.google.cloud.apihub.v1.AttributeOrBuilder> + attributeBuilder_; + /** + * + * + *
+     * Required. The attribute to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the attribute field is set. + */ + public boolean hasAttribute() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The attribute to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The attribute. + */ + public com.google.cloud.apihub.v1.Attribute getAttribute() { + if (attributeBuilder_ == null) { + return attribute_ == null + ? com.google.cloud.apihub.v1.Attribute.getDefaultInstance() + : attribute_; + } else { + return attributeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The attribute to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAttribute(com.google.cloud.apihub.v1.Attribute value) { + if (attributeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attribute_ = value; + } else { + attributeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The attribute to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAttribute(com.google.cloud.apihub.v1.Attribute.Builder builderForValue) { + if (attributeBuilder_ == null) { + attribute_ = builderForValue.build(); + } else { + attributeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The attribute to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeAttribute(com.google.cloud.apihub.v1.Attribute value) { + if (attributeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && attribute_ != null + && attribute_ != com.google.cloud.apihub.v1.Attribute.getDefaultInstance()) { + getAttributeBuilder().mergeFrom(value); + } else { + attribute_ = value; + } + } else { + attributeBuilder_.mergeFrom(value); + } + if (attribute_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The attribute to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearAttribute() { + bitField0_ = (bitField0_ & ~0x00000004); + attribute_ = null; + if (attributeBuilder_ != null) { + attributeBuilder_.dispose(); + attributeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The attribute to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.Attribute.Builder getAttributeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getAttributeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The attribute to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.AttributeOrBuilder getAttributeOrBuilder() { + if (attributeBuilder_ != null) { + return attributeBuilder_.getMessageOrBuilder(); + } else { + return attribute_ == null + ? com.google.cloud.apihub.v1.Attribute.getDefaultInstance() + : attribute_; + } + } + /** + * + * + *
+     * Required. The attribute to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Attribute, + com.google.cloud.apihub.v1.Attribute.Builder, + com.google.cloud.apihub.v1.AttributeOrBuilder> + getAttributeFieldBuilder() { + if (attributeBuilder_ == null) { + attributeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Attribute, + com.google.cloud.apihub.v1.Attribute.Builder, + com.google.cloud.apihub.v1.AttributeOrBuilder>( + getAttribute(), getParentForChildren(), isClean()); + attribute_ = null; + } + return attributeBuilder_; + } + + @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.apihub.v1.CreateAttributeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.CreateAttributeRequest) + private static final com.google.cloud.apihub.v1.CreateAttributeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.CreateAttributeRequest(); + } + + public static com.google.cloud.apihub.v1.CreateAttributeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateAttributeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.CreateAttributeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateAttributeRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateAttributeRequestOrBuilder.java new file mode 100644 index 000000000000..37aa10d88832 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateAttributeRequestOrBuilder.java @@ -0,0 +1,141 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface CreateAttributeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.CreateAttributeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource for Attribute.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource for Attribute.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The ID to use for the attribute, which will become the final
+   * component of the attribute's resource name. This field is optional.
+   *
+   * * If provided, the same will be used. The service will throw an error if
+   * the specified id is already used by another attribute resource in the API
+   * hub.
+   * * If not provided, a system generated id will be used.
+   *
+   * This value should be 4-500 characters, and valid characters
+   * are /[a-z][A-Z][0-9]-_/.
+   * 
+ * + * string attribute_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The attributeId. + */ + java.lang.String getAttributeId(); + /** + * + * + *
+   * Optional. The ID to use for the attribute, which will become the final
+   * component of the attribute's resource name. This field is optional.
+   *
+   * * If provided, the same will be used. The service will throw an error if
+   * the specified id is already used by another attribute resource in the API
+   * hub.
+   * * If not provided, a system generated id will be used.
+   *
+   * This value should be 4-500 characters, and valid characters
+   * are /[a-z][A-Z][0-9]-_/.
+   * 
+ * + * string attribute_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for attributeId. + */ + com.google.protobuf.ByteString getAttributeIdBytes(); + + /** + * + * + *
+   * Required. The attribute to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the attribute field is set. + */ + boolean hasAttribute(); + /** + * + * + *
+   * Required. The attribute to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The attribute. + */ + com.google.cloud.apihub.v1.Attribute getAttribute(); + /** + * + * + *
+   * Required. The attribute to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.apihub.v1.AttributeOrBuilder getAttributeOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateDependencyRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateDependencyRequest.java new file mode 100644 index 000000000000..f95db3bd6dfc --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateDependencyRequest.java @@ -0,0 +1,1184 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The
+ * [CreateDependency][google.cloud.apihub.v1.ApiHubDependencies.CreateDependency]
+ * method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.CreateDependencyRequest} + */ +public final class CreateDependencyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.CreateDependencyRequest) + CreateDependencyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateDependencyRequest.newBuilder() to construct. + private CreateDependencyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateDependencyRequest() { + parent_ = ""; + dependencyId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateDependencyRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateDependencyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateDependencyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.CreateDependencyRequest.class, + com.google.cloud.apihub.v1.CreateDependencyRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent resource for the dependency resource.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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 parent resource for the dependency resource.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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 DEPENDENCY_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object dependencyId_ = ""; + /** + * + * + *
+   * Optional. The ID to use for the dependency resource, which will become the
+   * final component of the dependency's resource name. This field is optional.
+   * * If provided, the same will be used. The service will throw an error if
+   * duplicate id is provided by the client.
+   * * If not provided, a system generated id will be used.
+   *
+   * This value should be 4-500 characters, and valid characters
+   * are `[a-z][A-Z][0-9]-_`.
+   * 
+ * + * string dependency_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The dependencyId. + */ + @java.lang.Override + public java.lang.String getDependencyId() { + java.lang.Object ref = dependencyId_; + 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(); + dependencyId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The ID to use for the dependency resource, which will become the
+   * final component of the dependency's resource name. This field is optional.
+   * * If provided, the same will be used. The service will throw an error if
+   * duplicate id is provided by the client.
+   * * If not provided, a system generated id will be used.
+   *
+   * This value should be 4-500 characters, and valid characters
+   * are `[a-z][A-Z][0-9]-_`.
+   * 
+ * + * string dependency_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for dependencyId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDependencyIdBytes() { + java.lang.Object ref = dependencyId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dependencyId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEPENDENCY_FIELD_NUMBER = 3; + private com.google.cloud.apihub.v1.Dependency dependency_; + /** + * + * + *
+   * Required. The dependency resource to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dependency field is set. + */ + @java.lang.Override + public boolean hasDependency() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The dependency resource to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dependency. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Dependency getDependency() { + return dependency_ == null + ? com.google.cloud.apihub.v1.Dependency.getDefaultInstance() + : dependency_; + } + /** + * + * + *
+   * Required. The dependency resource to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.DependencyOrBuilder getDependencyOrBuilder() { + return dependency_ == null + ? com.google.cloud.apihub.v1.Dependency.getDefaultInstance() + : dependency_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dependencyId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, dependencyId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getDependency()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dependencyId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, dependencyId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getDependency()); + } + size += getUnknownFields().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.apihub.v1.CreateDependencyRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.CreateDependencyRequest other = + (com.google.cloud.apihub.v1.CreateDependencyRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getDependencyId().equals(other.getDependencyId())) return false; + if (hasDependency() != other.hasDependency()) return false; + if (hasDependency()) { + if (!getDependency().equals(other.getDependency())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DEPENDENCY_ID_FIELD_NUMBER; + hash = (53 * hash) + getDependencyId().hashCode(); + if (hasDependency()) { + hash = (37 * hash) + DEPENDENCY_FIELD_NUMBER; + hash = (53 * hash) + getDependency().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.CreateDependencyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateDependencyRequest 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.apihub.v1.CreateDependencyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateDependencyRequest 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.apihub.v1.CreateDependencyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateDependencyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.CreateDependencyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateDependencyRequest 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.apihub.v1.CreateDependencyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateDependencyRequest 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.apihub.v1.CreateDependencyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateDependencyRequest 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.apihub.v1.CreateDependencyRequest 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
+   * [CreateDependency][google.cloud.apihub.v1.ApiHubDependencies.CreateDependency]
+   * method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.CreateDependencyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.CreateDependencyRequest) + com.google.cloud.apihub.v1.CreateDependencyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateDependencyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateDependencyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.CreateDependencyRequest.class, + com.google.cloud.apihub.v1.CreateDependencyRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.CreateDependencyRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getDependencyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + dependencyId_ = ""; + dependency_ = null; + if (dependencyBuilder_ != null) { + dependencyBuilder_.dispose(); + dependencyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateDependencyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateDependencyRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.CreateDependencyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateDependencyRequest build() { + com.google.cloud.apihub.v1.CreateDependencyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateDependencyRequest buildPartial() { + com.google.cloud.apihub.v1.CreateDependencyRequest result = + new com.google.cloud.apihub.v1.CreateDependencyRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.CreateDependencyRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.dependencyId_ = dependencyId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.dependency_ = dependencyBuilder_ == null ? dependency_ : dependencyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.CreateDependencyRequest) { + return mergeFrom((com.google.cloud.apihub.v1.CreateDependencyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.CreateDependencyRequest other) { + if (other == com.google.cloud.apihub.v1.CreateDependencyRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDependencyId().isEmpty()) { + dependencyId_ = other.dependencyId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasDependency()) { + mergeDependency(other.getDependency()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + dependencyId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getDependencyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource for the dependency resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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 parent resource for the dependency resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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 parent resource for the dependency resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource for the dependency resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource for the dependency resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object dependencyId_ = ""; + /** + * + * + *
+     * Optional. The ID to use for the dependency resource, which will become the
+     * final component of the dependency's resource name. This field is optional.
+     * * If provided, the same will be used. The service will throw an error if
+     * duplicate id is provided by the client.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are `[a-z][A-Z][0-9]-_`.
+     * 
+ * + * string dependency_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The dependencyId. + */ + public java.lang.String getDependencyId() { + java.lang.Object ref = dependencyId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dependencyId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The ID to use for the dependency resource, which will become the
+     * final component of the dependency's resource name. This field is optional.
+     * * If provided, the same will be used. The service will throw an error if
+     * duplicate id is provided by the client.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are `[a-z][A-Z][0-9]-_`.
+     * 
+ * + * string dependency_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for dependencyId. + */ + public com.google.protobuf.ByteString getDependencyIdBytes() { + java.lang.Object ref = dependencyId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dependencyId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The ID to use for the dependency resource, which will become the
+     * final component of the dependency's resource name. This field is optional.
+     * * If provided, the same will be used. The service will throw an error if
+     * duplicate id is provided by the client.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are `[a-z][A-Z][0-9]-_`.
+     * 
+ * + * string dependency_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The dependencyId to set. + * @return This builder for chaining. + */ + public Builder setDependencyId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + dependencyId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The ID to use for the dependency resource, which will become the
+     * final component of the dependency's resource name. This field is optional.
+     * * If provided, the same will be used. The service will throw an error if
+     * duplicate id is provided by the client.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are `[a-z][A-Z][0-9]-_`.
+     * 
+ * + * string dependency_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDependencyId() { + dependencyId_ = getDefaultInstance().getDependencyId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The ID to use for the dependency resource, which will become the
+     * final component of the dependency's resource name. This field is optional.
+     * * If provided, the same will be used. The service will throw an error if
+     * duplicate id is provided by the client.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are `[a-z][A-Z][0-9]-_`.
+     * 
+ * + * string dependency_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for dependencyId to set. + * @return This builder for chaining. + */ + public Builder setDependencyIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + dependencyId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.apihub.v1.Dependency dependency_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Dependency, + com.google.cloud.apihub.v1.Dependency.Builder, + com.google.cloud.apihub.v1.DependencyOrBuilder> + dependencyBuilder_; + /** + * + * + *
+     * Required. The dependency resource to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dependency field is set. + */ + public boolean hasDependency() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The dependency resource to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dependency. + */ + public com.google.cloud.apihub.v1.Dependency getDependency() { + if (dependencyBuilder_ == null) { + return dependency_ == null + ? com.google.cloud.apihub.v1.Dependency.getDefaultInstance() + : dependency_; + } else { + return dependencyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The dependency resource to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDependency(com.google.cloud.apihub.v1.Dependency value) { + if (dependencyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dependency_ = value; + } else { + dependencyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The dependency resource to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDependency(com.google.cloud.apihub.v1.Dependency.Builder builderForValue) { + if (dependencyBuilder_ == null) { + dependency_ = builderForValue.build(); + } else { + dependencyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The dependency resource to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDependency(com.google.cloud.apihub.v1.Dependency value) { + if (dependencyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && dependency_ != null + && dependency_ != com.google.cloud.apihub.v1.Dependency.getDefaultInstance()) { + getDependencyBuilder().mergeFrom(value); + } else { + dependency_ = value; + } + } else { + dependencyBuilder_.mergeFrom(value); + } + if (dependency_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The dependency resource to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDependency() { + bitField0_ = (bitField0_ & ~0x00000004); + dependency_ = null; + if (dependencyBuilder_ != null) { + dependencyBuilder_.dispose(); + dependencyBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The dependency resource to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.Dependency.Builder getDependencyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getDependencyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The dependency resource to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.DependencyOrBuilder getDependencyOrBuilder() { + if (dependencyBuilder_ != null) { + return dependencyBuilder_.getMessageOrBuilder(); + } else { + return dependency_ == null + ? com.google.cloud.apihub.v1.Dependency.getDefaultInstance() + : dependency_; + } + } + /** + * + * + *
+     * Required. The dependency resource to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Dependency, + com.google.cloud.apihub.v1.Dependency.Builder, + com.google.cloud.apihub.v1.DependencyOrBuilder> + getDependencyFieldBuilder() { + if (dependencyBuilder_ == null) { + dependencyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Dependency, + com.google.cloud.apihub.v1.Dependency.Builder, + com.google.cloud.apihub.v1.DependencyOrBuilder>( + getDependency(), getParentForChildren(), isClean()); + dependency_ = null; + } + return dependencyBuilder_; + } + + @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.apihub.v1.CreateDependencyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.CreateDependencyRequest) + private static final com.google.cloud.apihub.v1.CreateDependencyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.CreateDependencyRequest(); + } + + public static com.google.cloud.apihub.v1.CreateDependencyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateDependencyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.CreateDependencyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateDependencyRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateDependencyRequestOrBuilder.java new file mode 100644 index 000000000000..773c7a7a75d6 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateDependencyRequestOrBuilder.java @@ -0,0 +1,137 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface CreateDependencyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.CreateDependencyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource for the dependency resource.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource for the dependency resource.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The ID to use for the dependency resource, which will become the
+   * final component of the dependency's resource name. This field is optional.
+   * * If provided, the same will be used. The service will throw an error if
+   * duplicate id is provided by the client.
+   * * If not provided, a system generated id will be used.
+   *
+   * This value should be 4-500 characters, and valid characters
+   * are `[a-z][A-Z][0-9]-_`.
+   * 
+ * + * string dependency_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The dependencyId. + */ + java.lang.String getDependencyId(); + /** + * + * + *
+   * Optional. The ID to use for the dependency resource, which will become the
+   * final component of the dependency's resource name. This field is optional.
+   * * If provided, the same will be used. The service will throw an error if
+   * duplicate id is provided by the client.
+   * * If not provided, a system generated id will be used.
+   *
+   * This value should be 4-500 characters, and valid characters
+   * are `[a-z][A-Z][0-9]-_`.
+   * 
+ * + * string dependency_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for dependencyId. + */ + com.google.protobuf.ByteString getDependencyIdBytes(); + + /** + * + * + *
+   * Required. The dependency resource to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dependency field is set. + */ + boolean hasDependency(); + /** + * + * + *
+   * Required. The dependency resource to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dependency. + */ + com.google.cloud.apihub.v1.Dependency getDependency(); + /** + * + * + *
+   * Required. The dependency resource to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.apihub.v1.DependencyOrBuilder getDependencyOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateDeploymentRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateDeploymentRequest.java new file mode 100644 index 000000000000..f56c4a017f4f --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateDeploymentRequest.java @@ -0,0 +1,1196 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [CreateDeployment][google.cloud.apihub.v1.ApiHub.CreateDeployment]
+ * method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.CreateDeploymentRequest} + */ +public final class CreateDeploymentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.CreateDeploymentRequest) + CreateDeploymentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateDeploymentRequest.newBuilder() to construct. + private CreateDeploymentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateDeploymentRequest() { + parent_ = ""; + deploymentId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateDeploymentRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateDeploymentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateDeploymentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.CreateDeploymentRequest.class, + com.google.cloud.apihub.v1.CreateDeploymentRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent resource for the deployment resource.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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 parent resource for the deployment resource.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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 DEPLOYMENT_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object deploymentId_ = ""; + /** + * + * + *
+   * Optional. The ID to use for the deployment resource, which will become the
+   * final component of the deployment's resource name. This field is optional.
+   *
+   * * If provided, the same will be used. The service will throw an error if
+   * the specified id is already used by another deployment resource in the API
+   * hub.
+   * * If not provided, a system generated id will be used.
+   *
+   * This value should be 4-500 characters, and valid characters
+   * are /[a-z][A-Z][0-9]-_/.
+   * 
+ * + * string deployment_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The deploymentId. + */ + @java.lang.Override + public java.lang.String getDeploymentId() { + java.lang.Object ref = deploymentId_; + 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(); + deploymentId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The ID to use for the deployment resource, which will become the
+   * final component of the deployment's resource name. This field is optional.
+   *
+   * * If provided, the same will be used. The service will throw an error if
+   * the specified id is already used by another deployment resource in the API
+   * hub.
+   * * If not provided, a system generated id will be used.
+   *
+   * This value should be 4-500 characters, and valid characters
+   * are /[a-z][A-Z][0-9]-_/.
+   * 
+ * + * string deployment_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for deploymentId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDeploymentIdBytes() { + java.lang.Object ref = deploymentId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + deploymentId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEPLOYMENT_FIELD_NUMBER = 3; + private com.google.cloud.apihub.v1.Deployment deployment_; + /** + * + * + *
+   * Required. The deployment resource to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the deployment field is set. + */ + @java.lang.Override + public boolean hasDeployment() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The deployment resource to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The deployment. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Deployment getDeployment() { + return deployment_ == null + ? com.google.cloud.apihub.v1.Deployment.getDefaultInstance() + : deployment_; + } + /** + * + * + *
+   * Required. The deployment resource to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.DeploymentOrBuilder getDeploymentOrBuilder() { + return deployment_ == null + ? com.google.cloud.apihub.v1.Deployment.getDefaultInstance() + : deployment_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deploymentId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, deploymentId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getDeployment()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deploymentId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, deploymentId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getDeployment()); + } + size += getUnknownFields().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.apihub.v1.CreateDeploymentRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.CreateDeploymentRequest other = + (com.google.cloud.apihub.v1.CreateDeploymentRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getDeploymentId().equals(other.getDeploymentId())) return false; + if (hasDeployment() != other.hasDeployment()) return false; + if (hasDeployment()) { + if (!getDeployment().equals(other.getDeployment())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DEPLOYMENT_ID_FIELD_NUMBER; + hash = (53 * hash) + getDeploymentId().hashCode(); + if (hasDeployment()) { + hash = (37 * hash) + DEPLOYMENT_FIELD_NUMBER; + hash = (53 * hash) + getDeployment().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.CreateDeploymentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateDeploymentRequest 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.apihub.v1.CreateDeploymentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateDeploymentRequest 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.apihub.v1.CreateDeploymentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateDeploymentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.CreateDeploymentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateDeploymentRequest 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.apihub.v1.CreateDeploymentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateDeploymentRequest 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.apihub.v1.CreateDeploymentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateDeploymentRequest 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.apihub.v1.CreateDeploymentRequest 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 [CreateDeployment][google.cloud.apihub.v1.ApiHub.CreateDeployment]
+   * method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.CreateDeploymentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.CreateDeploymentRequest) + com.google.cloud.apihub.v1.CreateDeploymentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateDeploymentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateDeploymentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.CreateDeploymentRequest.class, + com.google.cloud.apihub.v1.CreateDeploymentRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.CreateDeploymentRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getDeploymentFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + deploymentId_ = ""; + deployment_ = null; + if (deploymentBuilder_ != null) { + deploymentBuilder_.dispose(); + deploymentBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateDeploymentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateDeploymentRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.CreateDeploymentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateDeploymentRequest build() { + com.google.cloud.apihub.v1.CreateDeploymentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateDeploymentRequest buildPartial() { + com.google.cloud.apihub.v1.CreateDeploymentRequest result = + new com.google.cloud.apihub.v1.CreateDeploymentRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.CreateDeploymentRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.deploymentId_ = deploymentId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.deployment_ = deploymentBuilder_ == null ? deployment_ : deploymentBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.CreateDeploymentRequest) { + return mergeFrom((com.google.cloud.apihub.v1.CreateDeploymentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.CreateDeploymentRequest other) { + if (other == com.google.cloud.apihub.v1.CreateDeploymentRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDeploymentId().isEmpty()) { + deploymentId_ = other.deploymentId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasDeployment()) { + mergeDeployment(other.getDeployment()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + deploymentId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getDeploymentFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource for the deployment resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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 parent resource for the deployment resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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 parent resource for the deployment resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource for the deployment resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource for the deployment resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object deploymentId_ = ""; + /** + * + * + *
+     * Optional. The ID to use for the deployment resource, which will become the
+     * final component of the deployment's resource name. This field is optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another deployment resource in the API
+     * hub.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string deployment_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The deploymentId. + */ + public java.lang.String getDeploymentId() { + java.lang.Object ref = deploymentId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deploymentId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The ID to use for the deployment resource, which will become the
+     * final component of the deployment's resource name. This field is optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another deployment resource in the API
+     * hub.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string deployment_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for deploymentId. + */ + public com.google.protobuf.ByteString getDeploymentIdBytes() { + java.lang.Object ref = deploymentId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + deploymentId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The ID to use for the deployment resource, which will become the
+     * final component of the deployment's resource name. This field is optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another deployment resource in the API
+     * hub.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string deployment_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The deploymentId to set. + * @return This builder for chaining. + */ + public Builder setDeploymentId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + deploymentId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The ID to use for the deployment resource, which will become the
+     * final component of the deployment's resource name. This field is optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another deployment resource in the API
+     * hub.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string deployment_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDeploymentId() { + deploymentId_ = getDefaultInstance().getDeploymentId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The ID to use for the deployment resource, which will become the
+     * final component of the deployment's resource name. This field is optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another deployment resource in the API
+     * hub.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string deployment_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for deploymentId to set. + * @return This builder for chaining. + */ + public Builder setDeploymentIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + deploymentId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.apihub.v1.Deployment deployment_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Deployment, + com.google.cloud.apihub.v1.Deployment.Builder, + com.google.cloud.apihub.v1.DeploymentOrBuilder> + deploymentBuilder_; + /** + * + * + *
+     * Required. The deployment resource to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the deployment field is set. + */ + public boolean hasDeployment() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The deployment resource to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The deployment. + */ + public com.google.cloud.apihub.v1.Deployment getDeployment() { + if (deploymentBuilder_ == null) { + return deployment_ == null + ? com.google.cloud.apihub.v1.Deployment.getDefaultInstance() + : deployment_; + } else { + return deploymentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The deployment resource to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDeployment(com.google.cloud.apihub.v1.Deployment value) { + if (deploymentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deployment_ = value; + } else { + deploymentBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The deployment resource to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDeployment(com.google.cloud.apihub.v1.Deployment.Builder builderForValue) { + if (deploymentBuilder_ == null) { + deployment_ = builderForValue.build(); + } else { + deploymentBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The deployment resource to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDeployment(com.google.cloud.apihub.v1.Deployment value) { + if (deploymentBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && deployment_ != null + && deployment_ != com.google.cloud.apihub.v1.Deployment.getDefaultInstance()) { + getDeploymentBuilder().mergeFrom(value); + } else { + deployment_ = value; + } + } else { + deploymentBuilder_.mergeFrom(value); + } + if (deployment_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The deployment resource to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDeployment() { + bitField0_ = (bitField0_ & ~0x00000004); + deployment_ = null; + if (deploymentBuilder_ != null) { + deploymentBuilder_.dispose(); + deploymentBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The deployment resource to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.Deployment.Builder getDeploymentBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getDeploymentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The deployment resource to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.DeploymentOrBuilder getDeploymentOrBuilder() { + if (deploymentBuilder_ != null) { + return deploymentBuilder_.getMessageOrBuilder(); + } else { + return deployment_ == null + ? com.google.cloud.apihub.v1.Deployment.getDefaultInstance() + : deployment_; + } + } + /** + * + * + *
+     * Required. The deployment resource to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Deployment, + com.google.cloud.apihub.v1.Deployment.Builder, + com.google.cloud.apihub.v1.DeploymentOrBuilder> + getDeploymentFieldBuilder() { + if (deploymentBuilder_ == null) { + deploymentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Deployment, + com.google.cloud.apihub.v1.Deployment.Builder, + com.google.cloud.apihub.v1.DeploymentOrBuilder>( + getDeployment(), getParentForChildren(), isClean()); + deployment_ = null; + } + return deploymentBuilder_; + } + + @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.apihub.v1.CreateDeploymentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.CreateDeploymentRequest) + private static final com.google.cloud.apihub.v1.CreateDeploymentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.CreateDeploymentRequest(); + } + + public static com.google.cloud.apihub.v1.CreateDeploymentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateDeploymentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.CreateDeploymentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateDeploymentRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateDeploymentRequestOrBuilder.java new file mode 100644 index 000000000000..6c0996e2fcea --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateDeploymentRequestOrBuilder.java @@ -0,0 +1,141 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface CreateDeploymentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.CreateDeploymentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource for the deployment resource.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource for the deployment resource.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The ID to use for the deployment resource, which will become the
+   * final component of the deployment's resource name. This field is optional.
+   *
+   * * If provided, the same will be used. The service will throw an error if
+   * the specified id is already used by another deployment resource in the API
+   * hub.
+   * * If not provided, a system generated id will be used.
+   *
+   * This value should be 4-500 characters, and valid characters
+   * are /[a-z][A-Z][0-9]-_/.
+   * 
+ * + * string deployment_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The deploymentId. + */ + java.lang.String getDeploymentId(); + /** + * + * + *
+   * Optional. The ID to use for the deployment resource, which will become the
+   * final component of the deployment's resource name. This field is optional.
+   *
+   * * If provided, the same will be used. The service will throw an error if
+   * the specified id is already used by another deployment resource in the API
+   * hub.
+   * * If not provided, a system generated id will be used.
+   *
+   * This value should be 4-500 characters, and valid characters
+   * are /[a-z][A-Z][0-9]-_/.
+   * 
+ * + * string deployment_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for deploymentId. + */ + com.google.protobuf.ByteString getDeploymentIdBytes(); + + /** + * + * + *
+   * Required. The deployment resource to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the deployment field is set. + */ + boolean hasDeployment(); + /** + * + * + *
+   * Required. The deployment resource to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The deployment. + */ + com.google.cloud.apihub.v1.Deployment getDeployment(); + /** + * + * + *
+   * Required. The deployment resource to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.apihub.v1.DeploymentOrBuilder getDeploymentOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateExternalApiRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateExternalApiRequest.java new file mode 100644 index 000000000000..1d841ad73214 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateExternalApiRequest.java @@ -0,0 +1,1204 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [CreateExternalApi][google.cloud.apihub.v1.ApiHub.CreateExternalApi]
+ * method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.CreateExternalApiRequest} + */ +public final class CreateExternalApiRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.CreateExternalApiRequest) + CreateExternalApiRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateExternalApiRequest.newBuilder() to construct. + private CreateExternalApiRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateExternalApiRequest() { + parent_ = ""; + externalApiId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateExternalApiRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateExternalApiRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateExternalApiRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.CreateExternalApiRequest.class, + com.google.cloud.apihub.v1.CreateExternalApiRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent resource for the External API resource.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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 parent resource for the External API resource.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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 EXTERNAL_API_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object externalApiId_ = ""; + /** + * + * + *
+   * Optional. The ID to use for the External API resource, which will become
+   * the final component of the External API's resource name. This field is
+   * optional.
+   *
+   * * If provided, the same will be used. The service will throw an error if
+   * the specified id is already used by another External API resource in the
+   * API hub.
+   * * If not provided, a system generated id will be used.
+   *
+   * This value should be 4-500 characters, and valid characters
+   * are /[a-z][A-Z][0-9]-_/.
+   * 
+ * + * string external_api_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The externalApiId. + */ + @java.lang.Override + public java.lang.String getExternalApiId() { + java.lang.Object ref = externalApiId_; + 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(); + externalApiId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The ID to use for the External API resource, which will become
+   * the final component of the External API's resource name. This field is
+   * optional.
+   *
+   * * If provided, the same will be used. The service will throw an error if
+   * the specified id is already used by another External API resource in the
+   * API hub.
+   * * If not provided, a system generated id will be used.
+   *
+   * This value should be 4-500 characters, and valid characters
+   * are /[a-z][A-Z][0-9]-_/.
+   * 
+ * + * string external_api_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for externalApiId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getExternalApiIdBytes() { + java.lang.Object ref = externalApiId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + externalApiId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXTERNAL_API_FIELD_NUMBER = 3; + private com.google.cloud.apihub.v1.ExternalApi externalApi_; + /** + * + * + *
+   * Required. The External API resource to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the externalApi field is set. + */ + @java.lang.Override + public boolean hasExternalApi() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The External API resource to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The externalApi. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.ExternalApi getExternalApi() { + return externalApi_ == null + ? com.google.cloud.apihub.v1.ExternalApi.getDefaultInstance() + : externalApi_; + } + /** + * + * + *
+   * Required. The External API resource to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.ExternalApiOrBuilder getExternalApiOrBuilder() { + return externalApi_ == null + ? com.google.cloud.apihub.v1.ExternalApi.getDefaultInstance() + : externalApi_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(externalApiId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, externalApiId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getExternalApi()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(externalApiId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, externalApiId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getExternalApi()); + } + size += getUnknownFields().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.apihub.v1.CreateExternalApiRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.CreateExternalApiRequest other = + (com.google.cloud.apihub.v1.CreateExternalApiRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getExternalApiId().equals(other.getExternalApiId())) return false; + if (hasExternalApi() != other.hasExternalApi()) return false; + if (hasExternalApi()) { + if (!getExternalApi().equals(other.getExternalApi())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + EXTERNAL_API_ID_FIELD_NUMBER; + hash = (53 * hash) + getExternalApiId().hashCode(); + if (hasExternalApi()) { + hash = (37 * hash) + EXTERNAL_API_FIELD_NUMBER; + hash = (53 * hash) + getExternalApi().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.CreateExternalApiRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateExternalApiRequest 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.apihub.v1.CreateExternalApiRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateExternalApiRequest 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.apihub.v1.CreateExternalApiRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateExternalApiRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.CreateExternalApiRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateExternalApiRequest 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.apihub.v1.CreateExternalApiRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateExternalApiRequest 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.apihub.v1.CreateExternalApiRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateExternalApiRequest 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.apihub.v1.CreateExternalApiRequest 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 [CreateExternalApi][google.cloud.apihub.v1.ApiHub.CreateExternalApi]
+   * method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.CreateExternalApiRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.CreateExternalApiRequest) + com.google.cloud.apihub.v1.CreateExternalApiRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateExternalApiRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateExternalApiRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.CreateExternalApiRequest.class, + com.google.cloud.apihub.v1.CreateExternalApiRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.CreateExternalApiRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getExternalApiFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + externalApiId_ = ""; + externalApi_ = null; + if (externalApiBuilder_ != null) { + externalApiBuilder_.dispose(); + externalApiBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateExternalApiRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateExternalApiRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.CreateExternalApiRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateExternalApiRequest build() { + com.google.cloud.apihub.v1.CreateExternalApiRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateExternalApiRequest buildPartial() { + com.google.cloud.apihub.v1.CreateExternalApiRequest result = + new com.google.cloud.apihub.v1.CreateExternalApiRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.CreateExternalApiRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.externalApiId_ = externalApiId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.externalApi_ = + externalApiBuilder_ == null ? externalApi_ : externalApiBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.CreateExternalApiRequest) { + return mergeFrom((com.google.cloud.apihub.v1.CreateExternalApiRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.CreateExternalApiRequest other) { + if (other == com.google.cloud.apihub.v1.CreateExternalApiRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getExternalApiId().isEmpty()) { + externalApiId_ = other.externalApiId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasExternalApi()) { + mergeExternalApi(other.getExternalApi()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + externalApiId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getExternalApiFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource for the External API resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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 parent resource for the External API resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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 parent resource for the External API resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource for the External API resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource for the External API resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object externalApiId_ = ""; + /** + * + * + *
+     * Optional. The ID to use for the External API resource, which will become
+     * the final component of the External API's resource name. This field is
+     * optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another External API resource in the
+     * API hub.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string external_api_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The externalApiId. + */ + public java.lang.String getExternalApiId() { + java.lang.Object ref = externalApiId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + externalApiId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The ID to use for the External API resource, which will become
+     * the final component of the External API's resource name. This field is
+     * optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another External API resource in the
+     * API hub.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string external_api_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for externalApiId. + */ + public com.google.protobuf.ByteString getExternalApiIdBytes() { + java.lang.Object ref = externalApiId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + externalApiId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The ID to use for the External API resource, which will become
+     * the final component of the External API's resource name. This field is
+     * optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another External API resource in the
+     * API hub.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string external_api_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The externalApiId to set. + * @return This builder for chaining. + */ + public Builder setExternalApiId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + externalApiId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The ID to use for the External API resource, which will become
+     * the final component of the External API's resource name. This field is
+     * optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another External API resource in the
+     * API hub.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string external_api_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearExternalApiId() { + externalApiId_ = getDefaultInstance().getExternalApiId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The ID to use for the External API resource, which will become
+     * the final component of the External API's resource name. This field is
+     * optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another External API resource in the
+     * API hub.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string external_api_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for externalApiId to set. + * @return This builder for chaining. + */ + public Builder setExternalApiIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + externalApiId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.apihub.v1.ExternalApi externalApi_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.ExternalApi, + com.google.cloud.apihub.v1.ExternalApi.Builder, + com.google.cloud.apihub.v1.ExternalApiOrBuilder> + externalApiBuilder_; + /** + * + * + *
+     * Required. The External API resource to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the externalApi field is set. + */ + public boolean hasExternalApi() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The External API resource to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The externalApi. + */ + public com.google.cloud.apihub.v1.ExternalApi getExternalApi() { + if (externalApiBuilder_ == null) { + return externalApi_ == null + ? com.google.cloud.apihub.v1.ExternalApi.getDefaultInstance() + : externalApi_; + } else { + return externalApiBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The External API resource to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setExternalApi(com.google.cloud.apihub.v1.ExternalApi value) { + if (externalApiBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + externalApi_ = value; + } else { + externalApiBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The External API resource to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setExternalApi(com.google.cloud.apihub.v1.ExternalApi.Builder builderForValue) { + if (externalApiBuilder_ == null) { + externalApi_ = builderForValue.build(); + } else { + externalApiBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The External API resource to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeExternalApi(com.google.cloud.apihub.v1.ExternalApi value) { + if (externalApiBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && externalApi_ != null + && externalApi_ != com.google.cloud.apihub.v1.ExternalApi.getDefaultInstance()) { + getExternalApiBuilder().mergeFrom(value); + } else { + externalApi_ = value; + } + } else { + externalApiBuilder_.mergeFrom(value); + } + if (externalApi_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The External API resource to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearExternalApi() { + bitField0_ = (bitField0_ & ~0x00000004); + externalApi_ = null; + if (externalApiBuilder_ != null) { + externalApiBuilder_.dispose(); + externalApiBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The External API resource to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.ExternalApi.Builder getExternalApiBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getExternalApiFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The External API resource to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.ExternalApiOrBuilder getExternalApiOrBuilder() { + if (externalApiBuilder_ != null) { + return externalApiBuilder_.getMessageOrBuilder(); + } else { + return externalApi_ == null + ? com.google.cloud.apihub.v1.ExternalApi.getDefaultInstance() + : externalApi_; + } + } + /** + * + * + *
+     * Required. The External API resource to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.ExternalApi, + com.google.cloud.apihub.v1.ExternalApi.Builder, + com.google.cloud.apihub.v1.ExternalApiOrBuilder> + getExternalApiFieldBuilder() { + if (externalApiBuilder_ == null) { + externalApiBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.ExternalApi, + com.google.cloud.apihub.v1.ExternalApi.Builder, + com.google.cloud.apihub.v1.ExternalApiOrBuilder>( + getExternalApi(), getParentForChildren(), isClean()); + externalApi_ = null; + } + return externalApiBuilder_; + } + + @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.apihub.v1.CreateExternalApiRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.CreateExternalApiRequest) + private static final com.google.cloud.apihub.v1.CreateExternalApiRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.CreateExternalApiRequest(); + } + + public static com.google.cloud.apihub.v1.CreateExternalApiRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateExternalApiRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.CreateExternalApiRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateExternalApiRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateExternalApiRequestOrBuilder.java new file mode 100644 index 000000000000..5df1812a5560 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateExternalApiRequestOrBuilder.java @@ -0,0 +1,143 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface CreateExternalApiRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.CreateExternalApiRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource for the External API resource.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource for the External API resource.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The ID to use for the External API resource, which will become
+   * the final component of the External API's resource name. This field is
+   * optional.
+   *
+   * * If provided, the same will be used. The service will throw an error if
+   * the specified id is already used by another External API resource in the
+   * API hub.
+   * * If not provided, a system generated id will be used.
+   *
+   * This value should be 4-500 characters, and valid characters
+   * are /[a-z][A-Z][0-9]-_/.
+   * 
+ * + * string external_api_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The externalApiId. + */ + java.lang.String getExternalApiId(); + /** + * + * + *
+   * Optional. The ID to use for the External API resource, which will become
+   * the final component of the External API's resource name. This field is
+   * optional.
+   *
+   * * If provided, the same will be used. The service will throw an error if
+   * the specified id is already used by another External API resource in the
+   * API hub.
+   * * If not provided, a system generated id will be used.
+   *
+   * This value should be 4-500 characters, and valid characters
+   * are /[a-z][A-Z][0-9]-_/.
+   * 
+ * + * string external_api_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for externalApiId. + */ + com.google.protobuf.ByteString getExternalApiIdBytes(); + + /** + * + * + *
+   * Required. The External API resource to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the externalApi field is set. + */ + boolean hasExternalApi(); + /** + * + * + *
+   * Required. The External API resource to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The externalApi. + */ + com.google.cloud.apihub.v1.ExternalApi getExternalApi(); + /** + * + * + *
+   * Required. The External API resource to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.apihub.v1.ExternalApiOrBuilder getExternalApiOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateHostProjectRegistrationRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateHostProjectRegistrationRequest.java new file mode 100644 index 000000000000..992d98c1d78e --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateHostProjectRegistrationRequest.java @@ -0,0 +1,1184 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/host_project_registration_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The
+ * [CreateHostProjectRegistration][google.cloud.apihub.v1.HostProjectRegistrationService.CreateHostProjectRegistration]
+ * method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.CreateHostProjectRegistrationRequest} + */ +public final class CreateHostProjectRegistrationRequest + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.CreateHostProjectRegistrationRequest) + CreateHostProjectRegistrationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateHostProjectRegistrationRequest.newBuilder() to construct. + private CreateHostProjectRegistrationRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateHostProjectRegistrationRequest() { + parent_ = ""; + hostProjectRegistrationId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateHostProjectRegistrationRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.HostProjectRegistrationServiceProto + .internal_static_google_cloud_apihub_v1_CreateHostProjectRegistrationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.HostProjectRegistrationServiceProto + .internal_static_google_cloud_apihub_v1_CreateHostProjectRegistrationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest.class, + com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent resource for the host project.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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 parent resource for the host project.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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 HOST_PROJECT_REGISTRATION_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object hostProjectRegistrationId_ = ""; + /** + * + * + *
+   * Required. The ID to use for the Host Project Registration, which will
+   * become the final component of the host project registration's resource
+   * name. The ID must be the same as the Google cloud project specified in the
+   * host_project_registration.gcp_project field.
+   * 
+ * + * string host_project_registration_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The hostProjectRegistrationId. + */ + @java.lang.Override + public java.lang.String getHostProjectRegistrationId() { + java.lang.Object ref = hostProjectRegistrationId_; + 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(); + hostProjectRegistrationId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The ID to use for the Host Project Registration, which will
+   * become the final component of the host project registration's resource
+   * name. The ID must be the same as the Google cloud project specified in the
+   * host_project_registration.gcp_project field.
+   * 
+ * + * string host_project_registration_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for hostProjectRegistrationId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHostProjectRegistrationIdBytes() { + java.lang.Object ref = hostProjectRegistrationId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + hostProjectRegistrationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HOST_PROJECT_REGISTRATION_FIELD_NUMBER = 3; + private com.google.cloud.apihub.v1.HostProjectRegistration hostProjectRegistration_; + /** + * + * + *
+   * Required. The host project registration to register.
+   * 
+ * + * + * .google.cloud.apihub.v1.HostProjectRegistration host_project_registration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the hostProjectRegistration field is set. + */ + @java.lang.Override + public boolean hasHostProjectRegistration() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The host project registration to register.
+   * 
+ * + * + * .google.cloud.apihub.v1.HostProjectRegistration host_project_registration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The hostProjectRegistration. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.HostProjectRegistration getHostProjectRegistration() { + return hostProjectRegistration_ == null + ? com.google.cloud.apihub.v1.HostProjectRegistration.getDefaultInstance() + : hostProjectRegistration_; + } + /** + * + * + *
+   * Required. The host project registration to register.
+   * 
+ * + * + * .google.cloud.apihub.v1.HostProjectRegistration host_project_registration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.HostProjectRegistrationOrBuilder + getHostProjectRegistrationOrBuilder() { + return hostProjectRegistration_ == null + ? com.google.cloud.apihub.v1.HostProjectRegistration.getDefaultInstance() + : hostProjectRegistration_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(hostProjectRegistrationId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, hostProjectRegistrationId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getHostProjectRegistration()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(hostProjectRegistrationId_)) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize(2, hostProjectRegistrationId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, getHostProjectRegistration()); + } + size += getUnknownFields().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.apihub.v1.CreateHostProjectRegistrationRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest other = + (com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getHostProjectRegistrationId().equals(other.getHostProjectRegistrationId())) return false; + if (hasHostProjectRegistration() != other.hasHostProjectRegistration()) return false; + if (hasHostProjectRegistration()) { + if (!getHostProjectRegistration().equals(other.getHostProjectRegistration())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + HOST_PROJECT_REGISTRATION_ID_FIELD_NUMBER; + hash = (53 * hash) + getHostProjectRegistrationId().hashCode(); + if (hasHostProjectRegistration()) { + hash = (37 * hash) + HOST_PROJECT_REGISTRATION_FIELD_NUMBER; + hash = (53 * hash) + getHostProjectRegistration().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest 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.apihub.v1.CreateHostProjectRegistrationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest 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.apihub.v1.CreateHostProjectRegistrationRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest 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.apihub.v1.CreateHostProjectRegistrationRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest 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.apihub.v1.CreateHostProjectRegistrationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest 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.apihub.v1.CreateHostProjectRegistrationRequest 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
+   * [CreateHostProjectRegistration][google.cloud.apihub.v1.HostProjectRegistrationService.CreateHostProjectRegistration]
+   * method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.CreateHostProjectRegistrationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.CreateHostProjectRegistrationRequest) + com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.HostProjectRegistrationServiceProto + .internal_static_google_cloud_apihub_v1_CreateHostProjectRegistrationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.HostProjectRegistrationServiceProto + .internal_static_google_cloud_apihub_v1_CreateHostProjectRegistrationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest.class, + com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getHostProjectRegistrationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + hostProjectRegistrationId_ = ""; + hostProjectRegistration_ = null; + if (hostProjectRegistrationBuilder_ != null) { + hostProjectRegistrationBuilder_.dispose(); + hostProjectRegistrationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.HostProjectRegistrationServiceProto + .internal_static_google_cloud_apihub_v1_CreateHostProjectRegistrationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest build() { + com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest buildPartial() { + com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest result = + new com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.hostProjectRegistrationId_ = hostProjectRegistrationId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.hostProjectRegistration_ = + hostProjectRegistrationBuilder_ == null + ? hostProjectRegistration_ + : hostProjectRegistrationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.CreateHostProjectRegistrationRequest) { + return mergeFrom((com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest other) { + if (other + == com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getHostProjectRegistrationId().isEmpty()) { + hostProjectRegistrationId_ = other.hostProjectRegistrationId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasHostProjectRegistration()) { + mergeHostProjectRegistration(other.getHostProjectRegistration()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + hostProjectRegistrationId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + getHostProjectRegistrationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource for the host project.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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 parent resource for the host project.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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 parent resource for the host project.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource for the host project.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource for the host project.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object hostProjectRegistrationId_ = ""; + /** + * + * + *
+     * Required. The ID to use for the Host Project Registration, which will
+     * become the final component of the host project registration's resource
+     * name. The ID must be the same as the Google cloud project specified in the
+     * host_project_registration.gcp_project field.
+     * 
+ * + * string host_project_registration_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The hostProjectRegistrationId. + */ + public java.lang.String getHostProjectRegistrationId() { + java.lang.Object ref = hostProjectRegistrationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + hostProjectRegistrationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the Host Project Registration, which will
+     * become the final component of the host project registration's resource
+     * name. The ID must be the same as the Google cloud project specified in the
+     * host_project_registration.gcp_project field.
+     * 
+ * + * string host_project_registration_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for hostProjectRegistrationId. + */ + public com.google.protobuf.ByteString getHostProjectRegistrationIdBytes() { + java.lang.Object ref = hostProjectRegistrationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + hostProjectRegistrationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the Host Project Registration, which will
+     * become the final component of the host project registration's resource
+     * name. The ID must be the same as the Google cloud project specified in the
+     * host_project_registration.gcp_project field.
+     * 
+ * + * string host_project_registration_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The hostProjectRegistrationId to set. + * @return This builder for chaining. + */ + public Builder setHostProjectRegistrationId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + hostProjectRegistrationId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the Host Project Registration, which will
+     * become the final component of the host project registration's resource
+     * name. The ID must be the same as the Google cloud project specified in the
+     * host_project_registration.gcp_project field.
+     * 
+ * + * string host_project_registration_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearHostProjectRegistrationId() { + hostProjectRegistrationId_ = getDefaultInstance().getHostProjectRegistrationId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the Host Project Registration, which will
+     * become the final component of the host project registration's resource
+     * name. The ID must be the same as the Google cloud project specified in the
+     * host_project_registration.gcp_project field.
+     * 
+ * + * string host_project_registration_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The bytes for hostProjectRegistrationId to set. + * @return This builder for chaining. + */ + public Builder setHostProjectRegistrationIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + hostProjectRegistrationId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.apihub.v1.HostProjectRegistration hostProjectRegistration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.HostProjectRegistration, + com.google.cloud.apihub.v1.HostProjectRegistration.Builder, + com.google.cloud.apihub.v1.HostProjectRegistrationOrBuilder> + hostProjectRegistrationBuilder_; + /** + * + * + *
+     * Required. The host project registration to register.
+     * 
+ * + * + * .google.cloud.apihub.v1.HostProjectRegistration host_project_registration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the hostProjectRegistration field is set. + */ + public boolean hasHostProjectRegistration() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The host project registration to register.
+     * 
+ * + * + * .google.cloud.apihub.v1.HostProjectRegistration host_project_registration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The hostProjectRegistration. + */ + public com.google.cloud.apihub.v1.HostProjectRegistration getHostProjectRegistration() { + if (hostProjectRegistrationBuilder_ == null) { + return hostProjectRegistration_ == null + ? com.google.cloud.apihub.v1.HostProjectRegistration.getDefaultInstance() + : hostProjectRegistration_; + } else { + return hostProjectRegistrationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The host project registration to register.
+     * 
+ * + * + * .google.cloud.apihub.v1.HostProjectRegistration host_project_registration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setHostProjectRegistration( + com.google.cloud.apihub.v1.HostProjectRegistration value) { + if (hostProjectRegistrationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + hostProjectRegistration_ = value; + } else { + hostProjectRegistrationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The host project registration to register.
+     * 
+ * + * + * .google.cloud.apihub.v1.HostProjectRegistration host_project_registration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setHostProjectRegistration( + com.google.cloud.apihub.v1.HostProjectRegistration.Builder builderForValue) { + if (hostProjectRegistrationBuilder_ == null) { + hostProjectRegistration_ = builderForValue.build(); + } else { + hostProjectRegistrationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The host project registration to register.
+     * 
+ * + * + * .google.cloud.apihub.v1.HostProjectRegistration host_project_registration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeHostProjectRegistration( + com.google.cloud.apihub.v1.HostProjectRegistration value) { + if (hostProjectRegistrationBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && hostProjectRegistration_ != null + && hostProjectRegistration_ + != com.google.cloud.apihub.v1.HostProjectRegistration.getDefaultInstance()) { + getHostProjectRegistrationBuilder().mergeFrom(value); + } else { + hostProjectRegistration_ = value; + } + } else { + hostProjectRegistrationBuilder_.mergeFrom(value); + } + if (hostProjectRegistration_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The host project registration to register.
+     * 
+ * + * + * .google.cloud.apihub.v1.HostProjectRegistration host_project_registration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearHostProjectRegistration() { + bitField0_ = (bitField0_ & ~0x00000004); + hostProjectRegistration_ = null; + if (hostProjectRegistrationBuilder_ != null) { + hostProjectRegistrationBuilder_.dispose(); + hostProjectRegistrationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The host project registration to register.
+     * 
+ * + * + * .google.cloud.apihub.v1.HostProjectRegistration host_project_registration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.HostProjectRegistration.Builder + getHostProjectRegistrationBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getHostProjectRegistrationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The host project registration to register.
+     * 
+ * + * + * .google.cloud.apihub.v1.HostProjectRegistration host_project_registration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.HostProjectRegistrationOrBuilder + getHostProjectRegistrationOrBuilder() { + if (hostProjectRegistrationBuilder_ != null) { + return hostProjectRegistrationBuilder_.getMessageOrBuilder(); + } else { + return hostProjectRegistration_ == null + ? com.google.cloud.apihub.v1.HostProjectRegistration.getDefaultInstance() + : hostProjectRegistration_; + } + } + /** + * + * + *
+     * Required. The host project registration to register.
+     * 
+ * + * + * .google.cloud.apihub.v1.HostProjectRegistration host_project_registration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.HostProjectRegistration, + com.google.cloud.apihub.v1.HostProjectRegistration.Builder, + com.google.cloud.apihub.v1.HostProjectRegistrationOrBuilder> + getHostProjectRegistrationFieldBuilder() { + if (hostProjectRegistrationBuilder_ == null) { + hostProjectRegistrationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.HostProjectRegistration, + com.google.cloud.apihub.v1.HostProjectRegistration.Builder, + com.google.cloud.apihub.v1.HostProjectRegistrationOrBuilder>( + getHostProjectRegistration(), getParentForChildren(), isClean()); + hostProjectRegistration_ = null; + } + return hostProjectRegistrationBuilder_; + } + + @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.apihub.v1.CreateHostProjectRegistrationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.CreateHostProjectRegistrationRequest) + private static final com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest(); + } + + public static com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateHostProjectRegistrationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.CreateHostProjectRegistrationRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateHostProjectRegistrationRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateHostProjectRegistrationRequestOrBuilder.java new file mode 100644 index 000000000000..3ed3b57eae82 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateHostProjectRegistrationRequestOrBuilder.java @@ -0,0 +1,129 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/host_project_registration_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface CreateHostProjectRegistrationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.CreateHostProjectRegistrationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource for the host project.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource for the host project.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The ID to use for the Host Project Registration, which will
+   * become the final component of the host project registration's resource
+   * name. The ID must be the same as the Google cloud project specified in the
+   * host_project_registration.gcp_project field.
+   * 
+ * + * string host_project_registration_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The hostProjectRegistrationId. + */ + java.lang.String getHostProjectRegistrationId(); + /** + * + * + *
+   * Required. The ID to use for the Host Project Registration, which will
+   * become the final component of the host project registration's resource
+   * name. The ID must be the same as the Google cloud project specified in the
+   * host_project_registration.gcp_project field.
+   * 
+ * + * string host_project_registration_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for hostProjectRegistrationId. + */ + com.google.protobuf.ByteString getHostProjectRegistrationIdBytes(); + + /** + * + * + *
+   * Required. The host project registration to register.
+   * 
+ * + * + * .google.cloud.apihub.v1.HostProjectRegistration host_project_registration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the hostProjectRegistration field is set. + */ + boolean hasHostProjectRegistration(); + /** + * + * + *
+   * Required. The host project registration to register.
+   * 
+ * + * + * .google.cloud.apihub.v1.HostProjectRegistration host_project_registration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The hostProjectRegistration. + */ + com.google.cloud.apihub.v1.HostProjectRegistration getHostProjectRegistration(); + /** + * + * + *
+   * Required. The host project registration to register.
+   * 
+ * + * + * .google.cloud.apihub.v1.HostProjectRegistration host_project_registration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.apihub.v1.HostProjectRegistrationOrBuilder getHostProjectRegistrationOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateRuntimeProjectAttachmentRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateRuntimeProjectAttachmentRequest.java new file mode 100644 index 000000000000..cfd520495711 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateRuntimeProjectAttachmentRequest.java @@ -0,0 +1,1188 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/runtime_project_attachment_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The
+ * [CreateRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.CreateRuntimeProjectAttachment]
+ * method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest} + */ +public final class CreateRuntimeProjectAttachmentRequest + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest) + CreateRuntimeProjectAttachmentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateRuntimeProjectAttachmentRequest.newBuilder() to construct. + private CreateRuntimeProjectAttachmentRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateRuntimeProjectAttachmentRequest() { + parent_ = ""; + runtimeProjectAttachmentId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateRuntimeProjectAttachmentRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_CreateRuntimeProjectAttachmentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_CreateRuntimeProjectAttachmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest.class, + com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent resource for the Runtime Project Attachment.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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 parent resource for the Runtime Project Attachment.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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 RUNTIME_PROJECT_ATTACHMENT_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object runtimeProjectAttachmentId_ = ""; + /** + * + * + *
+   * Required. The ID to use for the Runtime Project Attachment, which will
+   * become the final component of the Runtime Project Attachment's name. The ID
+   * must be the same as the project ID of the Google cloud project specified in
+   * the runtime_project_attachment.runtime_project field.
+   * 
+ * + * string runtime_project_attachment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The runtimeProjectAttachmentId. + */ + @java.lang.Override + public java.lang.String getRuntimeProjectAttachmentId() { + java.lang.Object ref = runtimeProjectAttachmentId_; + 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(); + runtimeProjectAttachmentId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The ID to use for the Runtime Project Attachment, which will
+   * become the final component of the Runtime Project Attachment's name. The ID
+   * must be the same as the project ID of the Google cloud project specified in
+   * the runtime_project_attachment.runtime_project field.
+   * 
+ * + * string runtime_project_attachment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for runtimeProjectAttachmentId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRuntimeProjectAttachmentIdBytes() { + java.lang.Object ref = runtimeProjectAttachmentId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + runtimeProjectAttachmentId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RUNTIME_PROJECT_ATTACHMENT_FIELD_NUMBER = 3; + private com.google.cloud.apihub.v1.RuntimeProjectAttachment runtimeProjectAttachment_; + /** + * + * + *
+   * Required. The Runtime Project Attachment to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the runtimeProjectAttachment field is set. + */ + @java.lang.Override + public boolean hasRuntimeProjectAttachment() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The Runtime Project Attachment to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The runtimeProjectAttachment. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.RuntimeProjectAttachment getRuntimeProjectAttachment() { + return runtimeProjectAttachment_ == null + ? com.google.cloud.apihub.v1.RuntimeProjectAttachment.getDefaultInstance() + : runtimeProjectAttachment_; + } + /** + * + * + *
+   * Required. The Runtime Project Attachment to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.RuntimeProjectAttachmentOrBuilder + getRuntimeProjectAttachmentOrBuilder() { + return runtimeProjectAttachment_ == null + ? com.google.cloud.apihub.v1.RuntimeProjectAttachment.getDefaultInstance() + : runtimeProjectAttachment_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(runtimeProjectAttachmentId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, runtimeProjectAttachmentId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getRuntimeProjectAttachment()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(runtimeProjectAttachmentId_)) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize(2, runtimeProjectAttachmentId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, getRuntimeProjectAttachment()); + } + size += getUnknownFields().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.apihub.v1.CreateRuntimeProjectAttachmentRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest other = + (com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getRuntimeProjectAttachmentId().equals(other.getRuntimeProjectAttachmentId())) + return false; + if (hasRuntimeProjectAttachment() != other.hasRuntimeProjectAttachment()) return false; + if (hasRuntimeProjectAttachment()) { + if (!getRuntimeProjectAttachment().equals(other.getRuntimeProjectAttachment())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + RUNTIME_PROJECT_ATTACHMENT_ID_FIELD_NUMBER; + hash = (53 * hash) + getRuntimeProjectAttachmentId().hashCode(); + if (hasRuntimeProjectAttachment()) { + hash = (37 * hash) + RUNTIME_PROJECT_ATTACHMENT_FIELD_NUMBER; + hash = (53 * hash) + getRuntimeProjectAttachment().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest 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.apihub.v1.CreateRuntimeProjectAttachmentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest 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.apihub.v1.CreateRuntimeProjectAttachmentRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest 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.apihub.v1.CreateRuntimeProjectAttachmentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest 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.apihub.v1.CreateRuntimeProjectAttachmentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest 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.apihub.v1.CreateRuntimeProjectAttachmentRequest 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
+   * [CreateRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.CreateRuntimeProjectAttachment]
+   * method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest) + com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_CreateRuntimeProjectAttachmentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_CreateRuntimeProjectAttachmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest.class, + com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRuntimeProjectAttachmentFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + runtimeProjectAttachmentId_ = ""; + runtimeProjectAttachment_ = null; + if (runtimeProjectAttachmentBuilder_ != null) { + runtimeProjectAttachmentBuilder_.dispose(); + runtimeProjectAttachmentBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_CreateRuntimeProjectAttachmentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest build() { + com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest buildPartial() { + com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest result = + new com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.runtimeProjectAttachmentId_ = runtimeProjectAttachmentId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.runtimeProjectAttachment_ = + runtimeProjectAttachmentBuilder_ == null + ? runtimeProjectAttachment_ + : runtimeProjectAttachmentBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.CreateRuntimeProjectAttachmentRequest) { + return mergeFrom((com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest other) { + if (other + == com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRuntimeProjectAttachmentId().isEmpty()) { + runtimeProjectAttachmentId_ = other.runtimeProjectAttachmentId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasRuntimeProjectAttachment()) { + mergeRuntimeProjectAttachment(other.getRuntimeProjectAttachment()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + runtimeProjectAttachmentId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + getRuntimeProjectAttachmentFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource for the Runtime Project Attachment.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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 parent resource for the Runtime Project Attachment.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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 parent resource for the Runtime Project Attachment.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource for the Runtime Project Attachment.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource for the Runtime Project Attachment.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object runtimeProjectAttachmentId_ = ""; + /** + * + * + *
+     * Required. The ID to use for the Runtime Project Attachment, which will
+     * become the final component of the Runtime Project Attachment's name. The ID
+     * must be the same as the project ID of the Google cloud project specified in
+     * the runtime_project_attachment.runtime_project field.
+     * 
+ * + * string runtime_project_attachment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The runtimeProjectAttachmentId. + */ + public java.lang.String getRuntimeProjectAttachmentId() { + java.lang.Object ref = runtimeProjectAttachmentId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + runtimeProjectAttachmentId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the Runtime Project Attachment, which will
+     * become the final component of the Runtime Project Attachment's name. The ID
+     * must be the same as the project ID of the Google cloud project specified in
+     * the runtime_project_attachment.runtime_project field.
+     * 
+ * + * string runtime_project_attachment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for runtimeProjectAttachmentId. + */ + public com.google.protobuf.ByteString getRuntimeProjectAttachmentIdBytes() { + java.lang.Object ref = runtimeProjectAttachmentId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + runtimeProjectAttachmentId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the Runtime Project Attachment, which will
+     * become the final component of the Runtime Project Attachment's name. The ID
+     * must be the same as the project ID of the Google cloud project specified in
+     * the runtime_project_attachment.runtime_project field.
+     * 
+ * + * string runtime_project_attachment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The runtimeProjectAttachmentId to set. + * @return This builder for chaining. + */ + public Builder setRuntimeProjectAttachmentId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + runtimeProjectAttachmentId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the Runtime Project Attachment, which will
+     * become the final component of the Runtime Project Attachment's name. The ID
+     * must be the same as the project ID of the Google cloud project specified in
+     * the runtime_project_attachment.runtime_project field.
+     * 
+ * + * string runtime_project_attachment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearRuntimeProjectAttachmentId() { + runtimeProjectAttachmentId_ = getDefaultInstance().getRuntimeProjectAttachmentId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the Runtime Project Attachment, which will
+     * become the final component of the Runtime Project Attachment's name. The ID
+     * must be the same as the project ID of the Google cloud project specified in
+     * the runtime_project_attachment.runtime_project field.
+     * 
+ * + * string runtime_project_attachment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The bytes for runtimeProjectAttachmentId to set. + * @return This builder for chaining. + */ + public Builder setRuntimeProjectAttachmentIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + runtimeProjectAttachmentId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.apihub.v1.RuntimeProjectAttachment runtimeProjectAttachment_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.RuntimeProjectAttachment, + com.google.cloud.apihub.v1.RuntimeProjectAttachment.Builder, + com.google.cloud.apihub.v1.RuntimeProjectAttachmentOrBuilder> + runtimeProjectAttachmentBuilder_; + /** + * + * + *
+     * Required. The Runtime Project Attachment to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the runtimeProjectAttachment field is set. + */ + public boolean hasRuntimeProjectAttachment() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The Runtime Project Attachment to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The runtimeProjectAttachment. + */ + public com.google.cloud.apihub.v1.RuntimeProjectAttachment getRuntimeProjectAttachment() { + if (runtimeProjectAttachmentBuilder_ == null) { + return runtimeProjectAttachment_ == null + ? com.google.cloud.apihub.v1.RuntimeProjectAttachment.getDefaultInstance() + : runtimeProjectAttachment_; + } else { + return runtimeProjectAttachmentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The Runtime Project Attachment to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRuntimeProjectAttachment( + com.google.cloud.apihub.v1.RuntimeProjectAttachment value) { + if (runtimeProjectAttachmentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + runtimeProjectAttachment_ = value; + } else { + runtimeProjectAttachmentBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Runtime Project Attachment to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRuntimeProjectAttachment( + com.google.cloud.apihub.v1.RuntimeProjectAttachment.Builder builderForValue) { + if (runtimeProjectAttachmentBuilder_ == null) { + runtimeProjectAttachment_ = builderForValue.build(); + } else { + runtimeProjectAttachmentBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Runtime Project Attachment to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeRuntimeProjectAttachment( + com.google.cloud.apihub.v1.RuntimeProjectAttachment value) { + if (runtimeProjectAttachmentBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && runtimeProjectAttachment_ != null + && runtimeProjectAttachment_ + != com.google.cloud.apihub.v1.RuntimeProjectAttachment.getDefaultInstance()) { + getRuntimeProjectAttachmentBuilder().mergeFrom(value); + } else { + runtimeProjectAttachment_ = value; + } + } else { + runtimeProjectAttachmentBuilder_.mergeFrom(value); + } + if (runtimeProjectAttachment_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The Runtime Project Attachment to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearRuntimeProjectAttachment() { + bitField0_ = (bitField0_ & ~0x00000004); + runtimeProjectAttachment_ = null; + if (runtimeProjectAttachmentBuilder_ != null) { + runtimeProjectAttachmentBuilder_.dispose(); + runtimeProjectAttachmentBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Runtime Project Attachment to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.RuntimeProjectAttachment.Builder + getRuntimeProjectAttachmentBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getRuntimeProjectAttachmentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The Runtime Project Attachment to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.RuntimeProjectAttachmentOrBuilder + getRuntimeProjectAttachmentOrBuilder() { + if (runtimeProjectAttachmentBuilder_ != null) { + return runtimeProjectAttachmentBuilder_.getMessageOrBuilder(); + } else { + return runtimeProjectAttachment_ == null + ? com.google.cloud.apihub.v1.RuntimeProjectAttachment.getDefaultInstance() + : runtimeProjectAttachment_; + } + } + /** + * + * + *
+     * Required. The Runtime Project Attachment to create.
+     * 
+ * + * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.RuntimeProjectAttachment, + com.google.cloud.apihub.v1.RuntimeProjectAttachment.Builder, + com.google.cloud.apihub.v1.RuntimeProjectAttachmentOrBuilder> + getRuntimeProjectAttachmentFieldBuilder() { + if (runtimeProjectAttachmentBuilder_ == null) { + runtimeProjectAttachmentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.RuntimeProjectAttachment, + com.google.cloud.apihub.v1.RuntimeProjectAttachment.Builder, + com.google.cloud.apihub.v1.RuntimeProjectAttachmentOrBuilder>( + getRuntimeProjectAttachment(), getParentForChildren(), isClean()); + runtimeProjectAttachment_ = null; + } + return runtimeProjectAttachmentBuilder_; + } + + @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.apihub.v1.CreateRuntimeProjectAttachmentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest) + private static final com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest(); + } + + public static com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateRuntimeProjectAttachmentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.CreateRuntimeProjectAttachmentRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateRuntimeProjectAttachmentRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateRuntimeProjectAttachmentRequestOrBuilder.java new file mode 100644 index 000000000000..d7f47843a1f1 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateRuntimeProjectAttachmentRequestOrBuilder.java @@ -0,0 +1,132 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/runtime_project_attachment_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface CreateRuntimeProjectAttachmentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource for the Runtime Project Attachment.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource for the Runtime Project Attachment.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The ID to use for the Runtime Project Attachment, which will
+   * become the final component of the Runtime Project Attachment's name. The ID
+   * must be the same as the project ID of the Google cloud project specified in
+   * the runtime_project_attachment.runtime_project field.
+   * 
+ * + * string runtime_project_attachment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The runtimeProjectAttachmentId. + */ + java.lang.String getRuntimeProjectAttachmentId(); + /** + * + * + *
+   * Required. The ID to use for the Runtime Project Attachment, which will
+   * become the final component of the Runtime Project Attachment's name. The ID
+   * must be the same as the project ID of the Google cloud project specified in
+   * the runtime_project_attachment.runtime_project field.
+   * 
+ * + * string runtime_project_attachment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for runtimeProjectAttachmentId. + */ + com.google.protobuf.ByteString getRuntimeProjectAttachmentIdBytes(); + + /** + * + * + *
+   * Required. The Runtime Project Attachment to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the runtimeProjectAttachment field is set. + */ + boolean hasRuntimeProjectAttachment(); + /** + * + * + *
+   * Required. The Runtime Project Attachment to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The runtimeProjectAttachment. + */ + com.google.cloud.apihub.v1.RuntimeProjectAttachment getRuntimeProjectAttachment(); + /** + * + * + *
+   * Required. The Runtime Project Attachment to create.
+   * 
+ * + * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.apihub.v1.RuntimeProjectAttachmentOrBuilder + getRuntimeProjectAttachmentOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateSpecRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateSpecRequest.java new file mode 100644 index 000000000000..86e99ff7654c --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateSpecRequest.java @@ -0,0 +1,1168 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [CreateSpec][google.cloud.apihub.v1.ApiHub.CreateSpec] method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.CreateSpecRequest} + */ +public final class CreateSpecRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.CreateSpecRequest) + CreateSpecRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateSpecRequest.newBuilder() to construct. + private CreateSpecRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateSpecRequest() { + parent_ = ""; + specId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateSpecRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateSpecRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateSpecRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.CreateSpecRequest.class, + com.google.cloud.apihub.v1.CreateSpecRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent resource for Spec.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * 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 parent resource for Spec.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * 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 SPEC_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object specId_ = ""; + /** + * + * + *
+   * Optional. The ID to use for the spec, which will become the final component
+   * of the spec's resource name. This field is optional.
+   *
+   * * If provided, the same will be used. The service will throw an error if
+   * the specified id is already used by another spec in the API
+   * resource.
+   * * If not provided, a system generated id will be used.
+   *
+   * This value should be 4-500 characters, and valid characters
+   * are /[a-z][A-Z][0-9]-_/.
+   * 
+ * + * string spec_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The specId. + */ + @java.lang.Override + public java.lang.String getSpecId() { + java.lang.Object ref = specId_; + 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(); + specId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The ID to use for the spec, which will become the final component
+   * of the spec's resource name. This field is optional.
+   *
+   * * If provided, the same will be used. The service will throw an error if
+   * the specified id is already used by another spec in the API
+   * resource.
+   * * If not provided, a system generated id will be used.
+   *
+   * This value should be 4-500 characters, and valid characters
+   * are /[a-z][A-Z][0-9]-_/.
+   * 
+ * + * string spec_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for specId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSpecIdBytes() { + java.lang.Object ref = specId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + specId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SPEC_FIELD_NUMBER = 3; + private com.google.cloud.apihub.v1.Spec spec_; + /** + * + * + *
+   * Required. The spec to create.
+   * 
+ * + * .google.cloud.apihub.v1.Spec spec = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the spec field is set. + */ + @java.lang.Override + public boolean hasSpec() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The spec to create.
+   * 
+ * + * .google.cloud.apihub.v1.Spec spec = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The spec. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Spec getSpec() { + return spec_ == null ? com.google.cloud.apihub.v1.Spec.getDefaultInstance() : spec_; + } + /** + * + * + *
+   * Required. The spec to create.
+   * 
+ * + * .google.cloud.apihub.v1.Spec spec = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.SpecOrBuilder getSpecOrBuilder() { + return spec_ == null ? com.google.cloud.apihub.v1.Spec.getDefaultInstance() : spec_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(specId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, specId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getSpec()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(specId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, specId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSpec()); + } + size += getUnknownFields().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.apihub.v1.CreateSpecRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.CreateSpecRequest other = + (com.google.cloud.apihub.v1.CreateSpecRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getSpecId().equals(other.getSpecId())) return false; + if (hasSpec() != other.hasSpec()) return false; + if (hasSpec()) { + if (!getSpec().equals(other.getSpec())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SPEC_ID_FIELD_NUMBER; + hash = (53 * hash) + getSpecId().hashCode(); + if (hasSpec()) { + hash = (37 * hash) + SPEC_FIELD_NUMBER; + hash = (53 * hash) + getSpec().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.CreateSpecRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateSpecRequest 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.apihub.v1.CreateSpecRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateSpecRequest 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.apihub.v1.CreateSpecRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateSpecRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.CreateSpecRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateSpecRequest 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.apihub.v1.CreateSpecRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateSpecRequest 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.apihub.v1.CreateSpecRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateSpecRequest 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.apihub.v1.CreateSpecRequest 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 [CreateSpec][google.cloud.apihub.v1.ApiHub.CreateSpec] method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.CreateSpecRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.CreateSpecRequest) + com.google.cloud.apihub.v1.CreateSpecRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateSpecRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateSpecRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.CreateSpecRequest.class, + com.google.cloud.apihub.v1.CreateSpecRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.CreateSpecRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSpecFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + specId_ = ""; + spec_ = null; + if (specBuilder_ != null) { + specBuilder_.dispose(); + specBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateSpecRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateSpecRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.CreateSpecRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateSpecRequest build() { + com.google.cloud.apihub.v1.CreateSpecRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateSpecRequest buildPartial() { + com.google.cloud.apihub.v1.CreateSpecRequest result = + new com.google.cloud.apihub.v1.CreateSpecRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.CreateSpecRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.specId_ = specId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.spec_ = specBuilder_ == null ? spec_ : specBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.CreateSpecRequest) { + return mergeFrom((com.google.cloud.apihub.v1.CreateSpecRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.CreateSpecRequest other) { + if (other == com.google.cloud.apihub.v1.CreateSpecRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getSpecId().isEmpty()) { + specId_ = other.specId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasSpec()) { + mergeSpec(other.getSpec()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + specId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getSpecFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource for Spec.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * 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 parent resource for Spec.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * 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 parent resource for Spec.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource for Spec.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource for Spec.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object specId_ = ""; + /** + * + * + *
+     * Optional. The ID to use for the spec, which will become the final component
+     * of the spec's resource name. This field is optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another spec in the API
+     * resource.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string spec_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The specId. + */ + public java.lang.String getSpecId() { + java.lang.Object ref = specId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + specId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The ID to use for the spec, which will become the final component
+     * of the spec's resource name. This field is optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another spec in the API
+     * resource.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string spec_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for specId. + */ + public com.google.protobuf.ByteString getSpecIdBytes() { + java.lang.Object ref = specId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + specId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The ID to use for the spec, which will become the final component
+     * of the spec's resource name. This field is optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another spec in the API
+     * resource.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string spec_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The specId to set. + * @return This builder for chaining. + */ + public Builder setSpecId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + specId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The ID to use for the spec, which will become the final component
+     * of the spec's resource name. This field is optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another spec in the API
+     * resource.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string spec_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearSpecId() { + specId_ = getDefaultInstance().getSpecId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The ID to use for the spec, which will become the final component
+     * of the spec's resource name. This field is optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another spec in the API
+     * resource.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string spec_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for specId to set. + * @return This builder for chaining. + */ + public Builder setSpecIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + specId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.apihub.v1.Spec spec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Spec, + com.google.cloud.apihub.v1.Spec.Builder, + com.google.cloud.apihub.v1.SpecOrBuilder> + specBuilder_; + /** + * + * + *
+     * Required. The spec to create.
+     * 
+ * + * .google.cloud.apihub.v1.Spec spec = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the spec field is set. + */ + public boolean hasSpec() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The spec to create.
+     * 
+ * + * .google.cloud.apihub.v1.Spec spec = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The spec. + */ + public com.google.cloud.apihub.v1.Spec getSpec() { + if (specBuilder_ == null) { + return spec_ == null ? com.google.cloud.apihub.v1.Spec.getDefaultInstance() : spec_; + } else { + return specBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The spec to create.
+     * 
+ * + * .google.cloud.apihub.v1.Spec spec = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setSpec(com.google.cloud.apihub.v1.Spec value) { + if (specBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + spec_ = value; + } else { + specBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The spec to create.
+     * 
+ * + * .google.cloud.apihub.v1.Spec spec = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setSpec(com.google.cloud.apihub.v1.Spec.Builder builderForValue) { + if (specBuilder_ == null) { + spec_ = builderForValue.build(); + } else { + specBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The spec to create.
+     * 
+ * + * .google.cloud.apihub.v1.Spec spec = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeSpec(com.google.cloud.apihub.v1.Spec value) { + if (specBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && spec_ != null + && spec_ != com.google.cloud.apihub.v1.Spec.getDefaultInstance()) { + getSpecBuilder().mergeFrom(value); + } else { + spec_ = value; + } + } else { + specBuilder_.mergeFrom(value); + } + if (spec_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The spec to create.
+     * 
+ * + * .google.cloud.apihub.v1.Spec spec = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearSpec() { + bitField0_ = (bitField0_ & ~0x00000004); + spec_ = null; + if (specBuilder_ != null) { + specBuilder_.dispose(); + specBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The spec to create.
+     * 
+ * + * .google.cloud.apihub.v1.Spec spec = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.apihub.v1.Spec.Builder getSpecBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The spec to create.
+     * 
+ * + * .google.cloud.apihub.v1.Spec spec = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.apihub.v1.SpecOrBuilder getSpecOrBuilder() { + if (specBuilder_ != null) { + return specBuilder_.getMessageOrBuilder(); + } else { + return spec_ == null ? com.google.cloud.apihub.v1.Spec.getDefaultInstance() : spec_; + } + } + /** + * + * + *
+     * Required. The spec to create.
+     * 
+ * + * .google.cloud.apihub.v1.Spec spec = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Spec, + com.google.cloud.apihub.v1.Spec.Builder, + com.google.cloud.apihub.v1.SpecOrBuilder> + getSpecFieldBuilder() { + if (specBuilder_ == null) { + specBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Spec, + com.google.cloud.apihub.v1.Spec.Builder, + com.google.cloud.apihub.v1.SpecOrBuilder>( + getSpec(), getParentForChildren(), isClean()); + spec_ = null; + } + return specBuilder_; + } + + @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.apihub.v1.CreateSpecRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.CreateSpecRequest) + private static final com.google.cloud.apihub.v1.CreateSpecRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.CreateSpecRequest(); + } + + public static com.google.cloud.apihub.v1.CreateSpecRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSpecRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.CreateSpecRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateSpecRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateSpecRequestOrBuilder.java new file mode 100644 index 000000000000..341f53e56244 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateSpecRequestOrBuilder.java @@ -0,0 +1,137 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface CreateSpecRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.CreateSpecRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource for Spec.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource for Spec.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The ID to use for the spec, which will become the final component
+   * of the spec's resource name. This field is optional.
+   *
+   * * If provided, the same will be used. The service will throw an error if
+   * the specified id is already used by another spec in the API
+   * resource.
+   * * If not provided, a system generated id will be used.
+   *
+   * This value should be 4-500 characters, and valid characters
+   * are /[a-z][A-Z][0-9]-_/.
+   * 
+ * + * string spec_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The specId. + */ + java.lang.String getSpecId(); + /** + * + * + *
+   * Optional. The ID to use for the spec, which will become the final component
+   * of the spec's resource name. This field is optional.
+   *
+   * * If provided, the same will be used. The service will throw an error if
+   * the specified id is already used by another spec in the API
+   * resource.
+   * * If not provided, a system generated id will be used.
+   *
+   * This value should be 4-500 characters, and valid characters
+   * are /[a-z][A-Z][0-9]-_/.
+   * 
+ * + * string spec_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for specId. + */ + com.google.protobuf.ByteString getSpecIdBytes(); + + /** + * + * + *
+   * Required. The spec to create.
+   * 
+ * + * .google.cloud.apihub.v1.Spec spec = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the spec field is set. + */ + boolean hasSpec(); + /** + * + * + *
+   * Required. The spec to create.
+   * 
+ * + * .google.cloud.apihub.v1.Spec spec = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The spec. + */ + com.google.cloud.apihub.v1.Spec getSpec(); + /** + * + * + *
+   * Required. The spec to create.
+   * 
+ * + * .google.cloud.apihub.v1.Spec spec = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.apihub.v1.SpecOrBuilder getSpecOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateVersionRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateVersionRequest.java new file mode 100644 index 000000000000..0a8da11441d6 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateVersionRequest.java @@ -0,0 +1,1173 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [CreateVersion][google.cloud.apihub.v1.ApiHub.CreateVersion] method's
+ * request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.CreateVersionRequest} + */ +public final class CreateVersionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.CreateVersionRequest) + CreateVersionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateVersionRequest.newBuilder() to construct. + private CreateVersionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateVersionRequest() { + parent_ = ""; + versionId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateVersionRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.CreateVersionRequest.class, + com.google.cloud.apihub.v1.CreateVersionRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent resource for API version.
+   * Format: `projects/{project}/locations/{location}/apis/{api}`
+   * 
+ * + * + * 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 parent resource for API version.
+   * Format: `projects/{project}/locations/{location}/apis/{api}`
+   * 
+ * + * + * 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 VERSION_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object versionId_ = ""; + /** + * + * + *
+   * Optional. The ID to use for the API version, which will become the final
+   * component of the version's resource name. This field is optional.
+   *
+   * * If provided, the same will be used. The service will throw an error if
+   * the specified id is already used by another version in the API resource.
+   * * If not provided, a system generated id will be used.
+   *
+   * This value should be 4-500 characters, and valid characters
+   * are /[a-z][A-Z][0-9]-_/.
+   * 
+ * + * string version_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The versionId. + */ + @java.lang.Override + public java.lang.String getVersionId() { + java.lang.Object ref = versionId_; + 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(); + versionId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The ID to use for the API version, which will become the final
+   * component of the version's resource name. This field is optional.
+   *
+   * * If provided, the same will be used. The service will throw an error if
+   * the specified id is already used by another version in the API resource.
+   * * If not provided, a system generated id will be used.
+   *
+   * This value should be 4-500 characters, and valid characters
+   * are /[a-z][A-Z][0-9]-_/.
+   * 
+ * + * string version_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for versionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVersionIdBytes() { + java.lang.Object ref = versionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + versionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERSION_FIELD_NUMBER = 3; + private com.google.cloud.apihub.v1.Version version_; + /** + * + * + *
+   * Required. The version to create.
+   * 
+ * + * .google.cloud.apihub.v1.Version version = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the version field is set. + */ + @java.lang.Override + public boolean hasVersion() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The version to create.
+   * 
+ * + * .google.cloud.apihub.v1.Version version = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The version. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Version getVersion() { + return version_ == null ? com.google.cloud.apihub.v1.Version.getDefaultInstance() : version_; + } + /** + * + * + *
+   * Required. The version to create.
+   * 
+ * + * .google.cloud.apihub.v1.Version version = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.VersionOrBuilder getVersionOrBuilder() { + return version_ == null ? com.google.cloud.apihub.v1.Version.getDefaultInstance() : version_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(versionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, versionId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getVersion()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(versionId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, versionId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getVersion()); + } + size += getUnknownFields().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.apihub.v1.CreateVersionRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.CreateVersionRequest other = + (com.google.cloud.apihub.v1.CreateVersionRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getVersionId().equals(other.getVersionId())) return false; + if (hasVersion() != other.hasVersion()) return false; + if (hasVersion()) { + if (!getVersion().equals(other.getVersion())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + VERSION_ID_FIELD_NUMBER; + hash = (53 * hash) + getVersionId().hashCode(); + if (hasVersion()) { + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.CreateVersionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateVersionRequest 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.apihub.v1.CreateVersionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateVersionRequest 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.apihub.v1.CreateVersionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.CreateVersionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.CreateVersionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateVersionRequest 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.apihub.v1.CreateVersionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateVersionRequest 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.apihub.v1.CreateVersionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.CreateVersionRequest 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.apihub.v1.CreateVersionRequest 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 [CreateVersion][google.cloud.apihub.v1.ApiHub.CreateVersion] method's
+   * request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.CreateVersionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.CreateVersionRequest) + com.google.cloud.apihub.v1.CreateVersionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.CreateVersionRequest.class, + com.google.cloud.apihub.v1.CreateVersionRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.CreateVersionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getVersionFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + versionId_ = ""; + version_ = null; + if (versionBuilder_ != null) { + versionBuilder_.dispose(); + versionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_CreateVersionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateVersionRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.CreateVersionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateVersionRequest build() { + com.google.cloud.apihub.v1.CreateVersionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.CreateVersionRequest buildPartial() { + com.google.cloud.apihub.v1.CreateVersionRequest result = + new com.google.cloud.apihub.v1.CreateVersionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.CreateVersionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.versionId_ = versionId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.version_ = versionBuilder_ == null ? version_ : versionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.CreateVersionRequest) { + return mergeFrom((com.google.cloud.apihub.v1.CreateVersionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.CreateVersionRequest other) { + if (other == com.google.cloud.apihub.v1.CreateVersionRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getVersionId().isEmpty()) { + versionId_ = other.versionId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasVersion()) { + mergeVersion(other.getVersion()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + versionId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getVersionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource for API version.
+     * Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * + * 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 parent resource for API version.
+     * Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * + * 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 parent resource for API version.
+     * Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource for API version.
+     * Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource for API version.
+     * Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object versionId_ = ""; + /** + * + * + *
+     * Optional. The ID to use for the API version, which will become the final
+     * component of the version's resource name. This field is optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another version in the API resource.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string version_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The versionId. + */ + public java.lang.String getVersionId() { + java.lang.Object ref = versionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + versionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The ID to use for the API version, which will become the final
+     * component of the version's resource name. This field is optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another version in the API resource.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string version_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for versionId. + */ + public com.google.protobuf.ByteString getVersionIdBytes() { + java.lang.Object ref = versionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + versionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The ID to use for the API version, which will become the final
+     * component of the version's resource name. This field is optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another version in the API resource.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string version_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The versionId to set. + * @return This builder for chaining. + */ + public Builder setVersionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + versionId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The ID to use for the API version, which will become the final
+     * component of the version's resource name. This field is optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another version in the API resource.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string version_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearVersionId() { + versionId_ = getDefaultInstance().getVersionId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The ID to use for the API version, which will become the final
+     * component of the version's resource name. This field is optional.
+     *
+     * * If provided, the same will be used. The service will throw an error if
+     * the specified id is already used by another version in the API resource.
+     * * If not provided, a system generated id will be used.
+     *
+     * This value should be 4-500 characters, and valid characters
+     * are /[a-z][A-Z][0-9]-_/.
+     * 
+ * + * string version_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for versionId to set. + * @return This builder for chaining. + */ + public Builder setVersionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + versionId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.apihub.v1.Version version_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Version, + com.google.cloud.apihub.v1.Version.Builder, + com.google.cloud.apihub.v1.VersionOrBuilder> + versionBuilder_; + /** + * + * + *
+     * Required. The version to create.
+     * 
+ * + * .google.cloud.apihub.v1.Version version = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the version field is set. + */ + public boolean hasVersion() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The version to create.
+     * 
+ * + * .google.cloud.apihub.v1.Version version = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The version. + */ + public com.google.cloud.apihub.v1.Version getVersion() { + if (versionBuilder_ == null) { + return version_ == null + ? com.google.cloud.apihub.v1.Version.getDefaultInstance() + : version_; + } else { + return versionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The version to create.
+     * 
+ * + * .google.cloud.apihub.v1.Version version = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setVersion(com.google.cloud.apihub.v1.Version value) { + if (versionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + version_ = value; + } else { + versionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The version to create.
+     * 
+ * + * .google.cloud.apihub.v1.Version version = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setVersion(com.google.cloud.apihub.v1.Version.Builder builderForValue) { + if (versionBuilder_ == null) { + version_ = builderForValue.build(); + } else { + versionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The version to create.
+     * 
+ * + * .google.cloud.apihub.v1.Version version = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeVersion(com.google.cloud.apihub.v1.Version value) { + if (versionBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && version_ != null + && version_ != com.google.cloud.apihub.v1.Version.getDefaultInstance()) { + getVersionBuilder().mergeFrom(value); + } else { + version_ = value; + } + } else { + versionBuilder_.mergeFrom(value); + } + if (version_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The version to create.
+     * 
+ * + * .google.cloud.apihub.v1.Version version = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearVersion() { + bitField0_ = (bitField0_ & ~0x00000004); + version_ = null; + if (versionBuilder_ != null) { + versionBuilder_.dispose(); + versionBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The version to create.
+     * 
+ * + * .google.cloud.apihub.v1.Version version = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.Version.Builder getVersionBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getVersionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The version to create.
+     * 
+ * + * .google.cloud.apihub.v1.Version version = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.VersionOrBuilder getVersionOrBuilder() { + if (versionBuilder_ != null) { + return versionBuilder_.getMessageOrBuilder(); + } else { + return version_ == null + ? com.google.cloud.apihub.v1.Version.getDefaultInstance() + : version_; + } + } + /** + * + * + *
+     * Required. The version to create.
+     * 
+ * + * .google.cloud.apihub.v1.Version version = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Version, + com.google.cloud.apihub.v1.Version.Builder, + com.google.cloud.apihub.v1.VersionOrBuilder> + getVersionFieldBuilder() { + if (versionBuilder_ == null) { + versionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Version, + com.google.cloud.apihub.v1.Version.Builder, + com.google.cloud.apihub.v1.VersionOrBuilder>( + getVersion(), getParentForChildren(), isClean()); + version_ = null; + } + return versionBuilder_; + } + + @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.apihub.v1.CreateVersionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.CreateVersionRequest) + private static final com.google.cloud.apihub.v1.CreateVersionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.CreateVersionRequest(); + } + + public static com.google.cloud.apihub.v1.CreateVersionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateVersionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.CreateVersionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateVersionRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateVersionRequestOrBuilder.java new file mode 100644 index 000000000000..177150a3fbe9 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/CreateVersionRequestOrBuilder.java @@ -0,0 +1,136 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface CreateVersionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.CreateVersionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource for API version.
+   * Format: `projects/{project}/locations/{location}/apis/{api}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource for API version.
+   * Format: `projects/{project}/locations/{location}/apis/{api}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The ID to use for the API version, which will become the final
+   * component of the version's resource name. This field is optional.
+   *
+   * * If provided, the same will be used. The service will throw an error if
+   * the specified id is already used by another version in the API resource.
+   * * If not provided, a system generated id will be used.
+   *
+   * This value should be 4-500 characters, and valid characters
+   * are /[a-z][A-Z][0-9]-_/.
+   * 
+ * + * string version_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The versionId. + */ + java.lang.String getVersionId(); + /** + * + * + *
+   * Optional. The ID to use for the API version, which will become the final
+   * component of the version's resource name. This field is optional.
+   *
+   * * If provided, the same will be used. The service will throw an error if
+   * the specified id is already used by another version in the API resource.
+   * * If not provided, a system generated id will be used.
+   *
+   * This value should be 4-500 characters, and valid characters
+   * are /[a-z][A-Z][0-9]-_/.
+   * 
+ * + * string version_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for versionId. + */ + com.google.protobuf.ByteString getVersionIdBytes(); + + /** + * + * + *
+   * Required. The version to create.
+   * 
+ * + * .google.cloud.apihub.v1.Version version = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the version field is set. + */ + boolean hasVersion(); + /** + * + * + *
+   * Required. The version to create.
+   * 
+ * + * .google.cloud.apihub.v1.Version version = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The version. + */ + com.google.cloud.apihub.v1.Version getVersion(); + /** + * + * + *
+   * Required. The version to create.
+   * 
+ * + * .google.cloud.apihub.v1.Version version = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.apihub.v1.VersionOrBuilder getVersionOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Definition.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Definition.java new file mode 100644 index 000000000000..1f4c52f347f1 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Definition.java @@ -0,0 +1,2605 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * Represents a definition for example schema, request, response definitions
+ * contained in an API version.
+ * A definition is added/updated/deleted in an API version when a new spec is
+ * added or an existing spec is updated/deleted in a version. Currently,
+ * definition will be created only corresponding to OpenAPI spec as parsing is
+ * supported for OpenAPI spec. Also, within OpenAPI spec, only `schema` object
+ * is supported.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Definition} + */ +public final class Definition extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.Definition) + DefinitionOrBuilder { + private static final long serialVersionUID = 0L; + // Use Definition.newBuilder() to construct. + private Definition(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Definition() { + name_ = ""; + spec_ = ""; + type_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Definition(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Definition_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 7: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Definition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Definition.class, + com.google.cloud.apihub.v1.Definition.Builder.class); + } + + /** + * + * + *
+   * Enumeration of definition types.
+   * 
+ * + * Protobuf enum {@code google.cloud.apihub.v1.Definition.Type} + */ + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Definition type unspecified.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Definition type schema.
+     * 
+ * + * SCHEMA = 1; + */ + SCHEMA(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Definition type unspecified.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Definition type schema.
+     * 
+ * + * SCHEMA = 1; + */ + public static final int SCHEMA_VALUE = 1; + + 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 Type 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 Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return SCHEMA; + 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 Type findValueByNumber(int number) { + return Type.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.apihub.v1.Definition.getDescriptor().getEnumTypes().get(0); + } + + private static final Type[] VALUES = values(); + + public static Type 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 Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.apihub.v1.Definition.Type) + } + + private int bitField0_; + private int valueCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object value_; + + public enum ValueCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SCHEMA(4), + VALUE_NOT_SET(0); + private final int value; + + private ValueCase(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 ValueCase valueOf(int value) { + return forNumber(value); + } + + public static ValueCase forNumber(int value) { + switch (value) { + case 4: + return SCHEMA; + case 0: + return VALUE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ValueCase getValueCase() { + return ValueCase.forNumber(valueCase_); + } + + public static final int SCHEMA_FIELD_NUMBER = 4; + /** + * + * + *
+   * Output only. The value of a schema definition.
+   * 
+ * + * .google.cloud.apihub.v1.Schema schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the schema field is set. + */ + @java.lang.Override + public boolean hasSchema() { + return valueCase_ == 4; + } + /** + * + * + *
+   * Output only. The value of a schema definition.
+   * 
+ * + * .google.cloud.apihub.v1.Schema schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The schema. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Schema getSchema() { + if (valueCase_ == 4) { + return (com.google.cloud.apihub.v1.Schema) value_; + } + return com.google.cloud.apihub.v1.Schema.getDefaultInstance(); + } + /** + * + * + *
+   * Output only. The value of a schema definition.
+   * 
+ * + * .google.cloud.apihub.v1.Schema schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.SchemaOrBuilder getSchemaOrBuilder() { + if (valueCase_ == 4) { + return (com.google.cloud.apihub.v1.Schema) value_; + } + return com.google.cloud.apihub.v1.Schema.getDefaultInstance(); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. The name of the definition.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+   * Identifier. The name of the definition.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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 SPEC_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object spec_ = ""; + /** + * + * + *
+   * Output only. The name of the spec from where the definition was parsed.
+   * Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * string spec = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The spec. + */ + @java.lang.Override + public java.lang.String getSpec() { + java.lang.Object ref = spec_; + 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(); + spec_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The name of the spec from where the definition was parsed.
+   * Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * string spec = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for spec. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSpecBytes() { + java.lang.Object ref = spec_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + spec_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 3; + private int type_ = 0; + /** + * + * + *
+   * Output only. The type of the definition.
+   * 
+ * + * + * .google.cloud.apihub.v1.Definition.Type type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+   * Output only. The type of the definition.
+   * 
+ * + * + * .google.cloud.apihub.v1.Definition.Type type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Definition.Type getType() { + com.google.cloud.apihub.v1.Definition.Type result = + com.google.cloud.apihub.v1.Definition.Type.forNumber(type_); + return result == null ? com.google.cloud.apihub.v1.Definition.Type.UNRECOGNIZED : result; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time at which the definition 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 ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. The time at which the definition 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. The time at which the definition was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The time at which the definition was last updated.
+   * 
+ * + * .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 ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Output only. The time at which the definition was last updated.
+   * 
+ * + * .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. The time at which the definition was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 7; + + private static final class AttributesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.apihub.v1.AttributeValues> + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Definition_AttributesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField + attributes_; + + private com.google.protobuf.MapField + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField(AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the
+   * definition resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().getMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the
+   * definition resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the
+   * definition resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.apihub.v1.AttributeValues getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the
+   * definition resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getAttributesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(spec_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, spec_); + } + if (type_ != com.google.cloud.apihub.v1.Definition.Type.TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(3, type_); + } + if (valueCase_ == 4) { + output.writeMessage(4, (com.google.cloud.apihub.v1.Schema) value_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(6, getUpdateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAttributes(), AttributesDefaultEntryHolder.defaultEntry, 7); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(spec_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, spec_); + } + if (type_ != com.google.cloud.apihub.v1.Definition.Type.TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, type_); + } + if (valueCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.apihub.v1.Schema) value_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getUpdateTime()); + } + for (java.util.Map.Entry entry : + internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry + attributes__ = + AttributesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, attributes__); + } + size += getUnknownFields().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.apihub.v1.Definition)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.Definition other = (com.google.cloud.apihub.v1.Definition) obj; + + if (!getName().equals(other.getName())) return false; + if (!getSpec().equals(other.getSpec())) return false; + if (type_ != other.type_) 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 (!internalGetAttributes().equals(other.internalGetAttributes())) return false; + if (!getValueCase().equals(other.getValueCase())) return false; + switch (valueCase_) { + case 4: + if (!getSchema().equals(other.getSchema())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SPEC_FIELD_NUMBER; + hash = (53 * hash) + getSpec().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + 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 (!internalGetAttributes().getMap().isEmpty()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttributes().hashCode(); + } + switch (valueCase_) { + case 4: + hash = (37 * hash) + SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getSchema().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.Definition parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Definition 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.apihub.v1.Definition parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Definition 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.apihub.v1.Definition parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Definition parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.Definition parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Definition 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.apihub.v1.Definition parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Definition 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.apihub.v1.Definition parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Definition 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.apihub.v1.Definition 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; + } + /** + * + * + *
+   * Represents a definition for example schema, request, response definitions
+   * contained in an API version.
+   * A definition is added/updated/deleted in an API version when a new spec is
+   * added or an existing spec is updated/deleted in a version. Currently,
+   * definition will be created only corresponding to OpenAPI spec as parsing is
+   * supported for OpenAPI spec. Also, within OpenAPI spec, only `schema` object
+   * is supported.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Definition} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.Definition) + com.google.cloud.apihub.v1.DefinitionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Definition_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 7: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 7: + return internalGetMutableAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Definition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Definition.class, + com.google.cloud.apihub.v1.Definition.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.Definition.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCreateTimeFieldBuilder(); + getUpdateTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (schemaBuilder_ != null) { + schemaBuilder_.clear(); + } + name_ = ""; + spec_ = ""; + type_ = 0; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + internalGetMutableAttributes().clear(); + valueCase_ = 0; + value_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Definition_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Definition getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.Definition.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Definition build() { + com.google.cloud.apihub.v1.Definition result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Definition buildPartial() { + com.google.cloud.apihub.v1.Definition result = + new com.google.cloud.apihub.v1.Definition(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.Definition result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.spec_ = spec_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.type_ = type_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.attributes_ = + internalGetAttributes().build(AttributesDefaultEntryHolder.defaultEntry); + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.apihub.v1.Definition result) { + result.valueCase_ = valueCase_; + result.value_ = this.value_; + if (valueCase_ == 4 && schemaBuilder_ != null) { + result.value_ = schemaBuilder_.build(); + } + } + + @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.apihub.v1.Definition) { + return mergeFrom((com.google.cloud.apihub.v1.Definition) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.Definition other) { + if (other == com.google.cloud.apihub.v1.Definition.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getSpec().isEmpty()) { + spec_ = other.spec_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + internalGetMutableAttributes().mergeFrom(other.internalGetAttributes()); + bitField0_ |= 0x00000040; + switch (other.getValueCase()) { + case SCHEMA: + { + mergeSchema(other.getSchema()); + break; + } + case VALUE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 10 + case 18: + { + spec_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 18 + case 24: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 24 + case 34: + { + input.readMessage(getSchemaFieldBuilder().getBuilder(), extensionRegistry); + valueCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.apihub.v1.AttributeValues> + attributes__ = + input.readMessage( + AttributesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAttributes() + .ensureBuilderMap() + .put(attributes__.getKey(), attributes__.getValue()); + bitField0_ |= 0x00000040; + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int valueCase_ = 0; + private java.lang.Object value_; + + public ValueCase getValueCase() { + return ValueCase.forNumber(valueCase_); + } + + public Builder clearValue() { + valueCase_ = 0; + value_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Schema, + com.google.cloud.apihub.v1.Schema.Builder, + com.google.cloud.apihub.v1.SchemaOrBuilder> + schemaBuilder_; + /** + * + * + *
+     * Output only. The value of a schema definition.
+     * 
+ * + * .google.cloud.apihub.v1.Schema schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the schema field is set. + */ + @java.lang.Override + public boolean hasSchema() { + return valueCase_ == 4; + } + /** + * + * + *
+     * Output only. The value of a schema definition.
+     * 
+ * + * .google.cloud.apihub.v1.Schema schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The schema. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Schema getSchema() { + if (schemaBuilder_ == null) { + if (valueCase_ == 4) { + return (com.google.cloud.apihub.v1.Schema) value_; + } + return com.google.cloud.apihub.v1.Schema.getDefaultInstance(); + } else { + if (valueCase_ == 4) { + return schemaBuilder_.getMessage(); + } + return com.google.cloud.apihub.v1.Schema.getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. The value of a schema definition.
+     * 
+ * + * .google.cloud.apihub.v1.Schema schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSchema(com.google.cloud.apihub.v1.Schema value) { + if (schemaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + onChanged(); + } else { + schemaBuilder_.setMessage(value); + } + valueCase_ = 4; + return this; + } + /** + * + * + *
+     * Output only. The value of a schema definition.
+     * 
+ * + * .google.cloud.apihub.v1.Schema schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSchema(com.google.cloud.apihub.v1.Schema.Builder builderForValue) { + if (schemaBuilder_ == null) { + value_ = builderForValue.build(); + onChanged(); + } else { + schemaBuilder_.setMessage(builderForValue.build()); + } + valueCase_ = 4; + return this; + } + /** + * + * + *
+     * Output only. The value of a schema definition.
+     * 
+ * + * .google.cloud.apihub.v1.Schema schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeSchema(com.google.cloud.apihub.v1.Schema value) { + if (schemaBuilder_ == null) { + if (valueCase_ == 4 && value_ != com.google.cloud.apihub.v1.Schema.getDefaultInstance()) { + value_ = + com.google.cloud.apihub.v1.Schema.newBuilder( + (com.google.cloud.apihub.v1.Schema) value_) + .mergeFrom(value) + .buildPartial(); + } else { + value_ = value; + } + onChanged(); + } else { + if (valueCase_ == 4) { + schemaBuilder_.mergeFrom(value); + } else { + schemaBuilder_.setMessage(value); + } + } + valueCase_ = 4; + return this; + } + /** + * + * + *
+     * Output only. The value of a schema definition.
+     * 
+ * + * .google.cloud.apihub.v1.Schema schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearSchema() { + if (schemaBuilder_ == null) { + if (valueCase_ == 4) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + } else { + if (valueCase_ == 4) { + valueCase_ = 0; + value_ = null; + } + schemaBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. The value of a schema definition.
+     * 
+ * + * .google.cloud.apihub.v1.Schema schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.apihub.v1.Schema.Builder getSchemaBuilder() { + return getSchemaFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The value of a schema definition.
+     * 
+ * + * .google.cloud.apihub.v1.Schema schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.SchemaOrBuilder getSchemaOrBuilder() { + if ((valueCase_ == 4) && (schemaBuilder_ != null)) { + return schemaBuilder_.getMessageOrBuilder(); + } else { + if (valueCase_ == 4) { + return (com.google.cloud.apihub.v1.Schema) value_; + } + return com.google.cloud.apihub.v1.Schema.getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. The value of a schema definition.
+     * 
+ * + * .google.cloud.apihub.v1.Schema schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Schema, + com.google.cloud.apihub.v1.Schema.Builder, + com.google.cloud.apihub.v1.SchemaOrBuilder> + getSchemaFieldBuilder() { + if (schemaBuilder_ == null) { + if (!(valueCase_ == 4)) { + value_ = com.google.cloud.apihub.v1.Schema.getDefaultInstance(); + } + schemaBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Schema, + com.google.cloud.apihub.v1.Schema.Builder, + com.google.cloud.apihub.v1.SchemaOrBuilder>( + (com.google.cloud.apihub.v1.Schema) value_, getParentForChildren(), isClean()); + value_ = null; + } + valueCase_ = 4; + onChanged(); + return schemaBuilder_; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. The name of the definition.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. The name of the definition.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. The name of the definition.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The name of the definition.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The name of the definition.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object spec_ = ""; + /** + * + * + *
+     * Output only. The name of the spec from where the definition was parsed.
+     * Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * string spec = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The spec. + */ + public java.lang.String getSpec() { + java.lang.Object ref = spec_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + spec_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The name of the spec from where the definition was parsed.
+     * Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * string spec = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for spec. + */ + public com.google.protobuf.ByteString getSpecBytes() { + java.lang.Object ref = spec_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + spec_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The name of the spec from where the definition was parsed.
+     * Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * string spec = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The spec to set. + * @return This builder for chaining. + */ + public Builder setSpec(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + spec_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the spec from where the definition was parsed.
+     * Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * string spec = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearSpec() { + spec_ = getDefaultInstance().getSpec(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the spec from where the definition was parsed.
+     * Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * string spec = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for spec to set. + * @return This builder for chaining. + */ + public Builder setSpecBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + spec_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int type_ = 0; + /** + * + * + *
+     * Output only. The type of the definition.
+     * 
+ * + * + * .google.cloud.apihub.v1.Definition.Type type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+     * Output only. The type of the definition.
+     * 
+ * + * + * .google.cloud.apihub.v1.Definition.Type type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The type of the definition.
+     * 
+ * + * + * .google.cloud.apihub.v1.Definition.Type type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Definition.Type getType() { + com.google.cloud.apihub.v1.Definition.Type result = + com.google.cloud.apihub.v1.Definition.Type.forNumber(type_); + return result == null ? com.google.cloud.apihub.v1.Definition.Type.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The type of the definition.
+     * 
+ * + * + * .google.cloud.apihub.v1.Definition.Type type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.apihub.v1.Definition.Type value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The type of the definition.
+     * 
+ * + * + * .google.cloud.apihub.v1.Definition.Type type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000008); + type_ = 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. The time at which the definition 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 ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Output only. The time at which the definition 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. The time at which the definition 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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the definition 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(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the definition 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 (((bitField0_ & 0x00000010) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The time at which the definition was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000010); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the definition was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time at which the definition 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. The time at which the definition 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. The time at which the definition was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Output only. The time at which the definition was last updated.
+     * 
+ * + * + * .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. The time at which the definition was last updated.
+     * 
+ * + * + * .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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the definition was last updated.
+     * 
+ * + * + * .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(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the definition was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The time at which the definition was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000020); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the definition was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time at which the definition was last updated.
+     * 
+ * + * + * .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. The time at which the definition was last updated.
+     * 
+ * + * + * .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 static final class AttributesConverter + implements com.google.protobuf.MapFieldBuilder.Converter< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues> { + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues build( + com.google.cloud.apihub.v1.AttributeValuesOrBuilder val) { + if (val instanceof com.google.cloud.apihub.v1.AttributeValues) { + return (com.google.cloud.apihub.v1.AttributeValues) val; + } + return ((com.google.cloud.apihub.v1.AttributeValues.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.apihub.v1.AttributeValues> + defaultEntry() { + return AttributesDefaultEntryHolder.defaultEntry; + } + }; + + private static final AttributesConverter attributesConverter = new AttributesConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder> + attributes_; + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder> + internalGetAttributes() { + if (attributes_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(attributesConverter); + } + return attributes_; + } + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder> + internalGetMutableAttributes() { + if (attributes_ == null) { + attributes_ = new com.google.protobuf.MapFieldBuilder<>(attributesConverter); + } + bitField0_ |= 0x00000040; + onChanged(); + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().ensureBuilderMap().size(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the
+     * definition resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().ensureBuilderMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the
+     * definition resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getImmutableMap(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the
+     * definition resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.apihub.v1.AttributeValues getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableAttributes().ensureBuilderMap(); + return map.containsKey(key) ? attributesConverter.build(map.get(key)) : defaultValue; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the
+     * definition resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getAttributesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableAttributes().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return attributesConverter.build(map.get(key)); + } + + public Builder clearAttributes() { + bitField0_ = (bitField0_ & ~0x00000040); + internalGetMutableAttributes().clear(); + return this; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the
+     * definition resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAttributes().ensureBuilderMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableAttributes() { + bitField0_ |= 0x00000040; + return internalGetMutableAttributes().ensureMessageMap(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the
+     * definition resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAttributes( + java.lang.String key, com.google.cloud.apihub.v1.AttributeValues value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAttributes().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00000040; + return this; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the
+     * definition resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllAttributes( + java.util.Map values) { + for (java.util.Map.Entry e : + values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableAttributes().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00000040; + return this; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the
+     * definition resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.AttributeValues.Builder putAttributesBuilderIfAbsent( + java.lang.String key) { + java.util.Map + builderMap = internalGetMutableAttributes().ensureBuilderMap(); + com.google.cloud.apihub.v1.AttributeValuesOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = com.google.cloud.apihub.v1.AttributeValues.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.cloud.apihub.v1.AttributeValues) { + entry = ((com.google.cloud.apihub.v1.AttributeValues) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.cloud.apihub.v1.AttributeValues.Builder) entry; + } + + @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.apihub.v1.Definition) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.Definition) + private static final com.google.cloud.apihub.v1.Definition DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.Definition(); + } + + public static com.google.cloud.apihub.v1.Definition getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Definition parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.Definition getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DefinitionName.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DefinitionName.java new file mode 100644 index 000000000000..86f242c9a24a --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DefinitionName.java @@ -0,0 +1,298 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +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 DefinitionName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_API_VERSION_DEFINITION = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String api; + private final String version; + private final String definition; + + @Deprecated + protected DefinitionName() { + project = null; + location = null; + api = null; + version = null; + definition = null; + } + + private DefinitionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + api = Preconditions.checkNotNull(builder.getApi()); + version = Preconditions.checkNotNull(builder.getVersion()); + definition = Preconditions.checkNotNull(builder.getDefinition()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getApi() { + return api; + } + + public String getVersion() { + return version; + } + + public String getDefinition() { + return definition; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static DefinitionName of( + String project, String location, String api, String version, String definition) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setApi(api) + .setVersion(version) + .setDefinition(definition) + .build(); + } + + public static String format( + String project, String location, String api, String version, String definition) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setApi(api) + .setVersion(version) + .setDefinition(definition) + .build() + .toString(); + } + + public static DefinitionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_API_VERSION_DEFINITION.validatedMatch( + formattedString, "DefinitionName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("api"), + matchMap.get("version"), + matchMap.get("definition")); + } + + 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 (DefinitionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_API_VERSION_DEFINITION.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); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (api != null) { + fieldMapBuilder.put("api", api); + } + if (version != null) { + fieldMapBuilder.put("version", version); + } + if (definition != null) { + fieldMapBuilder.put("definition", definition); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_API_VERSION_DEFINITION.instantiate( + "project", + project, + "location", + location, + "api", + api, + "version", + version, + "definition", + definition); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + DefinitionName that = ((DefinitionName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.api, that.api) + && Objects.equals(this.version, that.version) + && Objects.equals(this.definition, that.definition); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(api); + h *= 1000003; + h ^= Objects.hashCode(version); + h *= 1000003; + h ^= Objects.hashCode(definition); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}. + */ + public static class Builder { + private String project; + private String location; + private String api; + private String version; + private String definition; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getApi() { + return api; + } + + public String getVersion() { + return version; + } + + public String getDefinition() { + return definition; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setApi(String api) { + this.api = api; + return this; + } + + public Builder setVersion(String version) { + this.version = version; + return this; + } + + public Builder setDefinition(String definition) { + this.definition = definition; + return this; + } + + private Builder(DefinitionName definitionName) { + this.project = definitionName.project; + this.location = definitionName.location; + this.api = definitionName.api; + this.version = definitionName.version; + this.definition = definitionName.definition; + } + + public DefinitionName build() { + return new DefinitionName(this); + } + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DefinitionOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DefinitionOrBuilder.java new file mode 100644 index 000000000000..65e19443ca1b --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DefinitionOrBuilder.java @@ -0,0 +1,318 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface DefinitionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.Definition) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The value of a schema definition.
+   * 
+ * + * .google.cloud.apihub.v1.Schema schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the schema field is set. + */ + boolean hasSchema(); + /** + * + * + *
+   * Output only. The value of a schema definition.
+   * 
+ * + * .google.cloud.apihub.v1.Schema schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The schema. + */ + com.google.cloud.apihub.v1.Schema getSchema(); + /** + * + * + *
+   * Output only. The value of a schema definition.
+   * 
+ * + * .google.cloud.apihub.v1.Schema schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.apihub.v1.SchemaOrBuilder getSchemaOrBuilder(); + + /** + * + * + *
+   * Identifier. The name of the definition.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. The name of the definition.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The name of the spec from where the definition was parsed.
+   * Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * string spec = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The spec. + */ + java.lang.String getSpec(); + /** + * + * + *
+   * Output only. The name of the spec from where the definition was parsed.
+   * Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * string spec = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for spec. + */ + com.google.protobuf.ByteString getSpecBytes(); + + /** + * + * + *
+   * Output only. The type of the definition.
+   * 
+ * + * + * .google.cloud.apihub.v1.Definition.Type type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * + * + *
+   * Output only. The type of the definition.
+   * 
+ * + * + * .google.cloud.apihub.v1.Definition.Type type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The type. + */ + com.google.cloud.apihub.v1.Definition.Type getType(); + + /** + * + * + *
+   * Output only. The time at which the definition 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. The time at which the definition was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time at which the definition was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time at which the definition was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The time at which the definition was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The time at which the definition was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the
+   * definition resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getAttributesCount(); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the
+   * definition resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsAttributes(java.lang.String key); + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAttributes(); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the
+   * definition resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getAttributesMap(); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the
+   * definition resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues defaultValue); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the
+   * definition resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.AttributeValues getAttributesOrThrow(java.lang.String key); + + com.google.cloud.apihub.v1.Definition.ValueCase getValueCase(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteApiRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteApiRequest.java new file mode 100644 index 000000000000..9c44d964e9bf --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteApiRequest.java @@ -0,0 +1,742 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [DeleteApi][google.cloud.apihub.v1.ApiHub.DeleteApi] method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.DeleteApiRequest} + */ +public final class DeleteApiRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.DeleteApiRequest) + DeleteApiRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteApiRequest.newBuilder() to construct. + private DeleteApiRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteApiRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteApiRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteApiRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteApiRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.DeleteApiRequest.class, + com.google.cloud.apihub.v1.DeleteApiRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the API resource to delete.
+   * Format: `projects/{project}/locations/{location}/apis/{api}`
+   * 
+ * + * + * 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 API resource to delete.
+   * Format: `projects/{project}/locations/{location}/apis/{api}`
+   * 
+ * + * + * 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 FORCE_FIELD_NUMBER = 2; + private boolean force_ = false; + /** + * + * + *
+   * Optional. If set to true, any versions from this API will also be deleted.
+   * Otherwise, the request will only work if the API has no versions.
+   * 
+ * + * bool force = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (force_ != false) { + output.writeBool(2, force_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (force_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, force_); + } + size += getUnknownFields().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.apihub.v1.DeleteApiRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.DeleteApiRequest other = + (com.google.cloud.apihub.v1.DeleteApiRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (getForce() != other.getForce()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FORCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getForce()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.DeleteApiRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DeleteApiRequest 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.apihub.v1.DeleteApiRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DeleteApiRequest 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.apihub.v1.DeleteApiRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DeleteApiRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.DeleteApiRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DeleteApiRequest 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.apihub.v1.DeleteApiRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DeleteApiRequest 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.apihub.v1.DeleteApiRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DeleteApiRequest 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.apihub.v1.DeleteApiRequest 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 [DeleteApi][google.cloud.apihub.v1.ApiHub.DeleteApi] method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.DeleteApiRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.DeleteApiRequest) + com.google.cloud.apihub.v1.DeleteApiRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteApiRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteApiRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.DeleteApiRequest.class, + com.google.cloud.apihub.v1.DeleteApiRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.DeleteApiRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + force_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteApiRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DeleteApiRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.DeleteApiRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DeleteApiRequest build() { + com.google.cloud.apihub.v1.DeleteApiRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DeleteApiRequest buildPartial() { + com.google.cloud.apihub.v1.DeleteApiRequest result = + new com.google.cloud.apihub.v1.DeleteApiRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.DeleteApiRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.force_ = force_; + } + } + + @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.apihub.v1.DeleteApiRequest) { + return mergeFrom((com.google.cloud.apihub.v1.DeleteApiRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.DeleteApiRequest other) { + if (other == com.google.cloud.apihub.v1.DeleteApiRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getForce() != false) { + setForce(other.getForce()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + force_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the API resource to delete.
+     * Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * + * 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 API resource to delete.
+     * Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * + * 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 API resource to delete.
+     * Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the API resource to delete.
+     * Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the API resource to delete.
+     * Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private boolean force_; + /** + * + * + *
+     * Optional. If set to true, any versions from this API will also be deleted.
+     * Otherwise, the request will only work if the API has no versions.
+     * 
+ * + * bool force = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + /** + * + * + *
+     * Optional. If set to true, any versions from this API will also be deleted.
+     * Otherwise, the request will only work if the API has no versions.
+     * 
+ * + * bool force = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The force to set. + * @return This builder for chaining. + */ + public Builder setForce(boolean value) { + + force_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set to true, any versions from this API will also be deleted.
+     * Otherwise, the request will only work if the API has no versions.
+     * 
+ * + * bool force = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearForce() { + bitField0_ = (bitField0_ & ~0x00000002); + force_ = 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.apihub.v1.DeleteApiRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.DeleteApiRequest) + private static final com.google.cloud.apihub.v1.DeleteApiRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.DeleteApiRequest(); + } + + public static com.google.cloud.apihub.v1.DeleteApiRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteApiRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.DeleteApiRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteApiRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteApiRequestOrBuilder.java new file mode 100644 index 000000000000..cecc3034594e --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteApiRequestOrBuilder.java @@ -0,0 +1,71 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface DeleteApiRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.DeleteApiRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the API resource to delete.
+   * Format: `projects/{project}/locations/{location}/apis/{api}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the API resource to delete.
+   * Format: `projects/{project}/locations/{location}/apis/{api}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. If set to true, any versions from this API will also be deleted.
+   * Otherwise, the request will only work if the API has no versions.
+   * 
+ * + * bool force = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The force. + */ + boolean getForce(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteAttributeRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteAttributeRequest.java new file mode 100644 index 000000000000..aec931442b49 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteAttributeRequest.java @@ -0,0 +1,655 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [DeleteAttribute][google.cloud.apihub.v1.ApiHub.DeleteAttribute] method's
+ * request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.DeleteAttributeRequest} + */ +public final class DeleteAttributeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.DeleteAttributeRequest) + DeleteAttributeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteAttributeRequest.newBuilder() to construct. + private DeleteAttributeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteAttributeRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteAttributeRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteAttributeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteAttributeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.DeleteAttributeRequest.class, + com.google.cloud.apihub.v1.DeleteAttributeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the attribute to delete.
+   * Format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`
+   * 
+ * + * + * 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 attribute to delete.
+   * Format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`
+   * 
+ * + * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.apihub.v1.DeleteAttributeRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.DeleteAttributeRequest other = + (com.google.cloud.apihub.v1.DeleteAttributeRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.DeleteAttributeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DeleteAttributeRequest 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.apihub.v1.DeleteAttributeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DeleteAttributeRequest 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.apihub.v1.DeleteAttributeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DeleteAttributeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.DeleteAttributeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DeleteAttributeRequest 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.apihub.v1.DeleteAttributeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DeleteAttributeRequest 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.apihub.v1.DeleteAttributeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DeleteAttributeRequest 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.apihub.v1.DeleteAttributeRequest 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 [DeleteAttribute][google.cloud.apihub.v1.ApiHub.DeleteAttribute] method's
+   * request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.DeleteAttributeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.DeleteAttributeRequest) + com.google.cloud.apihub.v1.DeleteAttributeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteAttributeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteAttributeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.DeleteAttributeRequest.class, + com.google.cloud.apihub.v1.DeleteAttributeRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.DeleteAttributeRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteAttributeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DeleteAttributeRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.DeleteAttributeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DeleteAttributeRequest build() { + com.google.cloud.apihub.v1.DeleteAttributeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DeleteAttributeRequest buildPartial() { + com.google.cloud.apihub.v1.DeleteAttributeRequest result = + new com.google.cloud.apihub.v1.DeleteAttributeRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.DeleteAttributeRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.apihub.v1.DeleteAttributeRequest) { + return mergeFrom((com.google.cloud.apihub.v1.DeleteAttributeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.DeleteAttributeRequest other) { + if (other == com.google.cloud.apihub.v1.DeleteAttributeRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the attribute to delete.
+     * Format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`
+     * 
+ * + * + * 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 attribute to delete.
+     * Format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`
+     * 
+ * + * + * 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 attribute to delete.
+     * Format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the attribute to delete.
+     * Format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the attribute to delete.
+     * Format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.apihub.v1.DeleteAttributeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.DeleteAttributeRequest) + private static final com.google.cloud.apihub.v1.DeleteAttributeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.DeleteAttributeRequest(); + } + + public static com.google.cloud.apihub.v1.DeleteAttributeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteAttributeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.DeleteAttributeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteAttributeRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteAttributeRequestOrBuilder.java new file mode 100644 index 000000000000..05dacbac4004 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteAttributeRequestOrBuilder.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface DeleteAttributeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.DeleteAttributeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the attribute to delete.
+   * Format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the attribute to delete.
+   * Format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`
+   * 
+ * + * + * 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-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteDependencyRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteDependencyRequest.java new file mode 100644 index 000000000000..5c7d4e67895f --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteDependencyRequest.java @@ -0,0 +1,650 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The
+ * [DeleteDependency][google.cloud.apihub.v1.ApiHubDependencies.DeleteDependency]
+ * method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.DeleteDependencyRequest} + */ +public final class DeleteDependencyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.DeleteDependencyRequest) + DeleteDependencyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteDependencyRequest.newBuilder() to construct. + private DeleteDependencyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteDependencyRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteDependencyRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteDependencyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteDependencyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.DeleteDependencyRequest.class, + com.google.cloud.apihub.v1.DeleteDependencyRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the dependency resource to delete.
+   * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+   * 
+ * + * + * 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 dependency resource to delete.
+   * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+   * 
+ * + * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.apihub.v1.DeleteDependencyRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.DeleteDependencyRequest other = + (com.google.cloud.apihub.v1.DeleteDependencyRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.DeleteDependencyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DeleteDependencyRequest 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.apihub.v1.DeleteDependencyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DeleteDependencyRequest 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.apihub.v1.DeleteDependencyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DeleteDependencyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.DeleteDependencyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DeleteDependencyRequest 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.apihub.v1.DeleteDependencyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DeleteDependencyRequest 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.apihub.v1.DeleteDependencyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DeleteDependencyRequest 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.apihub.v1.DeleteDependencyRequest 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
+   * [DeleteDependency][google.cloud.apihub.v1.ApiHubDependencies.DeleteDependency]
+   * method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.DeleteDependencyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.DeleteDependencyRequest) + com.google.cloud.apihub.v1.DeleteDependencyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteDependencyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteDependencyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.DeleteDependencyRequest.class, + com.google.cloud.apihub.v1.DeleteDependencyRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.DeleteDependencyRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteDependencyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DeleteDependencyRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.DeleteDependencyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DeleteDependencyRequest build() { + com.google.cloud.apihub.v1.DeleteDependencyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DeleteDependencyRequest buildPartial() { + com.google.cloud.apihub.v1.DeleteDependencyRequest result = + new com.google.cloud.apihub.v1.DeleteDependencyRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.DeleteDependencyRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.apihub.v1.DeleteDependencyRequest) { + return mergeFrom((com.google.cloud.apihub.v1.DeleteDependencyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.DeleteDependencyRequest other) { + if (other == com.google.cloud.apihub.v1.DeleteDependencyRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the dependency resource to delete.
+     * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+     * 
+ * + * + * 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 dependency resource to delete.
+     * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+     * 
+ * + * + * 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 dependency resource to delete.
+     * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the dependency resource to delete.
+     * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the dependency resource to delete.
+     * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.apihub.v1.DeleteDependencyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.DeleteDependencyRequest) + private static final com.google.cloud.apihub.v1.DeleteDependencyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.DeleteDependencyRequest(); + } + + public static com.google.cloud.apihub.v1.DeleteDependencyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteDependencyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.DeleteDependencyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteDependencyRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteDependencyRequestOrBuilder.java new file mode 100644 index 000000000000..666e7da076ac --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteDependencyRequestOrBuilder.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface DeleteDependencyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.DeleteDependencyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the dependency resource to delete.
+   * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the dependency resource to delete.
+   * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+   * 
+ * + * + * 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-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteDeploymentRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteDeploymentRequest.java new file mode 100644 index 000000000000..0667e2805c48 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteDeploymentRequest.java @@ -0,0 +1,648 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [DeleteDeployment][google.cloud.apihub.v1.ApiHub.DeleteDeployment]
+ * method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.DeleteDeploymentRequest} + */ +public final class DeleteDeploymentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.DeleteDeploymentRequest) + DeleteDeploymentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteDeploymentRequest.newBuilder() to construct. + private DeleteDeploymentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteDeploymentRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteDeploymentRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteDeploymentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteDeploymentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.DeleteDeploymentRequest.class, + com.google.cloud.apihub.v1.DeleteDeploymentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the deployment resource to delete.
+   * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * + * 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 deployment resource to delete.
+   * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.apihub.v1.DeleteDeploymentRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.DeleteDeploymentRequest other = + (com.google.cloud.apihub.v1.DeleteDeploymentRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.DeleteDeploymentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DeleteDeploymentRequest 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.apihub.v1.DeleteDeploymentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DeleteDeploymentRequest 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.apihub.v1.DeleteDeploymentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DeleteDeploymentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.DeleteDeploymentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DeleteDeploymentRequest 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.apihub.v1.DeleteDeploymentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DeleteDeploymentRequest 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.apihub.v1.DeleteDeploymentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DeleteDeploymentRequest 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.apihub.v1.DeleteDeploymentRequest 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 [DeleteDeployment][google.cloud.apihub.v1.ApiHub.DeleteDeployment]
+   * method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.DeleteDeploymentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.DeleteDeploymentRequest) + com.google.cloud.apihub.v1.DeleteDeploymentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteDeploymentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteDeploymentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.DeleteDeploymentRequest.class, + com.google.cloud.apihub.v1.DeleteDeploymentRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.DeleteDeploymentRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteDeploymentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DeleteDeploymentRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.DeleteDeploymentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DeleteDeploymentRequest build() { + com.google.cloud.apihub.v1.DeleteDeploymentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DeleteDeploymentRequest buildPartial() { + com.google.cloud.apihub.v1.DeleteDeploymentRequest result = + new com.google.cloud.apihub.v1.DeleteDeploymentRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.DeleteDeploymentRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.apihub.v1.DeleteDeploymentRequest) { + return mergeFrom((com.google.cloud.apihub.v1.DeleteDeploymentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.DeleteDeploymentRequest other) { + if (other == com.google.cloud.apihub.v1.DeleteDeploymentRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the deployment resource to delete.
+     * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * 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 deployment resource to delete.
+     * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * 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 deployment resource to delete.
+     * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the deployment resource to delete.
+     * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the deployment resource to delete.
+     * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.apihub.v1.DeleteDeploymentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.DeleteDeploymentRequest) + private static final com.google.cloud.apihub.v1.DeleteDeploymentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.DeleteDeploymentRequest(); + } + + public static com.google.cloud.apihub.v1.DeleteDeploymentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteDeploymentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.DeleteDeploymentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteDeploymentRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteDeploymentRequestOrBuilder.java new file mode 100644 index 000000000000..0031be4a9bed --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteDeploymentRequestOrBuilder.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface DeleteDeploymentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.DeleteDeploymentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the deployment resource to delete.
+   * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the deployment resource to delete.
+   * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * + * 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-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteExternalApiRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteExternalApiRequest.java new file mode 100644 index 000000000000..e88709e50418 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteExternalApiRequest.java @@ -0,0 +1,655 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [DeleteExternalApi][google.cloud.apihub.v1.ApiHub.DeleteExternalApi]
+ * method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.DeleteExternalApiRequest} + */ +public final class DeleteExternalApiRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.DeleteExternalApiRequest) + DeleteExternalApiRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteExternalApiRequest.newBuilder() to construct. + private DeleteExternalApiRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteExternalApiRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteExternalApiRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteExternalApiRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteExternalApiRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.DeleteExternalApiRequest.class, + com.google.cloud.apihub.v1.DeleteExternalApiRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the External API resource to delete.
+   * Format:
+   * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+   * 
+ * + * + * 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 External API resource to delete.
+   * Format:
+   * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+   * 
+ * + * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.apihub.v1.DeleteExternalApiRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.DeleteExternalApiRequest other = + (com.google.cloud.apihub.v1.DeleteExternalApiRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.DeleteExternalApiRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DeleteExternalApiRequest 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.apihub.v1.DeleteExternalApiRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DeleteExternalApiRequest 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.apihub.v1.DeleteExternalApiRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DeleteExternalApiRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.DeleteExternalApiRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DeleteExternalApiRequest 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.apihub.v1.DeleteExternalApiRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DeleteExternalApiRequest 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.apihub.v1.DeleteExternalApiRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DeleteExternalApiRequest 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.apihub.v1.DeleteExternalApiRequest 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 [DeleteExternalApi][google.cloud.apihub.v1.ApiHub.DeleteExternalApi]
+   * method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.DeleteExternalApiRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.DeleteExternalApiRequest) + com.google.cloud.apihub.v1.DeleteExternalApiRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteExternalApiRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteExternalApiRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.DeleteExternalApiRequest.class, + com.google.cloud.apihub.v1.DeleteExternalApiRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.DeleteExternalApiRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteExternalApiRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DeleteExternalApiRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.DeleteExternalApiRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DeleteExternalApiRequest build() { + com.google.cloud.apihub.v1.DeleteExternalApiRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DeleteExternalApiRequest buildPartial() { + com.google.cloud.apihub.v1.DeleteExternalApiRequest result = + new com.google.cloud.apihub.v1.DeleteExternalApiRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.DeleteExternalApiRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.apihub.v1.DeleteExternalApiRequest) { + return mergeFrom((com.google.cloud.apihub.v1.DeleteExternalApiRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.DeleteExternalApiRequest other) { + if (other == com.google.cloud.apihub.v1.DeleteExternalApiRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the External API resource to delete.
+     * Format:
+     * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+     * 
+ * + * + * 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 External API resource to delete.
+     * Format:
+     * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+     * 
+ * + * + * 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 External API resource to delete.
+     * Format:
+     * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the External API resource to delete.
+     * Format:
+     * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the External API resource to delete.
+     * Format:
+     * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.apihub.v1.DeleteExternalApiRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.DeleteExternalApiRequest) + private static final com.google.cloud.apihub.v1.DeleteExternalApiRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.DeleteExternalApiRequest(); + } + + public static com.google.cloud.apihub.v1.DeleteExternalApiRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteExternalApiRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.DeleteExternalApiRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteExternalApiRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteExternalApiRequestOrBuilder.java new file mode 100644 index 000000000000..1ce2a88dc226 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteExternalApiRequestOrBuilder.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface DeleteExternalApiRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.DeleteExternalApiRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the External API resource to delete.
+   * Format:
+   * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the External API resource to delete.
+   * Format:
+   * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+   * 
+ * + * + * 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-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteRuntimeProjectAttachmentRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteRuntimeProjectAttachmentRequest.java new file mode 100644 index 000000000000..a67c168d7817 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteRuntimeProjectAttachmentRequest.java @@ -0,0 +1,667 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/runtime_project_attachment_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The
+ * [DeleteRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.DeleteRuntimeProjectAttachment]
+ * method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest} + */ +public final class DeleteRuntimeProjectAttachmentRequest + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest) + DeleteRuntimeProjectAttachmentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteRuntimeProjectAttachmentRequest.newBuilder() to construct. + private DeleteRuntimeProjectAttachmentRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteRuntimeProjectAttachmentRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteRuntimeProjectAttachmentRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_DeleteRuntimeProjectAttachmentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_DeleteRuntimeProjectAttachmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest.class, + com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the Runtime Project Attachment to delete.
+   * Format:
+   * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
+   * 
+ * + * + * 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 Runtime Project Attachment to delete.
+   * Format:
+   * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
+   * 
+ * + * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.apihub.v1.DeleteRuntimeProjectAttachmentRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest other = + (com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest 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.apihub.v1.DeleteRuntimeProjectAttachmentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest 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.apihub.v1.DeleteRuntimeProjectAttachmentRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest 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.apihub.v1.DeleteRuntimeProjectAttachmentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest 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.apihub.v1.DeleteRuntimeProjectAttachmentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest 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.apihub.v1.DeleteRuntimeProjectAttachmentRequest 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
+   * [DeleteRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.DeleteRuntimeProjectAttachment]
+   * method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest) + com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_DeleteRuntimeProjectAttachmentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_DeleteRuntimeProjectAttachmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest.class, + com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_DeleteRuntimeProjectAttachmentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest + getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest build() { + com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest buildPartial() { + com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest result = + new com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.apihub.v1.DeleteRuntimeProjectAttachmentRequest) { + return mergeFrom((com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest other) { + if (other + == com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the Runtime Project Attachment to delete.
+     * Format:
+     * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
+     * 
+ * + * + * 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 Runtime Project Attachment to delete.
+     * Format:
+     * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
+     * 
+ * + * + * 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 Runtime Project Attachment to delete.
+     * Format:
+     * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Runtime Project Attachment to delete.
+     * Format:
+     * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Runtime Project Attachment to delete.
+     * Format:
+     * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.apihub.v1.DeleteRuntimeProjectAttachmentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest) + private static final com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest(); + } + + public static com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteRuntimeProjectAttachmentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.DeleteRuntimeProjectAttachmentRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteRuntimeProjectAttachmentRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteRuntimeProjectAttachmentRequestOrBuilder.java new file mode 100644 index 000000000000..64ec63cfa4ca --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteRuntimeProjectAttachmentRequestOrBuilder.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/runtime_project_attachment_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface DeleteRuntimeProjectAttachmentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Runtime Project Attachment to delete.
+   * Format:
+   * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the Runtime Project Attachment to delete.
+   * Format:
+   * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
+   * 
+ * + * + * 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-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteSpecRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteSpecRequest.java new file mode 100644 index 000000000000..c99cecd3cdfa --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteSpecRequest.java @@ -0,0 +1,652 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [DeleteSpec][google.cloud.apihub.v1.ApiHub.DeleteSpec] method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.DeleteSpecRequest} + */ +public final class DeleteSpecRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.DeleteSpecRequest) + DeleteSpecRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteSpecRequest.newBuilder() to construct. + private DeleteSpecRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteSpecRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteSpecRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteSpecRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteSpecRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.DeleteSpecRequest.class, + com.google.cloud.apihub.v1.DeleteSpecRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the spec  to delete.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * 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 spec  to delete.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.apihub.v1.DeleteSpecRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.DeleteSpecRequest other = + (com.google.cloud.apihub.v1.DeleteSpecRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.DeleteSpecRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DeleteSpecRequest 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.apihub.v1.DeleteSpecRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DeleteSpecRequest 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.apihub.v1.DeleteSpecRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DeleteSpecRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.DeleteSpecRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DeleteSpecRequest 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.apihub.v1.DeleteSpecRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DeleteSpecRequest 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.apihub.v1.DeleteSpecRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DeleteSpecRequest 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.apihub.v1.DeleteSpecRequest 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 [DeleteSpec][google.cloud.apihub.v1.ApiHub.DeleteSpec] method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.DeleteSpecRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.DeleteSpecRequest) + com.google.cloud.apihub.v1.DeleteSpecRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteSpecRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteSpecRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.DeleteSpecRequest.class, + com.google.cloud.apihub.v1.DeleteSpecRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.DeleteSpecRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteSpecRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DeleteSpecRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.DeleteSpecRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DeleteSpecRequest build() { + com.google.cloud.apihub.v1.DeleteSpecRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DeleteSpecRequest buildPartial() { + com.google.cloud.apihub.v1.DeleteSpecRequest result = + new com.google.cloud.apihub.v1.DeleteSpecRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.DeleteSpecRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.apihub.v1.DeleteSpecRequest) { + return mergeFrom((com.google.cloud.apihub.v1.DeleteSpecRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.DeleteSpecRequest other) { + if (other == com.google.cloud.apihub.v1.DeleteSpecRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the spec  to delete.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * 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 spec  to delete.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * 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 spec  to delete.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the spec  to delete.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the spec  to delete.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.apihub.v1.DeleteSpecRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.DeleteSpecRequest) + private static final com.google.cloud.apihub.v1.DeleteSpecRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.DeleteSpecRequest(); + } + + public static com.google.cloud.apihub.v1.DeleteSpecRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteSpecRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.DeleteSpecRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteSpecRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteSpecRequestOrBuilder.java new file mode 100644 index 000000000000..bc545be47742 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteSpecRequestOrBuilder.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface DeleteSpecRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.DeleteSpecRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the spec  to delete.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the spec  to delete.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * 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-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteVersionRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteVersionRequest.java new file mode 100644 index 000000000000..3dafc10d4baa --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteVersionRequest.java @@ -0,0 +1,752 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [DeleteVersion][google.cloud.apihub.v1.ApiHub.DeleteVersion] method's
+ * request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.DeleteVersionRequest} + */ +public final class DeleteVersionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.DeleteVersionRequest) + DeleteVersionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteVersionRequest.newBuilder() to construct. + private DeleteVersionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteVersionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteVersionRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.DeleteVersionRequest.class, + com.google.cloud.apihub.v1.DeleteVersionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the version to delete.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * 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 version to delete.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * 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 FORCE_FIELD_NUMBER = 2; + private boolean force_ = false; + /** + * + * + *
+   * Optional. If set to true, any specs from this version will also be deleted.
+   * Otherwise, the request will only work if the version has no specs.
+   * 
+ * + * bool force = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (force_ != false) { + output.writeBool(2, force_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (force_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, force_); + } + size += getUnknownFields().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.apihub.v1.DeleteVersionRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.DeleteVersionRequest other = + (com.google.cloud.apihub.v1.DeleteVersionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (getForce() != other.getForce()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FORCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getForce()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.DeleteVersionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DeleteVersionRequest 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.apihub.v1.DeleteVersionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DeleteVersionRequest 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.apihub.v1.DeleteVersionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DeleteVersionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.DeleteVersionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DeleteVersionRequest 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.apihub.v1.DeleteVersionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DeleteVersionRequest 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.apihub.v1.DeleteVersionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DeleteVersionRequest 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.apihub.v1.DeleteVersionRequest 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 [DeleteVersion][google.cloud.apihub.v1.ApiHub.DeleteVersion] method's
+   * request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.DeleteVersionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.DeleteVersionRequest) + com.google.cloud.apihub.v1.DeleteVersionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.DeleteVersionRequest.class, + com.google.cloud.apihub.v1.DeleteVersionRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.DeleteVersionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + force_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_DeleteVersionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DeleteVersionRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.DeleteVersionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DeleteVersionRequest build() { + com.google.cloud.apihub.v1.DeleteVersionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DeleteVersionRequest buildPartial() { + com.google.cloud.apihub.v1.DeleteVersionRequest result = + new com.google.cloud.apihub.v1.DeleteVersionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.DeleteVersionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.force_ = force_; + } + } + + @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.apihub.v1.DeleteVersionRequest) { + return mergeFrom((com.google.cloud.apihub.v1.DeleteVersionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.DeleteVersionRequest other) { + if (other == com.google.cloud.apihub.v1.DeleteVersionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getForce() != false) { + setForce(other.getForce()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + force_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the version to delete.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * 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 version to delete.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * 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 version to delete.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the version to delete.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the version to delete.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private boolean force_; + /** + * + * + *
+     * Optional. If set to true, any specs from this version will also be deleted.
+     * Otherwise, the request will only work if the version has no specs.
+     * 
+ * + * bool force = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + /** + * + * + *
+     * Optional. If set to true, any specs from this version will also be deleted.
+     * Otherwise, the request will only work if the version has no specs.
+     * 
+ * + * bool force = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The force to set. + * @return This builder for chaining. + */ + public Builder setForce(boolean value) { + + force_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set to true, any specs from this version will also be deleted.
+     * Otherwise, the request will only work if the version has no specs.
+     * 
+ * + * bool force = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearForce() { + bitField0_ = (bitField0_ & ~0x00000002); + force_ = 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.apihub.v1.DeleteVersionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.DeleteVersionRequest) + private static final com.google.cloud.apihub.v1.DeleteVersionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.DeleteVersionRequest(); + } + + public static com.google.cloud.apihub.v1.DeleteVersionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteVersionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.DeleteVersionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteVersionRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteVersionRequestOrBuilder.java new file mode 100644 index 000000000000..961ca6352b0f --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeleteVersionRequestOrBuilder.java @@ -0,0 +1,73 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface DeleteVersionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.DeleteVersionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the version to delete.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the version to delete.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. If set to true, any specs from this version will also be deleted.
+   * Otherwise, the request will only work if the version has no specs.
+   * 
+ * + * bool force = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The force. + */ + boolean getForce(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Dependency.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Dependency.java new file mode 100644 index 000000000000..453227ae0c2c --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Dependency.java @@ -0,0 +1,3409 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * A dependency resource defined in the API hub describes a dependency directed
+ * from a consumer to a supplier entity. A dependency can be defined between two
+ * [Operations][google.cloud.apihub.v1.Operation] or between
+ * an [Operation][google.cloud.apihub.v1.Operation] and [External
+ * API][google.cloud.apihub.v1.ExternalApi].
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Dependency} + */ +public final class Dependency extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.Dependency) + DependencyOrBuilder { + private static final long serialVersionUID = 0L; + // Use Dependency.newBuilder() to construct. + private Dependency(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Dependency() { + name_ = ""; + state_ = 0; + description_ = ""; + discoveryMode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Dependency(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Dependency_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 10: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Dependency_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Dependency.class, + com.google.cloud.apihub.v1.Dependency.Builder.class); + } + + /** + * + * + *
+   * Possible states for a dependency.
+   * 
+ * + * Protobuf enum {@code google.cloud.apihub.v1.Dependency.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value. This value is unused.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Dependency will be in a proposed state when it is newly identified by the
+     * API hub on its own.
+     * 
+ * + * PROPOSED = 1; + */ + PROPOSED(1), + /** + * + * + *
+     * Dependency will be in a validated state when it is validated by the
+     * admin or manually created in the API hub.
+     * 
+ * + * VALIDATED = 2; + */ + VALIDATED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value. This value is unused.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Dependency will be in a proposed state when it is newly identified by the
+     * API hub on its own.
+     * 
+ * + * PROPOSED = 1; + */ + public static final int PROPOSED_VALUE = 1; + /** + * + * + *
+     * Dependency will be in a validated state when it is validated by the
+     * admin or manually created in the API hub.
+     * 
+ * + * VALIDATED = 2; + */ + public static final int VALIDATED_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 PROPOSED; + case 2: + return VALIDATED; + 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.apihub.v1.Dependency.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.apihub.v1.Dependency.State) + } + + /** + * + * + *
+   * Possible modes of discovering the dependency.
+   * 
+ * + * Protobuf enum {@code google.cloud.apihub.v1.Dependency.DiscoveryMode} + */ + public enum DiscoveryMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value. This value is unused.
+     * 
+ * + * DISCOVERY_MODE_UNSPECIFIED = 0; + */ + DISCOVERY_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Manual mode of discovery when the dependency is defined by the user.
+     * 
+ * + * MANUAL = 1; + */ + MANUAL(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value. This value is unused.
+     * 
+ * + * DISCOVERY_MODE_UNSPECIFIED = 0; + */ + public static final int DISCOVERY_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Manual mode of discovery when the dependency is defined by the user.
+     * 
+ * + * MANUAL = 1; + */ + public static final int MANUAL_VALUE = 1; + + 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 DiscoveryMode 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 DiscoveryMode forNumber(int value) { + switch (value) { + case 0: + return DISCOVERY_MODE_UNSPECIFIED; + case 1: + return MANUAL; + 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 DiscoveryMode findValueByNumber(int number) { + return DiscoveryMode.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.apihub.v1.Dependency.getDescriptor().getEnumTypes().get(1); + } + + private static final DiscoveryMode[] VALUES = values(); + + public static DiscoveryMode 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 DiscoveryMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.apihub.v1.Dependency.DiscoveryMode) + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. The name of the dependency in the API Hub.
+   *
+   * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+   * Identifier. The name of the dependency in the API Hub.
+   *
+   * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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 CONSUMER_FIELD_NUMBER = 2; + private com.google.cloud.apihub.v1.DependencyEntityReference consumer_; + /** + * + * + *
+   * Required. Immutable. The entity acting as the consumer in the dependency.
+   * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference consumer = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the consumer field is set. + */ + @java.lang.Override + public boolean hasConsumer() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. Immutable. The entity acting as the consumer in the dependency.
+   * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference consumer = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The consumer. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.DependencyEntityReference getConsumer() { + return consumer_ == null + ? com.google.cloud.apihub.v1.DependencyEntityReference.getDefaultInstance() + : consumer_; + } + /** + * + * + *
+   * Required. Immutable. The entity acting as the consumer in the dependency.
+   * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference consumer = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.DependencyEntityReferenceOrBuilder getConsumerOrBuilder() { + return consumer_ == null + ? com.google.cloud.apihub.v1.DependencyEntityReference.getDefaultInstance() + : consumer_; + } + + public static final int SUPPLIER_FIELD_NUMBER = 3; + private com.google.cloud.apihub.v1.DependencyEntityReference supplier_; + /** + * + * + *
+   * Required. Immutable. The entity acting as the supplier in the dependency.
+   * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference supplier = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the supplier field is set. + */ + @java.lang.Override + public boolean hasSupplier() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Required. Immutable. The entity acting as the supplier in the dependency.
+   * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference supplier = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The supplier. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.DependencyEntityReference getSupplier() { + return supplier_ == null + ? com.google.cloud.apihub.v1.DependencyEntityReference.getDefaultInstance() + : supplier_; + } + /** + * + * + *
+   * Required. Immutable. The entity acting as the supplier in the dependency.
+   * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference supplier = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.DependencyEntityReferenceOrBuilder getSupplierOrBuilder() { + return supplier_ == null + ? com.google.cloud.apihub.v1.DependencyEntityReference.getDefaultInstance() + : supplier_; + } + + public static final int STATE_FIELD_NUMBER = 4; + private int state_ = 0; + /** + * + * + *
+   * Output only. State of the dependency.
+   * 
+ * + * + * .google.cloud.apihub.v1.Dependency.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. State of the dependency.
+   * 
+ * + * + * .google.cloud.apihub.v1.Dependency.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Dependency.State getState() { + com.google.cloud.apihub.v1.Dependency.State result = + com.google.cloud.apihub.v1.Dependency.State.forNumber(state_); + return result == null ? com.google.cloud.apihub.v1.Dependency.State.UNRECOGNIZED : result; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * Optional. Human readable description corresponding of the dependency.
+   * 
+ * + * 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. Human readable description corresponding of the dependency.
+   * 
+ * + * 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 DISCOVERY_MODE_FIELD_NUMBER = 6; + private int discoveryMode_ = 0; + /** + * + * + *
+   * Output only. Discovery mode of the dependency.
+   * 
+ * + * + * .google.cloud.apihub.v1.Dependency.DiscoveryMode discovery_mode = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for discoveryMode. + */ + @java.lang.Override + public int getDiscoveryModeValue() { + return discoveryMode_; + } + /** + * + * + *
+   * Output only. Discovery mode of the dependency.
+   * 
+ * + * + * .google.cloud.apihub.v1.Dependency.DiscoveryMode discovery_mode = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The discoveryMode. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Dependency.DiscoveryMode getDiscoveryMode() { + com.google.cloud.apihub.v1.Dependency.DiscoveryMode result = + com.google.cloud.apihub.v1.Dependency.DiscoveryMode.forNumber(discoveryMode_); + return result == null + ? com.google.cloud.apihub.v1.Dependency.DiscoveryMode.UNRECOGNIZED + : result; + } + + public static final int ERROR_DETAIL_FIELD_NUMBER = 7; + private com.google.cloud.apihub.v1.DependencyErrorDetail errorDetail_; + /** + * + * + *
+   * Output only. Error details of a dependency if the system has detected it
+   * internally.
+   * 
+ * + * + * .google.cloud.apihub.v1.DependencyErrorDetail error_detail = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the errorDetail field is set. + */ + @java.lang.Override + public boolean hasErrorDetail() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Output only. Error details of a dependency if the system has detected it
+   * internally.
+   * 
+ * + * + * .google.cloud.apihub.v1.DependencyErrorDetail error_detail = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The errorDetail. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.DependencyErrorDetail getErrorDetail() { + return errorDetail_ == null + ? com.google.cloud.apihub.v1.DependencyErrorDetail.getDefaultInstance() + : errorDetail_; + } + /** + * + * + *
+   * Output only. Error details of a dependency if the system has detected it
+   * internally.
+   * 
+ * + * + * .google.cloud.apihub.v1.DependencyErrorDetail error_detail = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.DependencyErrorDetailOrBuilder getErrorDetailOrBuilder() { + return errorDetail_ == null + ? com.google.cloud.apihub.v1.DependencyErrorDetail.getDefaultInstance() + : errorDetail_; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 8; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time at which the dependency was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+   * Output only. The time at which the dependency was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 8 [(.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. The time at which the dependency was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 9; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The time at which the dependency was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+   * Output only. The time at which the dependency was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.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 time at which the dependency was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 10; + + private static final class AttributesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.apihub.v1.AttributeValues> + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Dependency_AttributesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField + attributes_; + + private com.google.protobuf.MapField + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField(AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the
+   * dependency resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().getMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the
+   * dependency resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the
+   * dependency resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.apihub.v1.AttributeValues getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the
+   * dependency resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getAttributesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getConsumer()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getSupplier()); + } + if (state_ != com.google.cloud.apihub.v1.Dependency.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, description_); + } + if (discoveryMode_ + != com.google.cloud.apihub.v1.Dependency.DiscoveryMode.DISCOVERY_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(6, discoveryMode_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(7, getErrorDetail()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(8, getCreateTime()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(9, getUpdateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAttributes(), AttributesDefaultEntryHolder.defaultEntry, 10); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getConsumer()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSupplier()); + } + if (state_ != com.google.cloud.apihub.v1.Dependency.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, description_); + } + if (discoveryMode_ + != com.google.cloud.apihub.v1.Dependency.DiscoveryMode.DISCOVERY_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, discoveryMode_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getErrorDetail()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getCreateTime()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getUpdateTime()); + } + for (java.util.Map.Entry entry : + internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry + attributes__ = + AttributesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, attributes__); + } + size += getUnknownFields().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.apihub.v1.Dependency)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.Dependency other = (com.google.cloud.apihub.v1.Dependency) obj; + + if (!getName().equals(other.getName())) return false; + if (hasConsumer() != other.hasConsumer()) return false; + if (hasConsumer()) { + if (!getConsumer().equals(other.getConsumer())) return false; + } + if (hasSupplier() != other.hasSupplier()) return false; + if (hasSupplier()) { + if (!getSupplier().equals(other.getSupplier())) return false; + } + if (state_ != other.state_) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (discoveryMode_ != other.discoveryMode_) return false; + if (hasErrorDetail() != other.hasErrorDetail()) return false; + if (hasErrorDetail()) { + if (!getErrorDetail().equals(other.getErrorDetail())) 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 (!internalGetAttributes().equals(other.internalGetAttributes())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (hasConsumer()) { + hash = (37 * hash) + CONSUMER_FIELD_NUMBER; + hash = (53 * hash) + getConsumer().hashCode(); + } + if (hasSupplier()) { + hash = (37 * hash) + SUPPLIER_FIELD_NUMBER; + hash = (53 * hash) + getSupplier().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + DISCOVERY_MODE_FIELD_NUMBER; + hash = (53 * hash) + discoveryMode_; + if (hasErrorDetail()) { + hash = (37 * hash) + ERROR_DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getErrorDetail().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 (!internalGetAttributes().getMap().isEmpty()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttributes().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.Dependency parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Dependency 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.apihub.v1.Dependency parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Dependency 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.apihub.v1.Dependency parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Dependency parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.Dependency parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Dependency 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.apihub.v1.Dependency parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Dependency 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.apihub.v1.Dependency parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Dependency 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.apihub.v1.Dependency 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 dependency resource defined in the API hub describes a dependency directed
+   * from a consumer to a supplier entity. A dependency can be defined between two
+   * [Operations][google.cloud.apihub.v1.Operation] or between
+   * an [Operation][google.cloud.apihub.v1.Operation] and [External
+   * API][google.cloud.apihub.v1.ExternalApi].
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Dependency} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.Dependency) + com.google.cloud.apihub.v1.DependencyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Dependency_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 10: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 10: + return internalGetMutableAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Dependency_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Dependency.class, + com.google.cloud.apihub.v1.Dependency.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.Dependency.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getConsumerFieldBuilder(); + getSupplierFieldBuilder(); + getErrorDetailFieldBuilder(); + getCreateTimeFieldBuilder(); + getUpdateTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + consumer_ = null; + if (consumerBuilder_ != null) { + consumerBuilder_.dispose(); + consumerBuilder_ = null; + } + supplier_ = null; + if (supplierBuilder_ != null) { + supplierBuilder_.dispose(); + supplierBuilder_ = null; + } + state_ = 0; + description_ = ""; + discoveryMode_ = 0; + errorDetail_ = null; + if (errorDetailBuilder_ != null) { + errorDetailBuilder_.dispose(); + errorDetailBuilder_ = null; + } + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + internalGetMutableAttributes().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Dependency_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Dependency getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.Dependency.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Dependency build() { + com.google.cloud.apihub.v1.Dependency result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Dependency buildPartial() { + com.google.cloud.apihub.v1.Dependency result = + new com.google.cloud.apihub.v1.Dependency(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.Dependency result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.consumer_ = consumerBuilder_ == null ? consumer_ : consumerBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.supplier_ = supplierBuilder_ == null ? supplier_ : supplierBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.discoveryMode_ = discoveryMode_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.errorDetail_ = + errorDetailBuilder_ == null ? errorDetail_ : errorDetailBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.attributes_ = + internalGetAttributes().build(AttributesDefaultEntryHolder.defaultEntry); + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.Dependency) { + return mergeFrom((com.google.cloud.apihub.v1.Dependency) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.Dependency other) { + if (other == com.google.cloud.apihub.v1.Dependency.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasConsumer()) { + mergeConsumer(other.getConsumer()); + } + if (other.hasSupplier()) { + mergeSupplier(other.getSupplier()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.discoveryMode_ != 0) { + setDiscoveryModeValue(other.getDiscoveryModeValue()); + } + if (other.hasErrorDetail()) { + mergeErrorDetail(other.getErrorDetail()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + internalGetMutableAttributes().mergeFrom(other.internalGetAttributes()); + bitField0_ |= 0x00000200; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getConsumerFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getSupplierFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + discoveryMode_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: + { + input.readMessage(getErrorDetailFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 74: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 82: + { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.apihub.v1.AttributeValues> + attributes__ = + input.readMessage( + AttributesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAttributes() + .ensureBuilderMap() + .put(attributes__.getKey(), attributes__.getValue()); + bitField0_ |= 0x00000200; + break; + } // case 82 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. The name of the dependency in the API Hub.
+     *
+     * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. The name of the dependency in the API Hub.
+     *
+     * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. The name of the dependency in the API Hub.
+     *
+     * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The name of the dependency in the API Hub.
+     *
+     * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The name of the dependency in the API Hub.
+     *
+     * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.apihub.v1.DependencyEntityReference consumer_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.DependencyEntityReference, + com.google.cloud.apihub.v1.DependencyEntityReference.Builder, + com.google.cloud.apihub.v1.DependencyEntityReferenceOrBuilder> + consumerBuilder_; + /** + * + * + *
+     * Required. Immutable. The entity acting as the consumer in the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference consumer = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the consumer field is set. + */ + public boolean hasConsumer() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. Immutable. The entity acting as the consumer in the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference consumer = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The consumer. + */ + public com.google.cloud.apihub.v1.DependencyEntityReference getConsumer() { + if (consumerBuilder_ == null) { + return consumer_ == null + ? com.google.cloud.apihub.v1.DependencyEntityReference.getDefaultInstance() + : consumer_; + } else { + return consumerBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Immutable. The entity acting as the consumer in the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference consumer = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConsumer(com.google.cloud.apihub.v1.DependencyEntityReference value) { + if (consumerBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + consumer_ = value; + } else { + consumerBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The entity acting as the consumer in the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference consumer = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConsumer( + com.google.cloud.apihub.v1.DependencyEntityReference.Builder builderForValue) { + if (consumerBuilder_ == null) { + consumer_ = builderForValue.build(); + } else { + consumerBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The entity acting as the consumer in the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference consumer = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeConsumer(com.google.cloud.apihub.v1.DependencyEntityReference value) { + if (consumerBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && consumer_ != null + && consumer_ + != com.google.cloud.apihub.v1.DependencyEntityReference.getDefaultInstance()) { + getConsumerBuilder().mergeFrom(value); + } else { + consumer_ = value; + } + } else { + consumerBuilder_.mergeFrom(value); + } + if (consumer_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. Immutable. The entity acting as the consumer in the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference consumer = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearConsumer() { + bitField0_ = (bitField0_ & ~0x00000002); + consumer_ = null; + if (consumerBuilder_ != null) { + consumerBuilder_.dispose(); + consumerBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The entity acting as the consumer in the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference consumer = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.DependencyEntityReference.Builder getConsumerBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getConsumerFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Immutable. The entity acting as the consumer in the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference consumer = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.DependencyEntityReferenceOrBuilder getConsumerOrBuilder() { + if (consumerBuilder_ != null) { + return consumerBuilder_.getMessageOrBuilder(); + } else { + return consumer_ == null + ? com.google.cloud.apihub.v1.DependencyEntityReference.getDefaultInstance() + : consumer_; + } + } + /** + * + * + *
+     * Required. Immutable. The entity acting as the consumer in the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference consumer = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.DependencyEntityReference, + com.google.cloud.apihub.v1.DependencyEntityReference.Builder, + com.google.cloud.apihub.v1.DependencyEntityReferenceOrBuilder> + getConsumerFieldBuilder() { + if (consumerBuilder_ == null) { + consumerBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.DependencyEntityReference, + com.google.cloud.apihub.v1.DependencyEntityReference.Builder, + com.google.cloud.apihub.v1.DependencyEntityReferenceOrBuilder>( + getConsumer(), getParentForChildren(), isClean()); + consumer_ = null; + } + return consumerBuilder_; + } + + private com.google.cloud.apihub.v1.DependencyEntityReference supplier_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.DependencyEntityReference, + com.google.cloud.apihub.v1.DependencyEntityReference.Builder, + com.google.cloud.apihub.v1.DependencyEntityReferenceOrBuilder> + supplierBuilder_; + /** + * + * + *
+     * Required. Immutable. The entity acting as the supplier in the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference supplier = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the supplier field is set. + */ + public boolean hasSupplier() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. Immutable. The entity acting as the supplier in the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference supplier = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The supplier. + */ + public com.google.cloud.apihub.v1.DependencyEntityReference getSupplier() { + if (supplierBuilder_ == null) { + return supplier_ == null + ? com.google.cloud.apihub.v1.DependencyEntityReference.getDefaultInstance() + : supplier_; + } else { + return supplierBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Immutable. The entity acting as the supplier in the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference supplier = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSupplier(com.google.cloud.apihub.v1.DependencyEntityReference value) { + if (supplierBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + supplier_ = value; + } else { + supplierBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The entity acting as the supplier in the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference supplier = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSupplier( + com.google.cloud.apihub.v1.DependencyEntityReference.Builder builderForValue) { + if (supplierBuilder_ == null) { + supplier_ = builderForValue.build(); + } else { + supplierBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The entity acting as the supplier in the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference supplier = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSupplier(com.google.cloud.apihub.v1.DependencyEntityReference value) { + if (supplierBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && supplier_ != null + && supplier_ + != com.google.cloud.apihub.v1.DependencyEntityReference.getDefaultInstance()) { + getSupplierBuilder().mergeFrom(value); + } else { + supplier_ = value; + } + } else { + supplierBuilder_.mergeFrom(value); + } + if (supplier_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. Immutable. The entity acting as the supplier in the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference supplier = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSupplier() { + bitField0_ = (bitField0_ & ~0x00000004); + supplier_ = null; + if (supplierBuilder_ != null) { + supplierBuilder_.dispose(); + supplierBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The entity acting as the supplier in the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference supplier = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.DependencyEntityReference.Builder getSupplierBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getSupplierFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Immutable. The entity acting as the supplier in the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference supplier = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.DependencyEntityReferenceOrBuilder getSupplierOrBuilder() { + if (supplierBuilder_ != null) { + return supplierBuilder_.getMessageOrBuilder(); + } else { + return supplier_ == null + ? com.google.cloud.apihub.v1.DependencyEntityReference.getDefaultInstance() + : supplier_; + } + } + /** + * + * + *
+     * Required. Immutable. The entity acting as the supplier in the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference supplier = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.DependencyEntityReference, + com.google.cloud.apihub.v1.DependencyEntityReference.Builder, + com.google.cloud.apihub.v1.DependencyEntityReferenceOrBuilder> + getSupplierFieldBuilder() { + if (supplierBuilder_ == null) { + supplierBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.DependencyEntityReference, + com.google.cloud.apihub.v1.DependencyEntityReference.Builder, + com.google.cloud.apihub.v1.DependencyEntityReferenceOrBuilder>( + getSupplier(), getParentForChildren(), isClean()); + supplier_ = null; + } + return supplierBuilder_; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. State of the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.Dependency.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. State of the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.Dependency.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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.Dependency.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Dependency.State getState() { + com.google.cloud.apihub.v1.Dependency.State result = + com.google.cloud.apihub.v1.Dependency.State.forNumber(state_); + return result == null ? com.google.cloud.apihub.v1.Dependency.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. State of the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.Dependency.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.apihub.v1.Dependency.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.Dependency.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000008); + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Optional. Human readable description corresponding of the dependency.
+     * 
+ * + * 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. Human readable description corresponding of the dependency.
+     * 
+ * + * 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. Human readable description corresponding of the dependency.
+     * 
+ * + * 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; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Human readable description corresponding of the dependency.
+     * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Human readable description corresponding of the dependency.
+     * 
+ * + * 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; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private int discoveryMode_ = 0; + /** + * + * + *
+     * Output only. Discovery mode of the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.Dependency.DiscoveryMode discovery_mode = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for discoveryMode. + */ + @java.lang.Override + public int getDiscoveryModeValue() { + return discoveryMode_; + } + /** + * + * + *
+     * Output only. Discovery mode of the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.Dependency.DiscoveryMode discovery_mode = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for discoveryMode to set. + * @return This builder for chaining. + */ + public Builder setDiscoveryModeValue(int value) { + discoveryMode_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Discovery mode of the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.Dependency.DiscoveryMode discovery_mode = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The discoveryMode. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Dependency.DiscoveryMode getDiscoveryMode() { + com.google.cloud.apihub.v1.Dependency.DiscoveryMode result = + com.google.cloud.apihub.v1.Dependency.DiscoveryMode.forNumber(discoveryMode_); + return result == null + ? com.google.cloud.apihub.v1.Dependency.DiscoveryMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. Discovery mode of the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.Dependency.DiscoveryMode discovery_mode = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The discoveryMode to set. + * @return This builder for chaining. + */ + public Builder setDiscoveryMode(com.google.cloud.apihub.v1.Dependency.DiscoveryMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + discoveryMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Discovery mode of the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.Dependency.DiscoveryMode discovery_mode = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearDiscoveryMode() { + bitField0_ = (bitField0_ & ~0x00000020); + discoveryMode_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.apihub.v1.DependencyErrorDetail errorDetail_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.DependencyErrorDetail, + com.google.cloud.apihub.v1.DependencyErrorDetail.Builder, + com.google.cloud.apihub.v1.DependencyErrorDetailOrBuilder> + errorDetailBuilder_; + /** + * + * + *
+     * Output only. Error details of a dependency if the system has detected it
+     * internally.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyErrorDetail error_detail = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the errorDetail field is set. + */ + public boolean hasErrorDetail() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * Output only. Error details of a dependency if the system has detected it
+     * internally.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyErrorDetail error_detail = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The errorDetail. + */ + public com.google.cloud.apihub.v1.DependencyErrorDetail getErrorDetail() { + if (errorDetailBuilder_ == null) { + return errorDetail_ == null + ? com.google.cloud.apihub.v1.DependencyErrorDetail.getDefaultInstance() + : errorDetail_; + } else { + return errorDetailBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Error details of a dependency if the system has detected it
+     * internally.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyErrorDetail error_detail = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setErrorDetail(com.google.cloud.apihub.v1.DependencyErrorDetail value) { + if (errorDetailBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + errorDetail_ = value; + } else { + errorDetailBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Error details of a dependency if the system has detected it
+     * internally.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyErrorDetail error_detail = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setErrorDetail( + com.google.cloud.apihub.v1.DependencyErrorDetail.Builder builderForValue) { + if (errorDetailBuilder_ == null) { + errorDetail_ = builderForValue.build(); + } else { + errorDetailBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Error details of a dependency if the system has detected it
+     * internally.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyErrorDetail error_detail = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeErrorDetail(com.google.cloud.apihub.v1.DependencyErrorDetail value) { + if (errorDetailBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && errorDetail_ != null + && errorDetail_ + != com.google.cloud.apihub.v1.DependencyErrorDetail.getDefaultInstance()) { + getErrorDetailBuilder().mergeFrom(value); + } else { + errorDetail_ = value; + } + } else { + errorDetailBuilder_.mergeFrom(value); + } + if (errorDetail_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Error details of a dependency if the system has detected it
+     * internally.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyErrorDetail error_detail = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearErrorDetail() { + bitField0_ = (bitField0_ & ~0x00000040); + errorDetail_ = null; + if (errorDetailBuilder_ != null) { + errorDetailBuilder_.dispose(); + errorDetailBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Error details of a dependency if the system has detected it
+     * internally.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyErrorDetail error_detail = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.apihub.v1.DependencyErrorDetail.Builder getErrorDetailBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getErrorDetailFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Error details of a dependency if the system has detected it
+     * internally.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyErrorDetail error_detail = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.apihub.v1.DependencyErrorDetailOrBuilder getErrorDetailOrBuilder() { + if (errorDetailBuilder_ != null) { + return errorDetailBuilder_.getMessageOrBuilder(); + } else { + return errorDetail_ == null + ? com.google.cloud.apihub.v1.DependencyErrorDetail.getDefaultInstance() + : errorDetail_; + } + } + /** + * + * + *
+     * Output only. Error details of a dependency if the system has detected it
+     * internally.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyErrorDetail error_detail = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.DependencyErrorDetail, + com.google.cloud.apihub.v1.DependencyErrorDetail.Builder, + com.google.cloud.apihub.v1.DependencyErrorDetailOrBuilder> + getErrorDetailFieldBuilder() { + if (errorDetailBuilder_ == null) { + errorDetailBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.DependencyErrorDetail, + com.google.cloud.apihub.v1.DependencyErrorDetail.Builder, + com.google.cloud.apihub.v1.DependencyErrorDetailOrBuilder>( + getErrorDetail(), getParentForChildren(), isClean()); + errorDetail_ = null; + } + return errorDetailBuilder_; + } + + 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. The time at which the dependency was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+     * Output only. The time at which the dependency was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.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. The time at which the dependency was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the dependency was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the dependency was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The time at which the dependency was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000080); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the dependency was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time at which the dependency was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.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. The time at which the dependency was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_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> + 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 time at which the dependency was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * + * + *
+     * Output only. The time at which the dependency was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.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 time at which the dependency was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the dependency was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the dependency was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The time at which the dependency was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000100); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the dependency was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time at which the dependency was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.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 time at which the dependency was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.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 static final class AttributesConverter + implements com.google.protobuf.MapFieldBuilder.Converter< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues> { + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues build( + com.google.cloud.apihub.v1.AttributeValuesOrBuilder val) { + if (val instanceof com.google.cloud.apihub.v1.AttributeValues) { + return (com.google.cloud.apihub.v1.AttributeValues) val; + } + return ((com.google.cloud.apihub.v1.AttributeValues.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.apihub.v1.AttributeValues> + defaultEntry() { + return AttributesDefaultEntryHolder.defaultEntry; + } + }; + + private static final AttributesConverter attributesConverter = new AttributesConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder> + attributes_; + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder> + internalGetAttributes() { + if (attributes_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(attributesConverter); + } + return attributes_; + } + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder> + internalGetMutableAttributes() { + if (attributes_ == null) { + attributes_ = new com.google.protobuf.MapFieldBuilder<>(attributesConverter); + } + bitField0_ |= 0x00000200; + onChanged(); + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().ensureBuilderMap().size(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the
+     * dependency resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().ensureBuilderMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the
+     * dependency resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getImmutableMap(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the
+     * dependency resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.apihub.v1.AttributeValues getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableAttributes().ensureBuilderMap(); + return map.containsKey(key) ? attributesConverter.build(map.get(key)) : defaultValue; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the
+     * dependency resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getAttributesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableAttributes().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return attributesConverter.build(map.get(key)); + } + + public Builder clearAttributes() { + bitField0_ = (bitField0_ & ~0x00000200); + internalGetMutableAttributes().clear(); + return this; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the
+     * dependency resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAttributes().ensureBuilderMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableAttributes() { + bitField0_ |= 0x00000200; + return internalGetMutableAttributes().ensureMessageMap(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the
+     * dependency resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAttributes( + java.lang.String key, com.google.cloud.apihub.v1.AttributeValues value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAttributes().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00000200; + return this; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the
+     * dependency resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllAttributes( + java.util.Map values) { + for (java.util.Map.Entry e : + values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableAttributes().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00000200; + return this; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the
+     * dependency resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.AttributeValues.Builder putAttributesBuilderIfAbsent( + java.lang.String key) { + java.util.Map + builderMap = internalGetMutableAttributes().ensureBuilderMap(); + com.google.cloud.apihub.v1.AttributeValuesOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = com.google.cloud.apihub.v1.AttributeValues.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.cloud.apihub.v1.AttributeValues) { + entry = ((com.google.cloud.apihub.v1.AttributeValues) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.cloud.apihub.v1.AttributeValues.Builder) entry; + } + + @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.apihub.v1.Dependency) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.Dependency) + private static final com.google.cloud.apihub.v1.Dependency DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.Dependency(); + } + + public static com.google.cloud.apihub.v1.Dependency getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Dependency parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.Dependency getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DependencyEntityReference.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DependencyEntityReference.java new file mode 100644 index 000000000000..d8e9d66b97b4 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DependencyEntityReference.java @@ -0,0 +1,1227 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * Reference to an entity participating in a dependency.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.DependencyEntityReference} + */ +public final class DependencyEntityReference extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.DependencyEntityReference) + DependencyEntityReferenceOrBuilder { + private static final long serialVersionUID = 0L; + // Use DependencyEntityReference.newBuilder() to construct. + private DependencyEntityReference(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DependencyEntityReference() { + displayName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DependencyEntityReference(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_DependencyEntityReference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_DependencyEntityReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.DependencyEntityReference.class, + com.google.cloud.apihub.v1.DependencyEntityReference.Builder.class); + } + + private int identifierCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object identifier_; + + public enum IdentifierCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + OPERATION_RESOURCE_NAME(2), + EXTERNAL_API_RESOURCE_NAME(3), + IDENTIFIER_NOT_SET(0); + private final int value; + + private IdentifierCase(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 IdentifierCase valueOf(int value) { + return forNumber(value); + } + + public static IdentifierCase forNumber(int value) { + switch (value) { + case 2: + return OPERATION_RESOURCE_NAME; + case 3: + return EXTERNAL_API_RESOURCE_NAME; + case 0: + return IDENTIFIER_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public IdentifierCase getIdentifierCase() { + return IdentifierCase.forNumber(identifierCase_); + } + + public static final int OPERATION_RESOURCE_NAME_FIELD_NUMBER = 2; + /** + * + * + *
+   * The resource name of an operation in the API Hub.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+   * 
+ * + * string operation_resource_name = 2; + * + * @return Whether the operationResourceName field is set. + */ + public boolean hasOperationResourceName() { + return identifierCase_ == 2; + } + /** + * + * + *
+   * The resource name of an operation in the API Hub.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+   * 
+ * + * string operation_resource_name = 2; + * + * @return The operationResourceName. + */ + public java.lang.String getOperationResourceName() { + java.lang.Object ref = ""; + if (identifierCase_ == 2) { + ref = identifier_; + } + 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 (identifierCase_ == 2) { + identifier_ = s; + } + return s; + } + } + /** + * + * + *
+   * The resource name of an operation in the API Hub.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+   * 
+ * + * string operation_resource_name = 2; + * + * @return The bytes for operationResourceName. + */ + public com.google.protobuf.ByteString getOperationResourceNameBytes() { + java.lang.Object ref = ""; + if (identifierCase_ == 2) { + ref = identifier_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (identifierCase_ == 2) { + identifier_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXTERNAL_API_RESOURCE_NAME_FIELD_NUMBER = 3; + /** + * + * + *
+   * The resource name of an external API in the API Hub.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/externalApis/{external_api}`
+   * 
+ * + * string external_api_resource_name = 3; + * + * @return Whether the externalApiResourceName field is set. + */ + public boolean hasExternalApiResourceName() { + return identifierCase_ == 3; + } + /** + * + * + *
+   * The resource name of an external API in the API Hub.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/externalApis/{external_api}`
+   * 
+ * + * string external_api_resource_name = 3; + * + * @return The externalApiResourceName. + */ + public java.lang.String getExternalApiResourceName() { + java.lang.Object ref = ""; + if (identifierCase_ == 3) { + ref = identifier_; + } + 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 (identifierCase_ == 3) { + identifier_ = s; + } + return s; + } + } + /** + * + * + *
+   * The resource name of an external API in the API Hub.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/externalApis/{external_api}`
+   * 
+ * + * string external_api_resource_name = 3; + * + * @return The bytes for externalApiResourceName. + */ + public com.google.protobuf.ByteString getExternalApiResourceNameBytes() { + java.lang.Object ref = ""; + if (identifierCase_ == 3) { + ref = identifier_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (identifierCase_ == 3) { + identifier_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * Output only. Display name of the entity.
+   * 
+ * + * string display_name = 1 [(.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. Display name of the entity.
+   * 
+ * + * string display_name = 1 [(.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; + } + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, displayName_); + } + if (identifierCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, identifier_); + } + if (identifierCase_ == 3) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, identifier_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, displayName_); + } + if (identifierCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, identifier_); + } + if (identifierCase_ == 3) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, identifier_); + } + size += getUnknownFields().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.apihub.v1.DependencyEntityReference)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.DependencyEntityReference other = + (com.google.cloud.apihub.v1.DependencyEntityReference) obj; + + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getIdentifierCase().equals(other.getIdentifierCase())) return false; + switch (identifierCase_) { + case 2: + if (!getOperationResourceName().equals(other.getOperationResourceName())) return false; + break; + case 3: + if (!getExternalApiResourceName().equals(other.getExternalApiResourceName())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + switch (identifierCase_) { + case 2: + hash = (37 * hash) + OPERATION_RESOURCE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getOperationResourceName().hashCode(); + break; + case 3: + hash = (37 * hash) + EXTERNAL_API_RESOURCE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getExternalApiResourceName().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.DependencyEntityReference parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DependencyEntityReference 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.apihub.v1.DependencyEntityReference parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DependencyEntityReference 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.apihub.v1.DependencyEntityReference parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DependencyEntityReference parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.DependencyEntityReference parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DependencyEntityReference 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.apihub.v1.DependencyEntityReference parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DependencyEntityReference 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.apihub.v1.DependencyEntityReference parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DependencyEntityReference 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.apihub.v1.DependencyEntityReference 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; + } + /** + * + * + *
+   * Reference to an entity participating in a dependency.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.DependencyEntityReference} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.DependencyEntityReference) + com.google.cloud.apihub.v1.DependencyEntityReferenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_DependencyEntityReference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_DependencyEntityReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.DependencyEntityReference.class, + com.google.cloud.apihub.v1.DependencyEntityReference.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.DependencyEntityReference.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + displayName_ = ""; + identifierCase_ = 0; + identifier_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_DependencyEntityReference_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DependencyEntityReference getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.DependencyEntityReference.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DependencyEntityReference build() { + com.google.cloud.apihub.v1.DependencyEntityReference result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DependencyEntityReference buildPartial() { + com.google.cloud.apihub.v1.DependencyEntityReference result = + new com.google.cloud.apihub.v1.DependencyEntityReference(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.DependencyEntityReference result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.displayName_ = displayName_; + } + } + + private void buildPartialOneofs(com.google.cloud.apihub.v1.DependencyEntityReference result) { + result.identifierCase_ = identifierCase_; + result.identifier_ = this.identifier_; + } + + @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.apihub.v1.DependencyEntityReference) { + return mergeFrom((com.google.cloud.apihub.v1.DependencyEntityReference) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.DependencyEntityReference other) { + if (other == com.google.cloud.apihub.v1.DependencyEntityReference.getDefaultInstance()) + return this; + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000004; + onChanged(); + } + switch (other.getIdentifierCase()) { + case OPERATION_RESOURCE_NAME: + { + identifierCase_ = 2; + identifier_ = other.identifier_; + onChanged(); + break; + } + case EXTERNAL_API_RESOURCE_NAME: + { + identifierCase_ = 3; + identifier_ = other.identifier_; + onChanged(); + break; + } + case IDENTIFIER_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + identifierCase_ = 2; + identifier_ = s; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + identifierCase_ = 3; + identifier_ = s; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int identifierCase_ = 0; + private java.lang.Object identifier_; + + public IdentifierCase getIdentifierCase() { + return IdentifierCase.forNumber(identifierCase_); + } + + public Builder clearIdentifier() { + identifierCase_ = 0; + identifier_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
+     * The resource name of an operation in the API Hub.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+     * 
+ * + * string operation_resource_name = 2; + * + * @return Whether the operationResourceName field is set. + */ + @java.lang.Override + public boolean hasOperationResourceName() { + return identifierCase_ == 2; + } + /** + * + * + *
+     * The resource name of an operation in the API Hub.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+     * 
+ * + * string operation_resource_name = 2; + * + * @return The operationResourceName. + */ + @java.lang.Override + public java.lang.String getOperationResourceName() { + java.lang.Object ref = ""; + if (identifierCase_ == 2) { + ref = identifier_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (identifierCase_ == 2) { + identifier_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of an operation in the API Hub.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+     * 
+ * + * string operation_resource_name = 2; + * + * @return The bytes for operationResourceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOperationResourceNameBytes() { + java.lang.Object ref = ""; + if (identifierCase_ == 2) { + ref = identifier_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (identifierCase_ == 2) { + identifier_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of an operation in the API Hub.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+     * 
+ * + * string operation_resource_name = 2; + * + * @param value The operationResourceName to set. + * @return This builder for chaining. + */ + public Builder setOperationResourceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + identifierCase_ = 2; + identifier_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of an operation in the API Hub.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+     * 
+ * + * string operation_resource_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearOperationResourceName() { + if (identifierCase_ == 2) { + identifierCase_ = 0; + identifier_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The resource name of an operation in the API Hub.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+     * 
+ * + * string operation_resource_name = 2; + * + * @param value The bytes for operationResourceName to set. + * @return This builder for chaining. + */ + public Builder setOperationResourceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + identifierCase_ = 2; + identifier_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * The resource name of an external API in the API Hub.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/externalApis/{external_api}`
+     * 
+ * + * string external_api_resource_name = 3; + * + * @return Whether the externalApiResourceName field is set. + */ + @java.lang.Override + public boolean hasExternalApiResourceName() { + return identifierCase_ == 3; + } + /** + * + * + *
+     * The resource name of an external API in the API Hub.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/externalApis/{external_api}`
+     * 
+ * + * string external_api_resource_name = 3; + * + * @return The externalApiResourceName. + */ + @java.lang.Override + public java.lang.String getExternalApiResourceName() { + java.lang.Object ref = ""; + if (identifierCase_ == 3) { + ref = identifier_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (identifierCase_ == 3) { + identifier_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of an external API in the API Hub.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/externalApis/{external_api}`
+     * 
+ * + * string external_api_resource_name = 3; + * + * @return The bytes for externalApiResourceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getExternalApiResourceNameBytes() { + java.lang.Object ref = ""; + if (identifierCase_ == 3) { + ref = identifier_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (identifierCase_ == 3) { + identifier_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of an external API in the API Hub.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/externalApis/{external_api}`
+     * 
+ * + * string external_api_resource_name = 3; + * + * @param value The externalApiResourceName to set. + * @return This builder for chaining. + */ + public Builder setExternalApiResourceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + identifierCase_ = 3; + identifier_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of an external API in the API Hub.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/externalApis/{external_api}`
+     * 
+ * + * string external_api_resource_name = 3; + * + * @return This builder for chaining. + */ + public Builder clearExternalApiResourceName() { + if (identifierCase_ == 3) { + identifierCase_ = 0; + identifier_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The resource name of an external API in the API Hub.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/externalApis/{external_api}`
+     * 
+ * + * string external_api_resource_name = 3; + * + * @param value The bytes for externalApiResourceName to set. + * @return This builder for chaining. + */ + public Builder setExternalApiResourceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + identifierCase_ = 3; + identifier_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Output only. Display name of the entity.
+     * 
+ * + * string display_name = 1 [(.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. Display name of the entity.
+     * 
+ * + * string display_name = 1 [(.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. Display name of the entity.
+     * 
+ * + * string display_name = 1 [(.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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Display name of the entity.
+     * 
+ * + * string display_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Display name of the entity.
+     * 
+ * + * string display_name = 1 [(.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; + bitField0_ |= 0x00000004; + 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.apihub.v1.DependencyEntityReference) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.DependencyEntityReference) + private static final com.google.cloud.apihub.v1.DependencyEntityReference DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.DependencyEntityReference(); + } + + public static com.google.cloud.apihub.v1.DependencyEntityReference getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DependencyEntityReference parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.DependencyEntityReference getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DependencyEntityReferenceOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DependencyEntityReferenceOrBuilder.java new file mode 100644 index 000000000000..b067fd4a19d8 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DependencyEntityReferenceOrBuilder.java @@ -0,0 +1,145 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface DependencyEntityReferenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.DependencyEntityReference) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of an operation in the API Hub.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+   * 
+ * + * string operation_resource_name = 2; + * + * @return Whether the operationResourceName field is set. + */ + boolean hasOperationResourceName(); + /** + * + * + *
+   * The resource name of an operation in the API Hub.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+   * 
+ * + * string operation_resource_name = 2; + * + * @return The operationResourceName. + */ + java.lang.String getOperationResourceName(); + /** + * + * + *
+   * The resource name of an operation in the API Hub.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+   * 
+ * + * string operation_resource_name = 2; + * + * @return The bytes for operationResourceName. + */ + com.google.protobuf.ByteString getOperationResourceNameBytes(); + + /** + * + * + *
+   * The resource name of an external API in the API Hub.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/externalApis/{external_api}`
+   * 
+ * + * string external_api_resource_name = 3; + * + * @return Whether the externalApiResourceName field is set. + */ + boolean hasExternalApiResourceName(); + /** + * + * + *
+   * The resource name of an external API in the API Hub.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/externalApis/{external_api}`
+   * 
+ * + * string external_api_resource_name = 3; + * + * @return The externalApiResourceName. + */ + java.lang.String getExternalApiResourceName(); + /** + * + * + *
+   * The resource name of an external API in the API Hub.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/externalApis/{external_api}`
+   * 
+ * + * string external_api_resource_name = 3; + * + * @return The bytes for externalApiResourceName. + */ + com.google.protobuf.ByteString getExternalApiResourceNameBytes(); + + /** + * + * + *
+   * Output only. Display name of the entity.
+   * 
+ * + * string display_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Output only. Display name of the entity.
+   * 
+ * + * string display_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + com.google.cloud.apihub.v1.DependencyEntityReference.IdentifierCase getIdentifierCase(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DependencyErrorDetail.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DependencyErrorDetail.java new file mode 100644 index 000000000000..ad016f274e43 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DependencyErrorDetail.java @@ -0,0 +1,1051 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * Details describing error condition of a dependency.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.DependencyErrorDetail} + */ +public final class DependencyErrorDetail extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.DependencyErrorDetail) + DependencyErrorDetailOrBuilder { + private static final long serialVersionUID = 0L; + // Use DependencyErrorDetail.newBuilder() to construct. + private DependencyErrorDetail(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DependencyErrorDetail() { + error_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DependencyErrorDetail(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_DependencyErrorDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_DependencyErrorDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.DependencyErrorDetail.class, + com.google.cloud.apihub.v1.DependencyErrorDetail.Builder.class); + } + + /** + * + * + *
+   * Possible values representing an error in the dependency.
+   * 
+ * + * Protobuf enum {@code google.cloud.apihub.v1.DependencyErrorDetail.Error} + */ + public enum Error implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value used for no error in the dependency.
+     * 
+ * + * ERROR_UNSPECIFIED = 0; + */ + ERROR_UNSPECIFIED(0), + /** + * + * + *
+     * Supplier entity has been deleted.
+     * 
+ * + * SUPPLIER_NOT_FOUND = 1; + */ + SUPPLIER_NOT_FOUND(1), + /** + * + * + *
+     * Supplier entity has been recreated.
+     * 
+ * + * SUPPLIER_RECREATED = 2; + */ + SUPPLIER_RECREATED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value used for no error in the dependency.
+     * 
+ * + * ERROR_UNSPECIFIED = 0; + */ + public static final int ERROR_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Supplier entity has been deleted.
+     * 
+ * + * SUPPLIER_NOT_FOUND = 1; + */ + public static final int SUPPLIER_NOT_FOUND_VALUE = 1; + /** + * + * + *
+     * Supplier entity has been recreated.
+     * 
+ * + * SUPPLIER_RECREATED = 2; + */ + public static final int SUPPLIER_RECREATED_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 Error 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 Error forNumber(int value) { + switch (value) { + case 0: + return ERROR_UNSPECIFIED; + case 1: + return SUPPLIER_NOT_FOUND; + case 2: + return SUPPLIER_RECREATED; + 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 Error findValueByNumber(int number) { + return Error.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.apihub.v1.DependencyErrorDetail.getDescriptor().getEnumTypes().get(0); + } + + private static final Error[] VALUES = values(); + + public static Error 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 Error(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.apihub.v1.DependencyErrorDetail.Error) + } + + private int bitField0_; + public static final int ERROR_FIELD_NUMBER = 1; + private int error_ = 0; + /** + * + * + *
+   * Optional. Error in the dependency.
+   * 
+ * + * + * .google.cloud.apihub.v1.DependencyErrorDetail.Error error = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for error. + */ + @java.lang.Override + public int getErrorValue() { + return error_; + } + /** + * + * + *
+   * Optional. Error in the dependency.
+   * 
+ * + * + * .google.cloud.apihub.v1.DependencyErrorDetail.Error error = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The error. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.DependencyErrorDetail.Error getError() { + com.google.cloud.apihub.v1.DependencyErrorDetail.Error result = + com.google.cloud.apihub.v1.DependencyErrorDetail.Error.forNumber(error_); + return result == null + ? com.google.cloud.apihub.v1.DependencyErrorDetail.Error.UNRECOGNIZED + : result; + } + + public static final int ERROR_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp errorTime_; + /** + * + * + *
+   * Optional. Timestamp at which the error was found.
+   * 
+ * + * .google.protobuf.Timestamp error_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the errorTime field is set. + */ + @java.lang.Override + public boolean hasErrorTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Optional. Timestamp at which the error was found.
+   * 
+ * + * .google.protobuf.Timestamp error_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The errorTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getErrorTime() { + return errorTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : errorTime_; + } + /** + * + * + *
+   * Optional. Timestamp at which the error was found.
+   * 
+ * + * .google.protobuf.Timestamp error_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getErrorTimeOrBuilder() { + return errorTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : errorTime_; + } + + 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 (error_ + != com.google.cloud.apihub.v1.DependencyErrorDetail.Error.ERROR_UNSPECIFIED.getNumber()) { + output.writeEnum(1, error_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getErrorTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (error_ + != com.google.cloud.apihub.v1.DependencyErrorDetail.Error.ERROR_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, error_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getErrorTime()); + } + size += getUnknownFields().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.apihub.v1.DependencyErrorDetail)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.DependencyErrorDetail other = + (com.google.cloud.apihub.v1.DependencyErrorDetail) obj; + + if (error_ != other.error_) return false; + if (hasErrorTime() != other.hasErrorTime()) return false; + if (hasErrorTime()) { + if (!getErrorTime().equals(other.getErrorTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + error_; + if (hasErrorTime()) { + hash = (37 * hash) + ERROR_TIME_FIELD_NUMBER; + hash = (53 * hash) + getErrorTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.DependencyErrorDetail parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DependencyErrorDetail 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.apihub.v1.DependencyErrorDetail parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DependencyErrorDetail 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.apihub.v1.DependencyErrorDetail parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DependencyErrorDetail parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.DependencyErrorDetail parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DependencyErrorDetail 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.apihub.v1.DependencyErrorDetail parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DependencyErrorDetail 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.apihub.v1.DependencyErrorDetail parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DependencyErrorDetail 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.apihub.v1.DependencyErrorDetail 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; + } + /** + * + * + *
+   * Details describing error condition of a dependency.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.DependencyErrorDetail} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.DependencyErrorDetail) + com.google.cloud.apihub.v1.DependencyErrorDetailOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_DependencyErrorDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_DependencyErrorDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.DependencyErrorDetail.class, + com.google.cloud.apihub.v1.DependencyErrorDetail.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.DependencyErrorDetail.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getErrorTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + error_ = 0; + errorTime_ = null; + if (errorTimeBuilder_ != null) { + errorTimeBuilder_.dispose(); + errorTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_DependencyErrorDetail_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DependencyErrorDetail getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.DependencyErrorDetail.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DependencyErrorDetail build() { + com.google.cloud.apihub.v1.DependencyErrorDetail result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DependencyErrorDetail buildPartial() { + com.google.cloud.apihub.v1.DependencyErrorDetail result = + new com.google.cloud.apihub.v1.DependencyErrorDetail(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.DependencyErrorDetail result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.error_ = error_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.errorTime_ = errorTimeBuilder_ == null ? errorTime_ : errorTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.DependencyErrorDetail) { + return mergeFrom((com.google.cloud.apihub.v1.DependencyErrorDetail) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.DependencyErrorDetail other) { + if (other == com.google.cloud.apihub.v1.DependencyErrorDetail.getDefaultInstance()) + return this; + if (other.error_ != 0) { + setErrorValue(other.getErrorValue()); + } + if (other.hasErrorTime()) { + mergeErrorTime(other.getErrorTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + error_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage(getErrorTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int error_ = 0; + /** + * + * + *
+     * Optional. Error in the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyErrorDetail.Error error = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for error. + */ + @java.lang.Override + public int getErrorValue() { + return error_; + } + /** + * + * + *
+     * Optional. Error in the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyErrorDetail.Error error = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for error to set. + * @return This builder for chaining. + */ + public Builder setErrorValue(int value) { + error_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Error in the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyErrorDetail.Error error = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The error. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.DependencyErrorDetail.Error getError() { + com.google.cloud.apihub.v1.DependencyErrorDetail.Error result = + com.google.cloud.apihub.v1.DependencyErrorDetail.Error.forNumber(error_); + return result == null + ? com.google.cloud.apihub.v1.DependencyErrorDetail.Error.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. Error in the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyErrorDetail.Error error = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The error to set. + * @return This builder for chaining. + */ + public Builder setError(com.google.cloud.apihub.v1.DependencyErrorDetail.Error value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + error_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Error in the dependency.
+     * 
+ * + * + * .google.cloud.apihub.v1.DependencyErrorDetail.Error error = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearError() { + bitField0_ = (bitField0_ & ~0x00000001); + error_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp errorTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + errorTimeBuilder_; + /** + * + * + *
+     * Optional. Timestamp at which the error was found.
+     * 
+ * + * .google.protobuf.Timestamp error_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the errorTime field is set. + */ + public boolean hasErrorTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Optional. Timestamp at which the error was found.
+     * 
+ * + * .google.protobuf.Timestamp error_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The errorTime. + */ + public com.google.protobuf.Timestamp getErrorTime() { + if (errorTimeBuilder_ == null) { + return errorTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : errorTime_; + } else { + return errorTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Timestamp at which the error was found.
+     * 
+ * + * .google.protobuf.Timestamp error_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setErrorTime(com.google.protobuf.Timestamp value) { + if (errorTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + errorTime_ = value; + } else { + errorTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Timestamp at which the error was found.
+     * 
+ * + * .google.protobuf.Timestamp error_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setErrorTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (errorTimeBuilder_ == null) { + errorTime_ = builderForValue.build(); + } else { + errorTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Timestamp at which the error was found.
+     * 
+ * + * .google.protobuf.Timestamp error_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeErrorTime(com.google.protobuf.Timestamp value) { + if (errorTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && errorTime_ != null + && errorTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getErrorTimeBuilder().mergeFrom(value); + } else { + errorTime_ = value; + } + } else { + errorTimeBuilder_.mergeFrom(value); + } + if (errorTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. Timestamp at which the error was found.
+     * 
+ * + * .google.protobuf.Timestamp error_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearErrorTime() { + bitField0_ = (bitField0_ & ~0x00000002); + errorTime_ = null; + if (errorTimeBuilder_ != null) { + errorTimeBuilder_.dispose(); + errorTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Timestamp at which the error was found.
+     * 
+ * + * .google.protobuf.Timestamp error_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Timestamp.Builder getErrorTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getErrorTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Timestamp at which the error was found.
+     * 
+ * + * .google.protobuf.Timestamp error_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.TimestampOrBuilder getErrorTimeOrBuilder() { + if (errorTimeBuilder_ != null) { + return errorTimeBuilder_.getMessageOrBuilder(); + } else { + return errorTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : errorTime_; + } + } + /** + * + * + *
+     * Optional. Timestamp at which the error was found.
+     * 
+ * + * .google.protobuf.Timestamp error_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getErrorTimeFieldBuilder() { + if (errorTimeBuilder_ == null) { + errorTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getErrorTime(), getParentForChildren(), isClean()); + errorTime_ = null; + } + return errorTimeBuilder_; + } + + @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.apihub.v1.DependencyErrorDetail) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.DependencyErrorDetail) + private static final com.google.cloud.apihub.v1.DependencyErrorDetail DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.DependencyErrorDetail(); + } + + public static com.google.cloud.apihub.v1.DependencyErrorDetail getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DependencyErrorDetail parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.DependencyErrorDetail getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DependencyErrorDetailOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DependencyErrorDetailOrBuilder.java new file mode 100644 index 000000000000..f9772aef5e69 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DependencyErrorDetailOrBuilder.java @@ -0,0 +1,93 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface DependencyErrorDetailOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.DependencyErrorDetail) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Error in the dependency.
+   * 
+ * + * + * .google.cloud.apihub.v1.DependencyErrorDetail.Error error = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for error. + */ + int getErrorValue(); + /** + * + * + *
+   * Optional. Error in the dependency.
+   * 
+ * + * + * .google.cloud.apihub.v1.DependencyErrorDetail.Error error = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The error. + */ + com.google.cloud.apihub.v1.DependencyErrorDetail.Error getError(); + + /** + * + * + *
+   * Optional. Timestamp at which the error was found.
+   * 
+ * + * .google.protobuf.Timestamp error_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the errorTime field is set. + */ + boolean hasErrorTime(); + /** + * + * + *
+   * Optional. Timestamp at which the error was found.
+   * 
+ * + * .google.protobuf.Timestamp error_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The errorTime. + */ + com.google.protobuf.Timestamp getErrorTime(); + /** + * + * + *
+   * Optional. Timestamp at which the error was found.
+   * 
+ * + * .google.protobuf.Timestamp error_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.TimestampOrBuilder getErrorTimeOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DependencyName.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DependencyName.java new file mode 100644 index 000000000000..33c0e6f8c710 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DependencyName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +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 DependencyName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_DEPENDENCY = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/dependencies/{dependency}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String dependency; + + @Deprecated + protected DependencyName() { + project = null; + location = null; + dependency = null; + } + + private DependencyName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + dependency = Preconditions.checkNotNull(builder.getDependency()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDependency() { + return dependency; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static DependencyName of(String project, String location, String dependency) { + return newBuilder().setProject(project).setLocation(location).setDependency(dependency).build(); + } + + public static String format(String project, String location, String dependency) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDependency(dependency) + .build() + .toString(); + } + + public static DependencyName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_DEPENDENCY.validatedMatch( + formattedString, "DependencyName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("dependency")); + } + + 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 (DependencyName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_DEPENDENCY.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); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (dependency != null) { + fieldMapBuilder.put("dependency", dependency); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_DEPENDENCY.instantiate( + "project", project, "location", location, "dependency", dependency); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + DependencyName that = ((DependencyName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.dependency, that.dependency); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(dependency); + return h; + } + + /** Builder for projects/{project}/locations/{location}/dependencies/{dependency}. */ + public static class Builder { + private String project; + private String location; + private String dependency; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDependency() { + return dependency; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setDependency(String dependency) { + this.dependency = dependency; + return this; + } + + private Builder(DependencyName dependencyName) { + this.project = dependencyName.project; + this.location = dependencyName.location; + this.dependency = dependencyName.dependency; + } + + public DependencyName build() { + return new DependencyName(this); + } + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DependencyOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DependencyOrBuilder.java new file mode 100644 index 000000000000..fec23237be17 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DependencyOrBuilder.java @@ -0,0 +1,423 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface DependencyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.Dependency) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. The name of the dependency in the API Hub.
+   *
+   * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. The name of the dependency in the API Hub.
+   *
+   * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. Immutable. The entity acting as the consumer in the dependency.
+   * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference consumer = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the consumer field is set. + */ + boolean hasConsumer(); + /** + * + * + *
+   * Required. Immutable. The entity acting as the consumer in the dependency.
+   * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference consumer = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The consumer. + */ + com.google.cloud.apihub.v1.DependencyEntityReference getConsumer(); + /** + * + * + *
+   * Required. Immutable. The entity acting as the consumer in the dependency.
+   * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference consumer = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.apihub.v1.DependencyEntityReferenceOrBuilder getConsumerOrBuilder(); + + /** + * + * + *
+   * Required. Immutable. The entity acting as the supplier in the dependency.
+   * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference supplier = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the supplier field is set. + */ + boolean hasSupplier(); + /** + * + * + *
+   * Required. Immutable. The entity acting as the supplier in the dependency.
+   * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference supplier = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The supplier. + */ + com.google.cloud.apihub.v1.DependencyEntityReference getSupplier(); + /** + * + * + *
+   * Required. Immutable. The entity acting as the supplier in the dependency.
+   * 
+ * + * + * .google.cloud.apihub.v1.DependencyEntityReference supplier = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.apihub.v1.DependencyEntityReferenceOrBuilder getSupplierOrBuilder(); + + /** + * + * + *
+   * Output only. State of the dependency.
+   * 
+ * + * + * .google.cloud.apihub.v1.Dependency.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. State of the dependency.
+   * 
+ * + * + * .google.cloud.apihub.v1.Dependency.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.apihub.v1.Dependency.State getState(); + + /** + * + * + *
+   * Optional. Human readable description corresponding of the dependency.
+   * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Optional. Human readable description corresponding of the dependency.
+   * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. Discovery mode of the dependency.
+   * 
+ * + * + * .google.cloud.apihub.v1.Dependency.DiscoveryMode discovery_mode = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for discoveryMode. + */ + int getDiscoveryModeValue(); + /** + * + * + *
+   * Output only. Discovery mode of the dependency.
+   * 
+ * + * + * .google.cloud.apihub.v1.Dependency.DiscoveryMode discovery_mode = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The discoveryMode. + */ + com.google.cloud.apihub.v1.Dependency.DiscoveryMode getDiscoveryMode(); + + /** + * + * + *
+   * Output only. Error details of a dependency if the system has detected it
+   * internally.
+   * 
+ * + * + * .google.cloud.apihub.v1.DependencyErrorDetail error_detail = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the errorDetail field is set. + */ + boolean hasErrorDetail(); + /** + * + * + *
+   * Output only. Error details of a dependency if the system has detected it
+   * internally.
+   * 
+ * + * + * .google.cloud.apihub.v1.DependencyErrorDetail error_detail = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The errorDetail. + */ + com.google.cloud.apihub.v1.DependencyErrorDetail getErrorDetail(); + /** + * + * + *
+   * Output only. Error details of a dependency if the system has detected it
+   * internally.
+   * 
+ * + * + * .google.cloud.apihub.v1.DependencyErrorDetail error_detail = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.apihub.v1.DependencyErrorDetailOrBuilder getErrorDetailOrBuilder(); + + /** + * + * + *
+   * Output only. The time at which the dependency was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time at which the dependency was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time at which the dependency was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time at which the dependency was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The time at which the dependency was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The time at which the dependency was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the
+   * dependency resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getAttributesCount(); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the
+   * dependency resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsAttributes(java.lang.String key); + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAttributes(); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the
+   * dependency resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getAttributesMap(); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the
+   * dependency resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues defaultValue); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the
+   * dependency resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.AttributeValues getAttributesOrThrow(java.lang.String key); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Deployment.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Deployment.java new file mode 100644 index 000000000000..ff58ad5583e6 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Deployment.java @@ -0,0 +1,4297 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * Details of the deployment where APIs are hosted.
+ * A deployment could represent an Apigee proxy, API gateway, other Google Cloud
+ * services or non-Google Cloud services as well. A deployment entity is a root
+ * level entity in the API hub and exists independent of any API.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Deployment} + */ +public final class Deployment extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.Deployment) + DeploymentOrBuilder { + private static final long serialVersionUID = 0L; + // Use Deployment.newBuilder() to construct. + private Deployment(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Deployment() { + name_ = ""; + displayName_ = ""; + description_ = ""; + resourceUri_ = ""; + endpoints_ = com.google.protobuf.LazyStringArrayList.emptyList(); + apiVersions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Deployment(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Deployment_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 13: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Deployment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Deployment.class, + com.google.cloud.apihub.v1.Deployment.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. The name of the deployment.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+   * Identifier. The name of the deployment.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * Required. The display name of the deployment.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+   * Required. The display name of the deployment.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 DESCRIPTION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * Optional. The description of the deployment.
+   * 
+ * + * string description = 3 [(.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. The description of the deployment.
+   * 
+ * + * string description = 3 [(.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 DOCUMENTATION_FIELD_NUMBER = 4; + private com.google.cloud.apihub.v1.Documentation documentation_; + /** + * + * + *
+   * Optional. The documentation of the deployment.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the documentation field is set. + */ + @java.lang.Override + public boolean hasDocumentation() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Optional. The documentation of the deployment.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The documentation. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Documentation getDocumentation() { + return documentation_ == null + ? com.google.cloud.apihub.v1.Documentation.getDefaultInstance() + : documentation_; + } + /** + * + * + *
+   * Optional. The documentation of the deployment.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.DocumentationOrBuilder getDocumentationOrBuilder() { + return documentation_ == null + ? com.google.cloud.apihub.v1.Documentation.getDefaultInstance() + : documentation_; + } + + public static final int DEPLOYMENT_TYPE_FIELD_NUMBER = 5; + private com.google.cloud.apihub.v1.AttributeValues deploymentType_; + /** + * + * + *
+   * Required. The type of deployment.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-deployment-type`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues deployment_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the deploymentType field is set. + */ + @java.lang.Override + public boolean hasDeploymentType() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Required. The type of deployment.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-deployment-type`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues deployment_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The deploymentType. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getDeploymentType() { + return deploymentType_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : deploymentType_; + } + /** + * + * + *
+   * Required. The type of deployment.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-deployment-type`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues deployment_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValuesOrBuilder getDeploymentTypeOrBuilder() { + return deploymentType_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : deploymentType_; + } + + public static final int RESOURCE_URI_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object resourceUri_ = ""; + /** + * + * + *
+   * Required. A URI to the runtime resource. This URI can be used to manage the
+   * resource. For example, if the runtime resource is of type APIGEE_PROXY,
+   * then this field will contain the URI to the management UI of the proxy.
+   * 
+ * + * string resource_uri = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The resourceUri. + */ + @java.lang.Override + public java.lang.String getResourceUri() { + java.lang.Object ref = resourceUri_; + 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(); + resourceUri_ = s; + return s; + } + } + /** + * + * + *
+   * Required. A URI to the runtime resource. This URI can be used to manage the
+   * resource. For example, if the runtime resource is of type APIGEE_PROXY,
+   * then this field will contain the URI to the management UI of the proxy.
+   * 
+ * + * string resource_uri = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for resourceUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourceUriBytes() { + java.lang.Object ref = resourceUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENDPOINTS_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList endpoints_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Required. The endpoints at which this deployment resource is listening for
+   * API requests. This could be a list of complete URIs, hostnames or an IP
+   * addresses.
+   * 
+ * + * repeated string endpoints = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the endpoints. + */ + public com.google.protobuf.ProtocolStringList getEndpointsList() { + return endpoints_; + } + /** + * + * + *
+   * Required. The endpoints at which this deployment resource is listening for
+   * API requests. This could be a list of complete URIs, hostnames or an IP
+   * addresses.
+   * 
+ * + * repeated string endpoints = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of endpoints. + */ + public int getEndpointsCount() { + return endpoints_.size(); + } + /** + * + * + *
+   * Required. The endpoints at which this deployment resource is listening for
+   * API requests. This could be a list of complete URIs, hostnames or an IP
+   * addresses.
+   * 
+ * + * repeated string endpoints = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The endpoints at the given index. + */ + public java.lang.String getEndpoints(int index) { + return endpoints_.get(index); + } + /** + * + * + *
+   * Required. The endpoints at which this deployment resource is listening for
+   * API requests. This could be a list of complete URIs, hostnames or an IP
+   * addresses.
+   * 
+ * + * repeated string endpoints = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the endpoints at the given index. + */ + public com.google.protobuf.ByteString getEndpointsBytes(int index) { + return endpoints_.getByteString(index); + } + + public static final int API_VERSIONS_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList apiVersions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Output only. The API versions linked to this deployment.
+   * Note: A particular deployment could be linked to multiple different API
+   * versions (of same or different APIs).
+   * 
+ * + * repeated string api_versions = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return A list containing the apiVersions. + */ + public com.google.protobuf.ProtocolStringList getApiVersionsList() { + return apiVersions_; + } + /** + * + * + *
+   * Output only. The API versions linked to this deployment.
+   * Note: A particular deployment could be linked to multiple different API
+   * versions (of same or different APIs).
+   * 
+ * + * repeated string api_versions = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The count of apiVersions. + */ + public int getApiVersionsCount() { + return apiVersions_.size(); + } + /** + * + * + *
+   * Output only. The API versions linked to this deployment.
+   * Note: A particular deployment could be linked to multiple different API
+   * versions (of same or different APIs).
+   * 
+ * + * repeated string api_versions = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the element to return. + * @return The apiVersions at the given index. + */ + public java.lang.String getApiVersions(int index) { + return apiVersions_.get(index); + } + /** + * + * + *
+   * Output only. The API versions linked to this deployment.
+   * Note: A particular deployment could be linked to multiple different API
+   * versions (of same or different APIs).
+   * 
+ * + * repeated string api_versions = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the value to return. + * @return The bytes of the apiVersions at the given index. + */ + public com.google.protobuf.ByteString getApiVersionsBytes(int index) { + return apiVersions_.getByteString(index); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 9; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time at which the deployment was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Output only. The time at which the deployment was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.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. The time at which the deployment was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 10; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The time at which the deployment was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+   * Output only. The time at which the deployment was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.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 time at which the deployment was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int SLO_FIELD_NUMBER = 11; + private com.google.cloud.apihub.v1.AttributeValues slo_; + /** + * + * + *
+   * Optional. The SLO for this deployment.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-slo`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues slo = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the slo field is set. + */ + @java.lang.Override + public boolean hasSlo() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+   * Optional. The SLO for this deployment.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-slo`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues slo = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The slo. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getSlo() { + return slo_ == null ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() : slo_; + } + /** + * + * + *
+   * Optional. The SLO for this deployment.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-slo`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues slo = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValuesOrBuilder getSloOrBuilder() { + return slo_ == null ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() : slo_; + } + + public static final int ENVIRONMENT_FIELD_NUMBER = 12; + private com.google.cloud.apihub.v1.AttributeValues environment_; + /** + * + * + *
+   * Optional. The environment mapping to this deployment.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-environment`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues environment = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the environment field is set. + */ + @java.lang.Override + public boolean hasEnvironment() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+   * Optional. The environment mapping to this deployment.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-environment`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues environment = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The environment. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getEnvironment() { + return environment_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : environment_; + } + /** + * + * + *
+   * Optional. The environment mapping to this deployment.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-environment`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues environment = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValuesOrBuilder getEnvironmentOrBuilder() { + return environment_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : environment_; + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 13; + + private static final class AttributesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.apihub.v1.AttributeValues> + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Deployment_AttributesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField + attributes_; + + private com.google.protobuf.MapField + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField(AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the
+   * deployment resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().getMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the
+   * deployment resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the
+   * deployment resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.apihub.v1.AttributeValues getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the
+   * deployment resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getAttributesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getDocumentation()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getDeploymentType()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourceUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, resourceUri_); + } + for (int i = 0; i < endpoints_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, endpoints_.getRaw(i)); + } + for (int i = 0; i < apiVersions_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, apiVersions_.getRaw(i)); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(9, getCreateTime()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(10, getUpdateTime()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(11, getSlo()); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(12, getEnvironment()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAttributes(), AttributesDefaultEntryHolder.defaultEntry, 13); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getDocumentation()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getDeploymentType()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourceUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, resourceUri_); + } + { + int dataSize = 0; + for (int i = 0; i < endpoints_.size(); i++) { + dataSize += computeStringSizeNoTag(endpoints_.getRaw(i)); + } + size += dataSize; + size += 1 * getEndpointsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < apiVersions_.size(); i++) { + dataSize += computeStringSizeNoTag(apiVersions_.getRaw(i)); + } + size += dataSize; + size += 1 * getApiVersionsList().size(); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getCreateTime()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getUpdateTime()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getSlo()); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getEnvironment()); + } + for (java.util.Map.Entry entry : + internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry + attributes__ = + AttributesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, attributes__); + } + size += getUnknownFields().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.apihub.v1.Deployment)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.Deployment other = (com.google.cloud.apihub.v1.Deployment) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (hasDocumentation() != other.hasDocumentation()) return false; + if (hasDocumentation()) { + if (!getDocumentation().equals(other.getDocumentation())) return false; + } + if (hasDeploymentType() != other.hasDeploymentType()) return false; + if (hasDeploymentType()) { + if (!getDeploymentType().equals(other.getDeploymentType())) return false; + } + if (!getResourceUri().equals(other.getResourceUri())) return false; + if (!getEndpointsList().equals(other.getEndpointsList())) return false; + if (!getApiVersionsList().equals(other.getApiVersionsList())) 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 (hasSlo() != other.hasSlo()) return false; + if (hasSlo()) { + if (!getSlo().equals(other.getSlo())) return false; + } + if (hasEnvironment() != other.hasEnvironment()) return false; + if (hasEnvironment()) { + if (!getEnvironment().equals(other.getEnvironment())) return false; + } + if (!internalGetAttributes().equals(other.internalGetAttributes())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasDocumentation()) { + hash = (37 * hash) + DOCUMENTATION_FIELD_NUMBER; + hash = (53 * hash) + getDocumentation().hashCode(); + } + if (hasDeploymentType()) { + hash = (37 * hash) + DEPLOYMENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getDeploymentType().hashCode(); + } + hash = (37 * hash) + RESOURCE_URI_FIELD_NUMBER; + hash = (53 * hash) + getResourceUri().hashCode(); + if (getEndpointsCount() > 0) { + hash = (37 * hash) + ENDPOINTS_FIELD_NUMBER; + hash = (53 * hash) + getEndpointsList().hashCode(); + } + if (getApiVersionsCount() > 0) { + hash = (37 * hash) + API_VERSIONS_FIELD_NUMBER; + hash = (53 * hash) + getApiVersionsList().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 (hasSlo()) { + hash = (37 * hash) + SLO_FIELD_NUMBER; + hash = (53 * hash) + getSlo().hashCode(); + } + if (hasEnvironment()) { + hash = (37 * hash) + ENVIRONMENT_FIELD_NUMBER; + hash = (53 * hash) + getEnvironment().hashCode(); + } + if (!internalGetAttributes().getMap().isEmpty()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttributes().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.Deployment parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Deployment 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.apihub.v1.Deployment parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Deployment 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.apihub.v1.Deployment parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Deployment parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.Deployment parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Deployment 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.apihub.v1.Deployment parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Deployment 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.apihub.v1.Deployment parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Deployment 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.apihub.v1.Deployment 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; + } + /** + * + * + *
+   * Details of the deployment where APIs are hosted.
+   * A deployment could represent an Apigee proxy, API gateway, other Google Cloud
+   * services or non-Google Cloud services as well. A deployment entity is a root
+   * level entity in the API hub and exists independent of any API.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Deployment} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.Deployment) + com.google.cloud.apihub.v1.DeploymentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Deployment_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 13: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 13: + return internalGetMutableAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Deployment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Deployment.class, + com.google.cloud.apihub.v1.Deployment.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.Deployment.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getDocumentationFieldBuilder(); + getDeploymentTypeFieldBuilder(); + getCreateTimeFieldBuilder(); + getUpdateTimeFieldBuilder(); + getSloFieldBuilder(); + getEnvironmentFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + description_ = ""; + documentation_ = null; + if (documentationBuilder_ != null) { + documentationBuilder_.dispose(); + documentationBuilder_ = null; + } + deploymentType_ = null; + if (deploymentTypeBuilder_ != null) { + deploymentTypeBuilder_.dispose(); + deploymentTypeBuilder_ = null; + } + resourceUri_ = ""; + endpoints_ = com.google.protobuf.LazyStringArrayList.emptyList(); + apiVersions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + slo_ = null; + if (sloBuilder_ != null) { + sloBuilder_.dispose(); + sloBuilder_ = null; + } + environment_ = null; + if (environmentBuilder_ != null) { + environmentBuilder_.dispose(); + environmentBuilder_ = null; + } + internalGetMutableAttributes().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Deployment_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Deployment getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.Deployment.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Deployment build() { + com.google.cloud.apihub.v1.Deployment result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Deployment buildPartial() { + com.google.cloud.apihub.v1.Deployment result = + new com.google.cloud.apihub.v1.Deployment(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.Deployment result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.documentation_ = + documentationBuilder_ == null ? documentation_ : documentationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.deploymentType_ = + deploymentTypeBuilder_ == null ? deploymentType_ : deploymentTypeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.resourceUri_ = resourceUri_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + endpoints_.makeImmutable(); + result.endpoints_ = endpoints_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + apiVersions_.makeImmutable(); + result.apiVersions_ = apiVersions_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.slo_ = sloBuilder_ == null ? slo_ : sloBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.environment_ = + environmentBuilder_ == null ? environment_ : environmentBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.attributes_ = + internalGetAttributes().build(AttributesDefaultEntryHolder.defaultEntry); + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.Deployment) { + return mergeFrom((com.google.cloud.apihub.v1.Deployment) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.Deployment other) { + if (other == com.google.cloud.apihub.v1.Deployment.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasDocumentation()) { + mergeDocumentation(other.getDocumentation()); + } + if (other.hasDeploymentType()) { + mergeDeploymentType(other.getDeploymentType()); + } + if (!other.getResourceUri().isEmpty()) { + resourceUri_ = other.resourceUri_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.endpoints_.isEmpty()) { + if (endpoints_.isEmpty()) { + endpoints_ = other.endpoints_; + bitField0_ |= 0x00000040; + } else { + ensureEndpointsIsMutable(); + endpoints_.addAll(other.endpoints_); + } + onChanged(); + } + if (!other.apiVersions_.isEmpty()) { + if (apiVersions_.isEmpty()) { + apiVersions_ = other.apiVersions_; + bitField0_ |= 0x00000080; + } else { + ensureApiVersionsIsMutable(); + apiVersions_.addAll(other.apiVersions_); + } + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasSlo()) { + mergeSlo(other.getSlo()); + } + if (other.hasEnvironment()) { + mergeEnvironment(other.getEnvironment()); + } + internalGetMutableAttributes().mergeFrom(other.internalGetAttributes()); + bitField0_ |= 0x00001000; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getDocumentationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage(getDeploymentTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + resourceUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureEndpointsIsMutable(); + endpoints_.add(s); + break; + } // case 58 + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureApiVersionsIsMutable(); + apiVersions_.add(s); + break; + } // case 66 + case 74: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 82: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 90: + { + input.readMessage(getSloFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 90 + case 98: + { + input.readMessage(getEnvironmentFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 98 + case 106: + { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.apihub.v1.AttributeValues> + attributes__ = + input.readMessage( + AttributesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAttributes() + .ensureBuilderMap() + .put(attributes__.getKey(), attributes__.getValue()); + bitField0_ |= 0x00001000; + break; + } // case 106 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. The name of the deployment.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. The name of the deployment.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. The name of the deployment.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The name of the deployment.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The name of the deployment.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Required. The display name of the deployment.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. The display name of the deployment.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. The display name of the deployment.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The display name of the deployment.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The display name of the deployment.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Optional. The description of the deployment.
+     * 
+ * + * string description = 3 [(.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. The description of the deployment.
+     * 
+ * + * string description = 3 [(.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. The description of the deployment.
+     * 
+ * + * string description = 3 [(.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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The description of the deployment.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The description of the deployment.
+     * 
+ * + * string description = 3 [(.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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.cloud.apihub.v1.Documentation documentation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Documentation, + com.google.cloud.apihub.v1.Documentation.Builder, + com.google.cloud.apihub.v1.DocumentationOrBuilder> + documentationBuilder_; + /** + * + * + *
+     * Optional. The documentation of the deployment.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the documentation field is set. + */ + public boolean hasDocumentation() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Optional. The documentation of the deployment.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The documentation. + */ + public com.google.cloud.apihub.v1.Documentation getDocumentation() { + if (documentationBuilder_ == null) { + return documentation_ == null + ? com.google.cloud.apihub.v1.Documentation.getDefaultInstance() + : documentation_; + } else { + return documentationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The documentation of the deployment.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDocumentation(com.google.cloud.apihub.v1.Documentation value) { + if (documentationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + documentation_ = value; + } else { + documentationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The documentation of the deployment.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDocumentation( + com.google.cloud.apihub.v1.Documentation.Builder builderForValue) { + if (documentationBuilder_ == null) { + documentation_ = builderForValue.build(); + } else { + documentationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The documentation of the deployment.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeDocumentation(com.google.cloud.apihub.v1.Documentation value) { + if (documentationBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && documentation_ != null + && documentation_ != com.google.cloud.apihub.v1.Documentation.getDefaultInstance()) { + getDocumentationBuilder().mergeFrom(value); + } else { + documentation_ = value; + } + } else { + documentationBuilder_.mergeFrom(value); + } + if (documentation_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. The documentation of the deployment.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearDocumentation() { + bitField0_ = (bitField0_ & ~0x00000008); + documentation_ = null; + if (documentationBuilder_ != null) { + documentationBuilder_.dispose(); + documentationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The documentation of the deployment.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.Documentation.Builder getDocumentationBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getDocumentationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The documentation of the deployment.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.DocumentationOrBuilder getDocumentationOrBuilder() { + if (documentationBuilder_ != null) { + return documentationBuilder_.getMessageOrBuilder(); + } else { + return documentation_ == null + ? com.google.cloud.apihub.v1.Documentation.getDefaultInstance() + : documentation_; + } + } + /** + * + * + *
+     * Optional. The documentation of the deployment.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Documentation, + com.google.cloud.apihub.v1.Documentation.Builder, + com.google.cloud.apihub.v1.DocumentationOrBuilder> + getDocumentationFieldBuilder() { + if (documentationBuilder_ == null) { + documentationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Documentation, + com.google.cloud.apihub.v1.Documentation.Builder, + com.google.cloud.apihub.v1.DocumentationOrBuilder>( + getDocumentation(), getParentForChildren(), isClean()); + documentation_ = null; + } + return documentationBuilder_; + } + + private com.google.cloud.apihub.v1.AttributeValues deploymentType_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder> + deploymentTypeBuilder_; + /** + * + * + *
+     * Required. The type of deployment.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-deployment-type`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues deployment_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the deploymentType field is set. + */ + public boolean hasDeploymentType() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Required. The type of deployment.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-deployment-type`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues deployment_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The deploymentType. + */ + public com.google.cloud.apihub.v1.AttributeValues getDeploymentType() { + if (deploymentTypeBuilder_ == null) { + return deploymentType_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : deploymentType_; + } else { + return deploymentTypeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The type of deployment.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-deployment-type`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues deployment_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDeploymentType(com.google.cloud.apihub.v1.AttributeValues value) { + if (deploymentTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deploymentType_ = value; + } else { + deploymentTypeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of deployment.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-deployment-type`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues deployment_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDeploymentType( + com.google.cloud.apihub.v1.AttributeValues.Builder builderForValue) { + if (deploymentTypeBuilder_ == null) { + deploymentType_ = builderForValue.build(); + } else { + deploymentTypeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of deployment.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-deployment-type`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues deployment_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDeploymentType(com.google.cloud.apihub.v1.AttributeValues value) { + if (deploymentTypeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && deploymentType_ != null + && deploymentType_ != com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance()) { + getDeploymentTypeBuilder().mergeFrom(value); + } else { + deploymentType_ = value; + } + } else { + deploymentTypeBuilder_.mergeFrom(value); + } + if (deploymentType_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The type of deployment.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-deployment-type`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues deployment_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDeploymentType() { + bitField0_ = (bitField0_ & ~0x00000010); + deploymentType_ = null; + if (deploymentTypeBuilder_ != null) { + deploymentTypeBuilder_.dispose(); + deploymentTypeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of deployment.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-deployment-type`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues deployment_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.AttributeValues.Builder getDeploymentTypeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getDeploymentTypeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The type of deployment.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-deployment-type`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues deployment_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.AttributeValuesOrBuilder getDeploymentTypeOrBuilder() { + if (deploymentTypeBuilder_ != null) { + return deploymentTypeBuilder_.getMessageOrBuilder(); + } else { + return deploymentType_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : deploymentType_; + } + } + /** + * + * + *
+     * Required. The type of deployment.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-deployment-type`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues deployment_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder> + getDeploymentTypeFieldBuilder() { + if (deploymentTypeBuilder_ == null) { + deploymentTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder>( + getDeploymentType(), getParentForChildren(), isClean()); + deploymentType_ = null; + } + return deploymentTypeBuilder_; + } + + private java.lang.Object resourceUri_ = ""; + /** + * + * + *
+     * Required. A URI to the runtime resource. This URI can be used to manage the
+     * resource. For example, if the runtime resource is of type APIGEE_PROXY,
+     * then this field will contain the URI to the management UI of the proxy.
+     * 
+ * + * string resource_uri = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The resourceUri. + */ + public java.lang.String getResourceUri() { + java.lang.Object ref = resourceUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. A URI to the runtime resource. This URI can be used to manage the
+     * resource. For example, if the runtime resource is of type APIGEE_PROXY,
+     * then this field will contain the URI to the management UI of the proxy.
+     * 
+ * + * string resource_uri = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for resourceUri. + */ + public com.google.protobuf.ByteString getResourceUriBytes() { + java.lang.Object ref = resourceUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. A URI to the runtime resource. This URI can be used to manage the
+     * resource. For example, if the runtime resource is of type APIGEE_PROXY,
+     * then this field will contain the URI to the management UI of the proxy.
+     * 
+ * + * string resource_uri = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The resourceUri to set. + * @return This builder for chaining. + */ + public Builder setResourceUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + resourceUri_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A URI to the runtime resource. This URI can be used to manage the
+     * resource. For example, if the runtime resource is of type APIGEE_PROXY,
+     * then this field will contain the URI to the management UI of the proxy.
+     * 
+ * + * string resource_uri = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearResourceUri() { + resourceUri_ = getDefaultInstance().getResourceUri(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A URI to the runtime resource. This URI can be used to manage the
+     * resource. For example, if the runtime resource is of type APIGEE_PROXY,
+     * then this field will contain the URI to the management UI of the proxy.
+     * 
+ * + * string resource_uri = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for resourceUri to set. + * @return This builder for chaining. + */ + public Builder setResourceUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + resourceUri_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList endpoints_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureEndpointsIsMutable() { + if (!endpoints_.isModifiable()) { + endpoints_ = new com.google.protobuf.LazyStringArrayList(endpoints_); + } + bitField0_ |= 0x00000040; + } + /** + * + * + *
+     * Required. The endpoints at which this deployment resource is listening for
+     * API requests. This could be a list of complete URIs, hostnames or an IP
+     * addresses.
+     * 
+ * + * repeated string endpoints = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the endpoints. + */ + public com.google.protobuf.ProtocolStringList getEndpointsList() { + endpoints_.makeImmutable(); + return endpoints_; + } + /** + * + * + *
+     * Required. The endpoints at which this deployment resource is listening for
+     * API requests. This could be a list of complete URIs, hostnames or an IP
+     * addresses.
+     * 
+ * + * repeated string endpoints = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of endpoints. + */ + public int getEndpointsCount() { + return endpoints_.size(); + } + /** + * + * + *
+     * Required. The endpoints at which this deployment resource is listening for
+     * API requests. This could be a list of complete URIs, hostnames or an IP
+     * addresses.
+     * 
+ * + * repeated string endpoints = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The endpoints at the given index. + */ + public java.lang.String getEndpoints(int index) { + return endpoints_.get(index); + } + /** + * + * + *
+     * Required. The endpoints at which this deployment resource is listening for
+     * API requests. This could be a list of complete URIs, hostnames or an IP
+     * addresses.
+     * 
+ * + * repeated string endpoints = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the endpoints at the given index. + */ + public com.google.protobuf.ByteString getEndpointsBytes(int index) { + return endpoints_.getByteString(index); + } + /** + * + * + *
+     * Required. The endpoints at which this deployment resource is listening for
+     * API requests. This could be a list of complete URIs, hostnames or an IP
+     * addresses.
+     * 
+ * + * repeated string endpoints = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The endpoints to set. + * @return This builder for chaining. + */ + public Builder setEndpoints(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndpointsIsMutable(); + endpoints_.set(index, value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The endpoints at which this deployment resource is listening for
+     * API requests. This could be a list of complete URIs, hostnames or an IP
+     * addresses.
+     * 
+ * + * repeated string endpoints = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The endpoints to add. + * @return This builder for chaining. + */ + public Builder addEndpoints(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndpointsIsMutable(); + endpoints_.add(value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The endpoints at which this deployment resource is listening for
+     * API requests. This could be a list of complete URIs, hostnames or an IP
+     * addresses.
+     * 
+ * + * repeated string endpoints = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The endpoints to add. + * @return This builder for chaining. + */ + public Builder addAllEndpoints(java.lang.Iterable values) { + ensureEndpointsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, endpoints_); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The endpoints at which this deployment resource is listening for
+     * API requests. This could be a list of complete URIs, hostnames or an IP
+     * addresses.
+     * 
+ * + * repeated string endpoints = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearEndpoints() { + endpoints_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The endpoints at which this deployment resource is listening for
+     * API requests. This could be a list of complete URIs, hostnames or an IP
+     * addresses.
+     * 
+ * + * repeated string endpoints = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the endpoints to add. + * @return This builder for chaining. + */ + public Builder addEndpointsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureEndpointsIsMutable(); + endpoints_.add(value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList apiVersions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureApiVersionsIsMutable() { + if (!apiVersions_.isModifiable()) { + apiVersions_ = new com.google.protobuf.LazyStringArrayList(apiVersions_); + } + bitField0_ |= 0x00000080; + } + /** + * + * + *
+     * Output only. The API versions linked to this deployment.
+     * Note: A particular deployment could be linked to multiple different API
+     * versions (of same or different APIs).
+     * 
+ * + * repeated string api_versions = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return A list containing the apiVersions. + */ + public com.google.protobuf.ProtocolStringList getApiVersionsList() { + apiVersions_.makeImmutable(); + return apiVersions_; + } + /** + * + * + *
+     * Output only. The API versions linked to this deployment.
+     * Note: A particular deployment could be linked to multiple different API
+     * versions (of same or different APIs).
+     * 
+ * + * repeated string api_versions = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The count of apiVersions. + */ + public int getApiVersionsCount() { + return apiVersions_.size(); + } + /** + * + * + *
+     * Output only. The API versions linked to this deployment.
+     * Note: A particular deployment could be linked to multiple different API
+     * versions (of same or different APIs).
+     * 
+ * + * repeated string api_versions = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the element to return. + * @return The apiVersions at the given index. + */ + public java.lang.String getApiVersions(int index) { + return apiVersions_.get(index); + } + /** + * + * + *
+     * Output only. The API versions linked to this deployment.
+     * Note: A particular deployment could be linked to multiple different API
+     * versions (of same or different APIs).
+     * 
+ * + * repeated string api_versions = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the value to return. + * @return The bytes of the apiVersions at the given index. + */ + public com.google.protobuf.ByteString getApiVersionsBytes(int index) { + return apiVersions_.getByteString(index); + } + /** + * + * + *
+     * Output only. The API versions linked to this deployment.
+     * Note: A particular deployment could be linked to multiple different API
+     * versions (of same or different APIs).
+     * 
+ * + * repeated string api_versions = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index to set the value at. + * @param value The apiVersions to set. + * @return This builder for chaining. + */ + public Builder setApiVersions(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureApiVersionsIsMutable(); + apiVersions_.set(index, value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The API versions linked to this deployment.
+     * Note: A particular deployment could be linked to multiple different API
+     * versions (of same or different APIs).
+     * 
+ * + * repeated string api_versions = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The apiVersions to add. + * @return This builder for chaining. + */ + public Builder addApiVersions(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureApiVersionsIsMutable(); + apiVersions_.add(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The API versions linked to this deployment.
+     * Note: A particular deployment could be linked to multiple different API
+     * versions (of same or different APIs).
+     * 
+ * + * repeated string api_versions = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param values The apiVersions to add. + * @return This builder for chaining. + */ + public Builder addAllApiVersions(java.lang.Iterable values) { + ensureApiVersionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, apiVersions_); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The API versions linked to this deployment.
+     * Note: A particular deployment could be linked to multiple different API
+     * versions (of same or different APIs).
+     * 
+ * + * repeated string api_versions = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearApiVersions() { + apiVersions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The API versions linked to this deployment.
+     * Note: A particular deployment could be linked to multiple different API
+     * versions (of same or different APIs).
+     * 
+ * + * repeated string api_versions = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes of the apiVersions to add. + * @return This builder for chaining. + */ + public Builder addApiVersionsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureApiVersionsIsMutable(); + apiVersions_.add(value); + bitField0_ |= 0x00000080; + 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. The time at which the deployment was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * + * + *
+     * Output only. The time at which the deployment was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.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. The time at which the deployment was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the deployment was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the deployment was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The time at which the deployment was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000100); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the deployment was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time at which the deployment was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.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. The time at which the deployment was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.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 time at which the deployment was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * + * + *
+     * Output only. The time at which the deployment was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.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 time at which the deployment was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the deployment was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the deployment was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The time at which the deployment was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000200); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the deployment was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time at which the deployment was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.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 time at which the deployment was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.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.cloud.apihub.v1.AttributeValues slo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder> + sloBuilder_; + /** + * + * + *
+     * Optional. The SLO for this deployment.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-slo`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues slo = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the slo field is set. + */ + public boolean hasSlo() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + * + * + *
+     * Optional. The SLO for this deployment.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-slo`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues slo = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The slo. + */ + public com.google.cloud.apihub.v1.AttributeValues getSlo() { + if (sloBuilder_ == null) { + return slo_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : slo_; + } else { + return sloBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The SLO for this deployment.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-slo`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues slo = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSlo(com.google.cloud.apihub.v1.AttributeValues value) { + if (sloBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + slo_ = value; + } else { + sloBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The SLO for this deployment.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-slo`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues slo = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSlo(com.google.cloud.apihub.v1.AttributeValues.Builder builderForValue) { + if (sloBuilder_ == null) { + slo_ = builderForValue.build(); + } else { + sloBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The SLO for this deployment.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-slo`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues slo = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeSlo(com.google.cloud.apihub.v1.AttributeValues value) { + if (sloBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) + && slo_ != null + && slo_ != com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance()) { + getSloBuilder().mergeFrom(value); + } else { + slo_ = value; + } + } else { + sloBuilder_.mergeFrom(value); + } + if (slo_ != null) { + bitField0_ |= 0x00000400; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. The SLO for this deployment.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-slo`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues slo = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearSlo() { + bitField0_ = (bitField0_ & ~0x00000400); + slo_ = null; + if (sloBuilder_ != null) { + sloBuilder_.dispose(); + sloBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The SLO for this deployment.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-slo`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues slo = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.AttributeValues.Builder getSloBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return getSloFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The SLO for this deployment.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-slo`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues slo = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.AttributeValuesOrBuilder getSloOrBuilder() { + if (sloBuilder_ != null) { + return sloBuilder_.getMessageOrBuilder(); + } else { + return slo_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : slo_; + } + } + /** + * + * + *
+     * Optional. The SLO for this deployment.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-slo`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues slo = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder> + getSloFieldBuilder() { + if (sloBuilder_ == null) { + sloBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder>( + getSlo(), getParentForChildren(), isClean()); + slo_ = null; + } + return sloBuilder_; + } + + private com.google.cloud.apihub.v1.AttributeValues environment_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder> + environmentBuilder_; + /** + * + * + *
+     * Optional. The environment mapping to this deployment.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-environment`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues environment = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the environment field is set. + */ + public boolean hasEnvironment() { + return ((bitField0_ & 0x00000800) != 0); + } + /** + * + * + *
+     * Optional. The environment mapping to this deployment.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-environment`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues environment = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The environment. + */ + public com.google.cloud.apihub.v1.AttributeValues getEnvironment() { + if (environmentBuilder_ == null) { + return environment_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : environment_; + } else { + return environmentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The environment mapping to this deployment.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-environment`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues environment = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEnvironment(com.google.cloud.apihub.v1.AttributeValues value) { + if (environmentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + environment_ = value; + } else { + environmentBuilder_.setMessage(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The environment mapping to this deployment.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-environment`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues environment = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEnvironment( + com.google.cloud.apihub.v1.AttributeValues.Builder builderForValue) { + if (environmentBuilder_ == null) { + environment_ = builderForValue.build(); + } else { + environmentBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The environment mapping to this deployment.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-environment`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues environment = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeEnvironment(com.google.cloud.apihub.v1.AttributeValues value) { + if (environmentBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) + && environment_ != null + && environment_ != com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance()) { + getEnvironmentBuilder().mergeFrom(value); + } else { + environment_ = value; + } + } else { + environmentBuilder_.mergeFrom(value); + } + if (environment_ != null) { + bitField0_ |= 0x00000800; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. The environment mapping to this deployment.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-environment`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues environment = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEnvironment() { + bitField0_ = (bitField0_ & ~0x00000800); + environment_ = null; + if (environmentBuilder_ != null) { + environmentBuilder_.dispose(); + environmentBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The environment mapping to this deployment.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-environment`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues environment = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.AttributeValues.Builder getEnvironmentBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return getEnvironmentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The environment mapping to this deployment.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-environment`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues environment = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.AttributeValuesOrBuilder getEnvironmentOrBuilder() { + if (environmentBuilder_ != null) { + return environmentBuilder_.getMessageOrBuilder(); + } else { + return environment_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : environment_; + } + } + /** + * + * + *
+     * Optional. The environment mapping to this deployment.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-environment`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues environment = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder> + getEnvironmentFieldBuilder() { + if (environmentBuilder_ == null) { + environmentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder>( + getEnvironment(), getParentForChildren(), isClean()); + environment_ = null; + } + return environmentBuilder_; + } + + private static final class AttributesConverter + implements com.google.protobuf.MapFieldBuilder.Converter< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues> { + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues build( + com.google.cloud.apihub.v1.AttributeValuesOrBuilder val) { + if (val instanceof com.google.cloud.apihub.v1.AttributeValues) { + return (com.google.cloud.apihub.v1.AttributeValues) val; + } + return ((com.google.cloud.apihub.v1.AttributeValues.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.apihub.v1.AttributeValues> + defaultEntry() { + return AttributesDefaultEntryHolder.defaultEntry; + } + }; + + private static final AttributesConverter attributesConverter = new AttributesConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder> + attributes_; + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder> + internalGetAttributes() { + if (attributes_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(attributesConverter); + } + return attributes_; + } + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder> + internalGetMutableAttributes() { + if (attributes_ == null) { + attributes_ = new com.google.protobuf.MapFieldBuilder<>(attributesConverter); + } + bitField0_ |= 0x00001000; + onChanged(); + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().ensureBuilderMap().size(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the
+     * deployment resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().ensureBuilderMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the
+     * deployment resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getImmutableMap(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the
+     * deployment resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.apihub.v1.AttributeValues getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableAttributes().ensureBuilderMap(); + return map.containsKey(key) ? attributesConverter.build(map.get(key)) : defaultValue; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the
+     * deployment resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getAttributesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableAttributes().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return attributesConverter.build(map.get(key)); + } + + public Builder clearAttributes() { + bitField0_ = (bitField0_ & ~0x00001000); + internalGetMutableAttributes().clear(); + return this; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the
+     * deployment resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAttributes().ensureBuilderMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableAttributes() { + bitField0_ |= 0x00001000; + return internalGetMutableAttributes().ensureMessageMap(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the
+     * deployment resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAttributes( + java.lang.String key, com.google.cloud.apihub.v1.AttributeValues value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAttributes().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00001000; + return this; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the
+     * deployment resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllAttributes( + java.util.Map values) { + for (java.util.Map.Entry e : + values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableAttributes().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00001000; + return this; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the
+     * deployment resource. The key is the attribute name. It will be of the
+     * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.AttributeValues.Builder putAttributesBuilderIfAbsent( + java.lang.String key) { + java.util.Map + builderMap = internalGetMutableAttributes().ensureBuilderMap(); + com.google.cloud.apihub.v1.AttributeValuesOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = com.google.cloud.apihub.v1.AttributeValues.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.cloud.apihub.v1.AttributeValues) { + entry = ((com.google.cloud.apihub.v1.AttributeValues) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.cloud.apihub.v1.AttributeValues.Builder) entry; + } + + @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.apihub.v1.Deployment) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.Deployment) + private static final com.google.cloud.apihub.v1.Deployment DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.Deployment(); + } + + public static com.google.cloud.apihub.v1.Deployment getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Deployment parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.Deployment getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeploymentName.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeploymentName.java new file mode 100644 index 000000000000..e6d46d9139a9 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeploymentName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +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 DeploymentName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_DEPLOYMENT = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/deployments/{deployment}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String deployment; + + @Deprecated + protected DeploymentName() { + project = null; + location = null; + deployment = null; + } + + private DeploymentName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + deployment = Preconditions.checkNotNull(builder.getDeployment()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDeployment() { + return deployment; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static DeploymentName of(String project, String location, String deployment) { + return newBuilder().setProject(project).setLocation(location).setDeployment(deployment).build(); + } + + public static String format(String project, String location, String deployment) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDeployment(deployment) + .build() + .toString(); + } + + public static DeploymentName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_DEPLOYMENT.validatedMatch( + formattedString, "DeploymentName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("deployment")); + } + + 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 (DeploymentName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_DEPLOYMENT.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); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (deployment != null) { + fieldMapBuilder.put("deployment", deployment); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_DEPLOYMENT.instantiate( + "project", project, "location", location, "deployment", deployment); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + DeploymentName that = ((DeploymentName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.deployment, that.deployment); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(deployment); + return h; + } + + /** Builder for projects/{project}/locations/{location}/deployments/{deployment}. */ + public static class Builder { + private String project; + private String location; + private String deployment; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDeployment() { + return deployment; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setDeployment(String deployment) { + this.deployment = deployment; + return this; + } + + private Builder(DeploymentName deploymentName) { + this.project = deploymentName.project; + this.location = deploymentName.location; + this.deployment = deploymentName.deployment; + } + + public DeploymentName build() { + return new DeploymentName(this); + } + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeploymentOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeploymentOrBuilder.java new file mode 100644 index 000000000000..e48c5d90f4d3 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DeploymentOrBuilder.java @@ -0,0 +1,640 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface DeploymentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.Deployment) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. The name of the deployment.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. The name of the deployment.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The display name of the deployment.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. The display name of the deployment.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Optional. The description of the deployment.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Optional. The description of the deployment.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Optional. The documentation of the deployment.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the documentation field is set. + */ + boolean hasDocumentation(); + /** + * + * + *
+   * Optional. The documentation of the deployment.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The documentation. + */ + com.google.cloud.apihub.v1.Documentation getDocumentation(); + /** + * + * + *
+   * Optional. The documentation of the deployment.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.DocumentationOrBuilder getDocumentationOrBuilder(); + + /** + * + * + *
+   * Required. The type of deployment.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-deployment-type`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues deployment_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the deploymentType field is set. + */ + boolean hasDeploymentType(); + /** + * + * + *
+   * Required. The type of deployment.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-deployment-type`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues deployment_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The deploymentType. + */ + com.google.cloud.apihub.v1.AttributeValues getDeploymentType(); + /** + * + * + *
+   * Required. The type of deployment.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-deployment-type`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues deployment_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.apihub.v1.AttributeValuesOrBuilder getDeploymentTypeOrBuilder(); + + /** + * + * + *
+   * Required. A URI to the runtime resource. This URI can be used to manage the
+   * resource. For example, if the runtime resource is of type APIGEE_PROXY,
+   * then this field will contain the URI to the management UI of the proxy.
+   * 
+ * + * string resource_uri = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The resourceUri. + */ + java.lang.String getResourceUri(); + /** + * + * + *
+   * Required. A URI to the runtime resource. This URI can be used to manage the
+   * resource. For example, if the runtime resource is of type APIGEE_PROXY,
+   * then this field will contain the URI to the management UI of the proxy.
+   * 
+ * + * string resource_uri = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for resourceUri. + */ + com.google.protobuf.ByteString getResourceUriBytes(); + + /** + * + * + *
+   * Required. The endpoints at which this deployment resource is listening for
+   * API requests. This could be a list of complete URIs, hostnames or an IP
+   * addresses.
+   * 
+ * + * repeated string endpoints = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the endpoints. + */ + java.util.List getEndpointsList(); + /** + * + * + *
+   * Required. The endpoints at which this deployment resource is listening for
+   * API requests. This could be a list of complete URIs, hostnames or an IP
+   * addresses.
+   * 
+ * + * repeated string endpoints = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of endpoints. + */ + int getEndpointsCount(); + /** + * + * + *
+   * Required. The endpoints at which this deployment resource is listening for
+   * API requests. This could be a list of complete URIs, hostnames or an IP
+   * addresses.
+   * 
+ * + * repeated string endpoints = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The endpoints at the given index. + */ + java.lang.String getEndpoints(int index); + /** + * + * + *
+   * Required. The endpoints at which this deployment resource is listening for
+   * API requests. This could be a list of complete URIs, hostnames or an IP
+   * addresses.
+   * 
+ * + * repeated string endpoints = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the endpoints at the given index. + */ + com.google.protobuf.ByteString getEndpointsBytes(int index); + + /** + * + * + *
+   * Output only. The API versions linked to this deployment.
+   * Note: A particular deployment could be linked to multiple different API
+   * versions (of same or different APIs).
+   * 
+ * + * repeated string api_versions = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return A list containing the apiVersions. + */ + java.util.List getApiVersionsList(); + /** + * + * + *
+   * Output only. The API versions linked to this deployment.
+   * Note: A particular deployment could be linked to multiple different API
+   * versions (of same or different APIs).
+   * 
+ * + * repeated string api_versions = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The count of apiVersions. + */ + int getApiVersionsCount(); + /** + * + * + *
+   * Output only. The API versions linked to this deployment.
+   * Note: A particular deployment could be linked to multiple different API
+   * versions (of same or different APIs).
+   * 
+ * + * repeated string api_versions = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the element to return. + * @return The apiVersions at the given index. + */ + java.lang.String getApiVersions(int index); + /** + * + * + *
+   * Output only. The API versions linked to this deployment.
+   * Note: A particular deployment could be linked to multiple different API
+   * versions (of same or different APIs).
+   * 
+ * + * repeated string api_versions = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the value to return. + * @return The bytes of the apiVersions at the given index. + */ + com.google.protobuf.ByteString getApiVersionsBytes(int index); + + /** + * + * + *
+   * Output only. The time at which the deployment was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time at which the deployment was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time at which the deployment was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time at which the deployment was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The time at which the deployment was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The time at which the deployment was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Optional. The SLO for this deployment.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-slo`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues slo = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the slo field is set. + */ + boolean hasSlo(); + /** + * + * + *
+   * Optional. The SLO for this deployment.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-slo`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues slo = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The slo. + */ + com.google.cloud.apihub.v1.AttributeValues getSlo(); + /** + * + * + *
+   * Optional. The SLO for this deployment.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-slo`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues slo = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.AttributeValuesOrBuilder getSloOrBuilder(); + + /** + * + * + *
+   * Optional. The environment mapping to this deployment.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-environment`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues environment = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the environment field is set. + */ + boolean hasEnvironment(); + /** + * + * + *
+   * Optional. The environment mapping to this deployment.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-environment`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues environment = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The environment. + */ + com.google.cloud.apihub.v1.AttributeValues getEnvironment(); + /** + * + * + *
+   * Optional. The environment mapping to this deployment.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-environment`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues environment = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.AttributeValuesOrBuilder getEnvironmentOrBuilder(); + + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the
+   * deployment resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getAttributesCount(); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the
+   * deployment resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsAttributes(java.lang.String key); + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAttributes(); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the
+   * deployment resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getAttributesMap(); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the
+   * deployment resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues defaultValue); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the
+   * deployment resource. The key is the attribute name. It will be of the
+   * format: `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.AttributeValues getAttributesOrThrow(java.lang.String key); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DisablePluginRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DisablePluginRequest.java new file mode 100644 index 000000000000..c063259a8764 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DisablePluginRequest.java @@ -0,0 +1,648 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/plugin_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [DisablePlugin][google.cloud.apihub.v1.ApiHubPlugin.DisablePlugin]
+ * method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.DisablePluginRequest} + */ +public final class DisablePluginRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.DisablePluginRequest) + DisablePluginRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DisablePluginRequest.newBuilder() to construct. + private DisablePluginRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DisablePluginRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DisablePluginRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.PluginServiceProto + .internal_static_google_cloud_apihub_v1_DisablePluginRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.PluginServiceProto + .internal_static_google_cloud_apihub_v1_DisablePluginRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.DisablePluginRequest.class, + com.google.cloud.apihub.v1.DisablePluginRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the plugin to disable.
+   * Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
+   * 
+ * + * + * 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 plugin to disable.
+   * Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
+   * 
+ * + * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.apihub.v1.DisablePluginRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.DisablePluginRequest other = + (com.google.cloud.apihub.v1.DisablePluginRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.DisablePluginRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DisablePluginRequest 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.apihub.v1.DisablePluginRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DisablePluginRequest 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.apihub.v1.DisablePluginRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.DisablePluginRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.DisablePluginRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DisablePluginRequest 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.apihub.v1.DisablePluginRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DisablePluginRequest 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.apihub.v1.DisablePluginRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.DisablePluginRequest 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.apihub.v1.DisablePluginRequest 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 [DisablePlugin][google.cloud.apihub.v1.ApiHubPlugin.DisablePlugin]
+   * method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.DisablePluginRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.DisablePluginRequest) + com.google.cloud.apihub.v1.DisablePluginRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.PluginServiceProto + .internal_static_google_cloud_apihub_v1_DisablePluginRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.PluginServiceProto + .internal_static_google_cloud_apihub_v1_DisablePluginRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.DisablePluginRequest.class, + com.google.cloud.apihub.v1.DisablePluginRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.DisablePluginRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.PluginServiceProto + .internal_static_google_cloud_apihub_v1_DisablePluginRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DisablePluginRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.DisablePluginRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DisablePluginRequest build() { + com.google.cloud.apihub.v1.DisablePluginRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.DisablePluginRequest buildPartial() { + com.google.cloud.apihub.v1.DisablePluginRequest result = + new com.google.cloud.apihub.v1.DisablePluginRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.DisablePluginRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.apihub.v1.DisablePluginRequest) { + return mergeFrom((com.google.cloud.apihub.v1.DisablePluginRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.DisablePluginRequest other) { + if (other == com.google.cloud.apihub.v1.DisablePluginRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the plugin to disable.
+     * Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
+     * 
+ * + * + * 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 plugin to disable.
+     * Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
+     * 
+ * + * + * 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 plugin to disable.
+     * Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the plugin to disable.
+     * Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the plugin to disable.
+     * Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.apihub.v1.DisablePluginRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.DisablePluginRequest) + private static final com.google.cloud.apihub.v1.DisablePluginRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.DisablePluginRequest(); + } + + public static com.google.cloud.apihub.v1.DisablePluginRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DisablePluginRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.DisablePluginRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DisablePluginRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DisablePluginRequestOrBuilder.java new file mode 100644 index 000000000000..2208833d7ab3 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DisablePluginRequestOrBuilder.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/plugin_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface DisablePluginRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.DisablePluginRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the plugin to disable.
+   * Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the plugin to disable.
+   * Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
+   * 
+ * + * + * 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-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Documentation.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Documentation.java new file mode 100644 index 000000000000..38c9c2a505c9 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Documentation.java @@ -0,0 +1,623 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * Documentation details.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Documentation} + */ +public final class Documentation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.Documentation) + DocumentationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Documentation.newBuilder() to construct. + private Documentation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Documentation() { + externalUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Documentation(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Documentation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Documentation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Documentation.class, + com.google.cloud.apihub.v1.Documentation.Builder.class); + } + + public static final int EXTERNAL_URI_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object externalUri_ = ""; + /** + * + * + *
+   * Optional. The uri of the externally hosted documentation.
+   * 
+ * + * string external_uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The externalUri. + */ + @java.lang.Override + public java.lang.String getExternalUri() { + java.lang.Object ref = externalUri_; + 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(); + externalUri_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The uri of the externally hosted documentation.
+   * 
+ * + * string external_uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for externalUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getExternalUriBytes() { + java.lang.Object ref = externalUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + externalUri_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(externalUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, externalUri_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(externalUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, externalUri_); + } + size += getUnknownFields().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.apihub.v1.Documentation)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.Documentation other = (com.google.cloud.apihub.v1.Documentation) obj; + + if (!getExternalUri().equals(other.getExternalUri())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + EXTERNAL_URI_FIELD_NUMBER; + hash = (53 * hash) + getExternalUri().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.Documentation parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Documentation 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.apihub.v1.Documentation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Documentation 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.apihub.v1.Documentation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Documentation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.Documentation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Documentation 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.apihub.v1.Documentation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Documentation 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.apihub.v1.Documentation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Documentation 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.apihub.v1.Documentation 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; + } + /** + * + * + *
+   * Documentation details.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Documentation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.Documentation) + com.google.cloud.apihub.v1.DocumentationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Documentation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Documentation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Documentation.class, + com.google.cloud.apihub.v1.Documentation.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.Documentation.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + externalUri_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Documentation_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Documentation getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.Documentation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Documentation build() { + com.google.cloud.apihub.v1.Documentation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Documentation buildPartial() { + com.google.cloud.apihub.v1.Documentation result = + new com.google.cloud.apihub.v1.Documentation(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.Documentation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.externalUri_ = externalUri_; + } + } + + @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.apihub.v1.Documentation) { + return mergeFrom((com.google.cloud.apihub.v1.Documentation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.Documentation other) { + if (other == com.google.cloud.apihub.v1.Documentation.getDefaultInstance()) return this; + if (!other.getExternalUri().isEmpty()) { + externalUri_ = other.externalUri_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + externalUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object externalUri_ = ""; + /** + * + * + *
+     * Optional. The uri of the externally hosted documentation.
+     * 
+ * + * string external_uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The externalUri. + */ + public java.lang.String getExternalUri() { + java.lang.Object ref = externalUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + externalUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The uri of the externally hosted documentation.
+     * 
+ * + * string external_uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for externalUri. + */ + public com.google.protobuf.ByteString getExternalUriBytes() { + java.lang.Object ref = externalUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + externalUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The uri of the externally hosted documentation.
+     * 
+ * + * string external_uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The externalUri to set. + * @return This builder for chaining. + */ + public Builder setExternalUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + externalUri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The uri of the externally hosted documentation.
+     * 
+ * + * string external_uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearExternalUri() { + externalUri_ = getDefaultInstance().getExternalUri(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The uri of the externally hosted documentation.
+     * 
+ * + * string external_uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for externalUri to set. + * @return This builder for chaining. + */ + public Builder setExternalUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + externalUri_ = value; + bitField0_ |= 0x00000001; + 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.apihub.v1.Documentation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.Documentation) + private static final com.google.cloud.apihub.v1.Documentation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.Documentation(); + } + + public static com.google.cloud.apihub.v1.Documentation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Documentation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.Documentation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DocumentationOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DocumentationOrBuilder.java new file mode 100644 index 000000000000..a51d9e7ce940 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/DocumentationOrBuilder.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface DocumentationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.Documentation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. The uri of the externally hosted documentation.
+   * 
+ * + * string external_uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The externalUri. + */ + java.lang.String getExternalUri(); + /** + * + * + *
+   * Optional. The uri of the externally hosted documentation.
+   * 
+ * + * string external_uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for externalUri. + */ + com.google.protobuf.ByteString getExternalUriBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/EnablePluginRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/EnablePluginRequest.java new file mode 100644 index 000000000000..8fb987e39552 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/EnablePluginRequest.java @@ -0,0 +1,647 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/plugin_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [EnablePlugin][google.cloud.apihub.v1.ApiHubPlugin.EnablePlugin] method's
+ * request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.EnablePluginRequest} + */ +public final class EnablePluginRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.EnablePluginRequest) + EnablePluginRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use EnablePluginRequest.newBuilder() to construct. + private EnablePluginRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EnablePluginRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EnablePluginRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.PluginServiceProto + .internal_static_google_cloud_apihub_v1_EnablePluginRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.PluginServiceProto + .internal_static_google_cloud_apihub_v1_EnablePluginRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.EnablePluginRequest.class, + com.google.cloud.apihub.v1.EnablePluginRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the plugin to enable.
+   * Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
+   * 
+ * + * + * 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 plugin to enable.
+   * Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
+   * 
+ * + * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.apihub.v1.EnablePluginRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.EnablePluginRequest other = + (com.google.cloud.apihub.v1.EnablePluginRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.EnablePluginRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.EnablePluginRequest 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.apihub.v1.EnablePluginRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.EnablePluginRequest 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.apihub.v1.EnablePluginRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.EnablePluginRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.EnablePluginRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.EnablePluginRequest 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.apihub.v1.EnablePluginRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.EnablePluginRequest 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.apihub.v1.EnablePluginRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.EnablePluginRequest 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.apihub.v1.EnablePluginRequest 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 [EnablePlugin][google.cloud.apihub.v1.ApiHubPlugin.EnablePlugin] method's
+   * request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.EnablePluginRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.EnablePluginRequest) + com.google.cloud.apihub.v1.EnablePluginRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.PluginServiceProto + .internal_static_google_cloud_apihub_v1_EnablePluginRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.PluginServiceProto + .internal_static_google_cloud_apihub_v1_EnablePluginRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.EnablePluginRequest.class, + com.google.cloud.apihub.v1.EnablePluginRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.EnablePluginRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.PluginServiceProto + .internal_static_google_cloud_apihub_v1_EnablePluginRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.EnablePluginRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.EnablePluginRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.EnablePluginRequest build() { + com.google.cloud.apihub.v1.EnablePluginRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.EnablePluginRequest buildPartial() { + com.google.cloud.apihub.v1.EnablePluginRequest result = + new com.google.cloud.apihub.v1.EnablePluginRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.EnablePluginRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.apihub.v1.EnablePluginRequest) { + return mergeFrom((com.google.cloud.apihub.v1.EnablePluginRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.EnablePluginRequest other) { + if (other == com.google.cloud.apihub.v1.EnablePluginRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the plugin to enable.
+     * Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
+     * 
+ * + * + * 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 plugin to enable.
+     * Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
+     * 
+ * + * + * 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 plugin to enable.
+     * Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the plugin to enable.
+     * Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the plugin to enable.
+     * Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.apihub.v1.EnablePluginRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.EnablePluginRequest) + private static final com.google.cloud.apihub.v1.EnablePluginRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.EnablePluginRequest(); + } + + public static com.google.cloud.apihub.v1.EnablePluginRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EnablePluginRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.EnablePluginRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/EnablePluginRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/EnablePluginRequestOrBuilder.java new file mode 100644 index 000000000000..0fa580f64d30 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/EnablePluginRequestOrBuilder.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/plugin_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface EnablePluginRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.EnablePluginRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the plugin to enable.
+   * Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the plugin to enable.
+   * Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
+   * 
+ * + * + * 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-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ExternalApi.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ExternalApi.java new file mode 100644 index 000000000000..0ca668e3053d --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ExternalApi.java @@ -0,0 +1,2918 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * An external API represents an API being provided by external sources. This
+ * can be used to model third-party APIs and can be used to define dependencies.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ExternalApi} + */ +public final class ExternalApi extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.ExternalApi) + ExternalApiOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExternalApi.newBuilder() to construct. + private ExternalApi(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExternalApi() { + name_ = ""; + displayName_ = ""; + description_ = ""; + endpoints_ = com.google.protobuf.LazyStringArrayList.emptyList(); + paths_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExternalApi(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_ExternalApi_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 7: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_ExternalApi_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ExternalApi.class, + com.google.cloud.apihub.v1.ExternalApi.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. Format:
+   * `projects/{project}/locations/{location}/externalApi/{externalApi}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+   * Identifier. Format:
+   * `projects/{project}/locations/{location}/externalApi/{externalApi}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * Required. Display name of the external API. Max length is 63 characters
+   * (Unicode Code Points).
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+   * Required. Display name of the external API. Max length is 63 characters
+   * (Unicode Code Points).
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 DESCRIPTION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * Optional. Description of the external API. Max length is 2000 characters
+   * (Unicode Code Points).
+   * 
+ * + * string description = 3 [(.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. Description of the external API. Max length is 2000 characters
+   * (Unicode Code Points).
+   * 
+ * + * string description = 3 [(.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 ENDPOINTS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList endpoints_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Optional. List of endpoints on which this API is accessible.
+   * 
+ * + * repeated string endpoints = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the endpoints. + */ + public com.google.protobuf.ProtocolStringList getEndpointsList() { + return endpoints_; + } + /** + * + * + *
+   * Optional. List of endpoints on which this API is accessible.
+   * 
+ * + * repeated string endpoints = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of endpoints. + */ + public int getEndpointsCount() { + return endpoints_.size(); + } + /** + * + * + *
+   * Optional. List of endpoints on which this API is accessible.
+   * 
+ * + * repeated string endpoints = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The endpoints at the given index. + */ + public java.lang.String getEndpoints(int index) { + return endpoints_.get(index); + } + /** + * + * + *
+   * Optional. List of endpoints on which this API is accessible.
+   * 
+ * + * repeated string endpoints = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the endpoints at the given index. + */ + public com.google.protobuf.ByteString getEndpointsBytes(int index) { + return endpoints_.getByteString(index); + } + + public static final int PATHS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList paths_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Optional. List of paths served by this API.
+   * 
+ * + * repeated string paths = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the paths. + */ + public com.google.protobuf.ProtocolStringList getPathsList() { + return paths_; + } + /** + * + * + *
+   * Optional. List of paths served by this API.
+   * 
+ * + * repeated string paths = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of paths. + */ + public int getPathsCount() { + return paths_.size(); + } + /** + * + * + *
+   * Optional. List of paths served by this API.
+   * 
+ * + * repeated string paths = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The paths at the given index. + */ + public java.lang.String getPaths(int index) { + return paths_.get(index); + } + /** + * + * + *
+   * Optional. List of paths served by this API.
+   * 
+ * + * repeated string paths = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the paths at the given index. + */ + public com.google.protobuf.ByteString getPathsBytes(int index) { + return paths_.getByteString(index); + } + + public static final int DOCUMENTATION_FIELD_NUMBER = 6; + private com.google.cloud.apihub.v1.Documentation documentation_; + /** + * + * + *
+   * Optional. Documentation of the external API.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the documentation field is set. + */ + @java.lang.Override + public boolean hasDocumentation() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Optional. Documentation of the external API.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The documentation. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Documentation getDocumentation() { + return documentation_ == null + ? com.google.cloud.apihub.v1.Documentation.getDefaultInstance() + : documentation_; + } + /** + * + * + *
+   * Optional. Documentation of the external API.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.DocumentationOrBuilder getDocumentationOrBuilder() { + return documentation_ == null + ? com.google.cloud.apihub.v1.Documentation.getDefaultInstance() + : documentation_; + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 7; + + private static final class AttributesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.apihub.v1.AttributeValues> + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_ExternalApi_AttributesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField + attributes_; + + private com.google.protobuf.MapField + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField(AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the Version
+   * resource. The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().getMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the Version
+   * resource. The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the Version
+   * resource. The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.apihub.v1.AttributeValues getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the Version
+   * resource. The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getAttributesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 8; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Creation timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Output only. Creation timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 8 [(.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 timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 9; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Last update timestamp.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Output only. Last update timestamp.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.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. Last update timestamp.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + for (int i = 0; i < endpoints_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, endpoints_.getRaw(i)); + } + for (int i = 0; i < paths_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, paths_.getRaw(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getDocumentation()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAttributes(), AttributesDefaultEntryHolder.defaultEntry, 7); + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(8, getCreateTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(9, getUpdateTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + { + int dataSize = 0; + for (int i = 0; i < endpoints_.size(); i++) { + dataSize += computeStringSizeNoTag(endpoints_.getRaw(i)); + } + size += dataSize; + size += 1 * getEndpointsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < paths_.size(); i++) { + dataSize += computeStringSizeNoTag(paths_.getRaw(i)); + } + size += dataSize; + size += 1 * getPathsList().size(); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getDocumentation()); + } + for (java.util.Map.Entry entry : + internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry + attributes__ = + AttributesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, attributes__); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getCreateTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getUpdateTime()); + } + size += getUnknownFields().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.apihub.v1.ExternalApi)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.ExternalApi other = (com.google.cloud.apihub.v1.ExternalApi) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getEndpointsList().equals(other.getEndpointsList())) return false; + if (!getPathsList().equals(other.getPathsList())) return false; + if (hasDocumentation() != other.hasDocumentation()) return false; + if (hasDocumentation()) { + if (!getDocumentation().equals(other.getDocumentation())) return false; + } + if (!internalGetAttributes().equals(other.internalGetAttributes())) 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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (getEndpointsCount() > 0) { + hash = (37 * hash) + ENDPOINTS_FIELD_NUMBER; + hash = (53 * hash) + getEndpointsList().hashCode(); + } + if (getPathsCount() > 0) { + hash = (37 * hash) + PATHS_FIELD_NUMBER; + hash = (53 * hash) + getPathsList().hashCode(); + } + if (hasDocumentation()) { + hash = (37 * hash) + DOCUMENTATION_FIELD_NUMBER; + hash = (53 * hash) + getDocumentation().hashCode(); + } + if (!internalGetAttributes().getMap().isEmpty()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttributes().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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.ExternalApi parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ExternalApi 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.apihub.v1.ExternalApi parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ExternalApi 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.apihub.v1.ExternalApi parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ExternalApi parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.ExternalApi parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ExternalApi 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.apihub.v1.ExternalApi parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ExternalApi 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.apihub.v1.ExternalApi parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ExternalApi 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.apihub.v1.ExternalApi 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; + } + /** + * + * + *
+   * An external API represents an API being provided by external sources. This
+   * can be used to model third-party APIs and can be used to define dependencies.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ExternalApi} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.ExternalApi) + com.google.cloud.apihub.v1.ExternalApiOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_ExternalApi_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 7: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 7: + return internalGetMutableAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_ExternalApi_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ExternalApi.class, + com.google.cloud.apihub.v1.ExternalApi.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.ExternalApi.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getDocumentationFieldBuilder(); + getCreateTimeFieldBuilder(); + getUpdateTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + description_ = ""; + endpoints_ = com.google.protobuf.LazyStringArrayList.emptyList(); + paths_ = com.google.protobuf.LazyStringArrayList.emptyList(); + documentation_ = null; + if (documentationBuilder_ != null) { + documentationBuilder_.dispose(); + documentationBuilder_ = null; + } + internalGetMutableAttributes().clear(); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_ExternalApi_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ExternalApi getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.ExternalApi.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ExternalApi build() { + com.google.cloud.apihub.v1.ExternalApi result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ExternalApi buildPartial() { + com.google.cloud.apihub.v1.ExternalApi result = + new com.google.cloud.apihub.v1.ExternalApi(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.ExternalApi result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + endpoints_.makeImmutable(); + result.endpoints_ = endpoints_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + paths_.makeImmutable(); + result.paths_ = paths_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000020) != 0)) { + result.documentation_ = + documentationBuilder_ == null ? documentation_ : documentationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.attributes_ = + internalGetAttributes().build(AttributesDefaultEntryHolder.defaultEntry); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.ExternalApi) { + return mergeFrom((com.google.cloud.apihub.v1.ExternalApi) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.ExternalApi other) { + if (other == com.google.cloud.apihub.v1.ExternalApi.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.endpoints_.isEmpty()) { + if (endpoints_.isEmpty()) { + endpoints_ = other.endpoints_; + bitField0_ |= 0x00000008; + } else { + ensureEndpointsIsMutable(); + endpoints_.addAll(other.endpoints_); + } + onChanged(); + } + if (!other.paths_.isEmpty()) { + if (paths_.isEmpty()) { + paths_ = other.paths_; + bitField0_ |= 0x00000010; + } else { + ensurePathsIsMutable(); + paths_.addAll(other.paths_); + } + onChanged(); + } + if (other.hasDocumentation()) { + mergeDocumentation(other.getDocumentation()); + } + internalGetMutableAttributes().mergeFrom(other.internalGetAttributes()); + bitField0_ |= 0x00000040; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureEndpointsIsMutable(); + endpoints_.add(s); + break; + } // case 34 + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + ensurePathsIsMutable(); + paths_.add(s); + break; + } // case 42 + case 50: + { + input.readMessage(getDocumentationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.apihub.v1.AttributeValues> + attributes__ = + input.readMessage( + AttributesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAttributes() + .ensureBuilderMap() + .put(attributes__.getKey(), attributes__.getValue()); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 74: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 74 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. Format:
+     * `projects/{project}/locations/{location}/externalApi/{externalApi}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. Format:
+     * `projects/{project}/locations/{location}/externalApi/{externalApi}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. Format:
+     * `projects/{project}/locations/{location}/externalApi/{externalApi}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Format:
+     * `projects/{project}/locations/{location}/externalApi/{externalApi}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Format:
+     * `projects/{project}/locations/{location}/externalApi/{externalApi}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Required. Display name of the external API. Max length is 63 characters
+     * (Unicode Code Points).
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. Display name of the external API. Max length is 63 characters
+     * (Unicode Code Points).
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. Display name of the external API. Max length is 63 characters
+     * (Unicode Code Points).
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Display name of the external API. Max length is 63 characters
+     * (Unicode Code Points).
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Display name of the external API. Max length is 63 characters
+     * (Unicode Code Points).
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Optional. Description of the external API. Max length is 2000 characters
+     * (Unicode Code Points).
+     * 
+ * + * string description = 3 [(.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. Description of the external API. Max length is 2000 characters
+     * (Unicode Code Points).
+     * 
+ * + * string description = 3 [(.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. Description of the external API. Max length is 2000 characters
+     * (Unicode Code Points).
+     * 
+ * + * string description = 3 [(.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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Description of the external API. Max length is 2000 characters
+     * (Unicode Code Points).
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Description of the external API. Max length is 2000 characters
+     * (Unicode Code Points).
+     * 
+ * + * string description = 3 [(.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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList endpoints_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureEndpointsIsMutable() { + if (!endpoints_.isModifiable()) { + endpoints_ = new com.google.protobuf.LazyStringArrayList(endpoints_); + } + bitField0_ |= 0x00000008; + } + /** + * + * + *
+     * Optional. List of endpoints on which this API is accessible.
+     * 
+ * + * repeated string endpoints = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the endpoints. + */ + public com.google.protobuf.ProtocolStringList getEndpointsList() { + endpoints_.makeImmutable(); + return endpoints_; + } + /** + * + * + *
+     * Optional. List of endpoints on which this API is accessible.
+     * 
+ * + * repeated string endpoints = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of endpoints. + */ + public int getEndpointsCount() { + return endpoints_.size(); + } + /** + * + * + *
+     * Optional. List of endpoints on which this API is accessible.
+     * 
+ * + * repeated string endpoints = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The endpoints at the given index. + */ + public java.lang.String getEndpoints(int index) { + return endpoints_.get(index); + } + /** + * + * + *
+     * Optional. List of endpoints on which this API is accessible.
+     * 
+ * + * repeated string endpoints = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the endpoints at the given index. + */ + public com.google.protobuf.ByteString getEndpointsBytes(int index) { + return endpoints_.getByteString(index); + } + /** + * + * + *
+     * Optional. List of endpoints on which this API is accessible.
+     * 
+ * + * repeated string endpoints = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index to set the value at. + * @param value The endpoints to set. + * @return This builder for chaining. + */ + public Builder setEndpoints(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndpointsIsMutable(); + endpoints_.set(index, value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of endpoints on which this API is accessible.
+     * 
+ * + * repeated string endpoints = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The endpoints to add. + * @return This builder for chaining. + */ + public Builder addEndpoints(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndpointsIsMutable(); + endpoints_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of endpoints on which this API is accessible.
+     * 
+ * + * repeated string endpoints = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param values The endpoints to add. + * @return This builder for chaining. + */ + public Builder addAllEndpoints(java.lang.Iterable values) { + ensureEndpointsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, endpoints_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of endpoints on which this API is accessible.
+     * 
+ * + * repeated string endpoints = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEndpoints() { + endpoints_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of endpoints on which this API is accessible.
+     * 
+ * + * repeated string endpoints = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes of the endpoints to add. + * @return This builder for chaining. + */ + public Builder addEndpointsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureEndpointsIsMutable(); + endpoints_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList paths_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensurePathsIsMutable() { + if (!paths_.isModifiable()) { + paths_ = new com.google.protobuf.LazyStringArrayList(paths_); + } + bitField0_ |= 0x00000010; + } + /** + * + * + *
+     * Optional. List of paths served by this API.
+     * 
+ * + * repeated string paths = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the paths. + */ + public com.google.protobuf.ProtocolStringList getPathsList() { + paths_.makeImmutable(); + return paths_; + } + /** + * + * + *
+     * Optional. List of paths served by this API.
+     * 
+ * + * repeated string paths = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of paths. + */ + public int getPathsCount() { + return paths_.size(); + } + /** + * + * + *
+     * Optional. List of paths served by this API.
+     * 
+ * + * repeated string paths = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The paths at the given index. + */ + public java.lang.String getPaths(int index) { + return paths_.get(index); + } + /** + * + * + *
+     * Optional. List of paths served by this API.
+     * 
+ * + * repeated string paths = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the paths at the given index. + */ + public com.google.protobuf.ByteString getPathsBytes(int index) { + return paths_.getByteString(index); + } + /** + * + * + *
+     * Optional. List of paths served by this API.
+     * 
+ * + * repeated string paths = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index to set the value at. + * @param value The paths to set. + * @return This builder for chaining. + */ + public Builder setPaths(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePathsIsMutable(); + paths_.set(index, value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of paths served by this API.
+     * 
+ * + * repeated string paths = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The paths to add. + * @return This builder for chaining. + */ + public Builder addPaths(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePathsIsMutable(); + paths_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of paths served by this API.
+     * 
+ * + * repeated string paths = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param values The paths to add. + * @return This builder for chaining. + */ + public Builder addAllPaths(java.lang.Iterable values) { + ensurePathsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, paths_); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of paths served by this API.
+     * 
+ * + * repeated string paths = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPaths() { + paths_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of paths served by this API.
+     * 
+ * + * repeated string paths = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes of the paths to add. + * @return This builder for chaining. + */ + public Builder addPathsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePathsIsMutable(); + paths_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private com.google.cloud.apihub.v1.Documentation documentation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Documentation, + com.google.cloud.apihub.v1.Documentation.Builder, + com.google.cloud.apihub.v1.DocumentationOrBuilder> + documentationBuilder_; + /** + * + * + *
+     * Optional. Documentation of the external API.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the documentation field is set. + */ + public boolean hasDocumentation() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Optional. Documentation of the external API.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The documentation. + */ + public com.google.cloud.apihub.v1.Documentation getDocumentation() { + if (documentationBuilder_ == null) { + return documentation_ == null + ? com.google.cloud.apihub.v1.Documentation.getDefaultInstance() + : documentation_; + } else { + return documentationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Documentation of the external API.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDocumentation(com.google.cloud.apihub.v1.Documentation value) { + if (documentationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + documentation_ = value; + } else { + documentationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Documentation of the external API.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDocumentation( + com.google.cloud.apihub.v1.Documentation.Builder builderForValue) { + if (documentationBuilder_ == null) { + documentation_ = builderForValue.build(); + } else { + documentationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Documentation of the external API.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeDocumentation(com.google.cloud.apihub.v1.Documentation value) { + if (documentationBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && documentation_ != null + && documentation_ != com.google.cloud.apihub.v1.Documentation.getDefaultInstance()) { + getDocumentationBuilder().mergeFrom(value); + } else { + documentation_ = value; + } + } else { + documentationBuilder_.mergeFrom(value); + } + if (documentation_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. Documentation of the external API.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearDocumentation() { + bitField0_ = (bitField0_ & ~0x00000020); + documentation_ = null; + if (documentationBuilder_ != null) { + documentationBuilder_.dispose(); + documentationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Documentation of the external API.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.Documentation.Builder getDocumentationBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getDocumentationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Documentation of the external API.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.DocumentationOrBuilder getDocumentationOrBuilder() { + if (documentationBuilder_ != null) { + return documentationBuilder_.getMessageOrBuilder(); + } else { + return documentation_ == null + ? com.google.cloud.apihub.v1.Documentation.getDefaultInstance() + : documentation_; + } + } + /** + * + * + *
+     * Optional. Documentation of the external API.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Documentation, + com.google.cloud.apihub.v1.Documentation.Builder, + com.google.cloud.apihub.v1.DocumentationOrBuilder> + getDocumentationFieldBuilder() { + if (documentationBuilder_ == null) { + documentationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Documentation, + com.google.cloud.apihub.v1.Documentation.Builder, + com.google.cloud.apihub.v1.DocumentationOrBuilder>( + getDocumentation(), getParentForChildren(), isClean()); + documentation_ = null; + } + return documentationBuilder_; + } + + private static final class AttributesConverter + implements com.google.protobuf.MapFieldBuilder.Converter< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues> { + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues build( + com.google.cloud.apihub.v1.AttributeValuesOrBuilder val) { + if (val instanceof com.google.cloud.apihub.v1.AttributeValues) { + return (com.google.cloud.apihub.v1.AttributeValues) val; + } + return ((com.google.cloud.apihub.v1.AttributeValues.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.apihub.v1.AttributeValues> + defaultEntry() { + return AttributesDefaultEntryHolder.defaultEntry; + } + }; + + private static final AttributesConverter attributesConverter = new AttributesConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder> + attributes_; + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder> + internalGetAttributes() { + if (attributes_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(attributesConverter); + } + return attributes_; + } + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder> + internalGetMutableAttributes() { + if (attributes_ == null) { + attributes_ = new com.google.protobuf.MapFieldBuilder<>(attributesConverter); + } + bitField0_ |= 0x00000040; + onChanged(); + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().ensureBuilderMap().size(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the Version
+     * resource. The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().ensureBuilderMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the Version
+     * resource. The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getImmutableMap(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the Version
+     * resource. The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.apihub.v1.AttributeValues getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableAttributes().ensureBuilderMap(); + return map.containsKey(key) ? attributesConverter.build(map.get(key)) : defaultValue; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the Version
+     * resource. The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getAttributesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableAttributes().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return attributesConverter.build(map.get(key)); + } + + public Builder clearAttributes() { + bitField0_ = (bitField0_ & ~0x00000040); + internalGetMutableAttributes().clear(); + return this; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the Version
+     * resource. The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAttributes().ensureBuilderMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableAttributes() { + bitField0_ |= 0x00000040; + return internalGetMutableAttributes().ensureMessageMap(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the Version
+     * resource. The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAttributes( + java.lang.String key, com.google.cloud.apihub.v1.AttributeValues value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAttributes().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00000040; + return this; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the Version
+     * resource. The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllAttributes( + java.util.Map values) { + for (java.util.Map.Entry e : + values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableAttributes().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00000040; + return this; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the Version
+     * resource. The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.AttributeValues.Builder putAttributesBuilderIfAbsent( + java.lang.String key) { + java.util.Map + builderMap = internalGetMutableAttributes().ensureBuilderMap(); + com.google.cloud.apihub.v1.AttributeValuesOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = com.google.cloud.apihub.v1.AttributeValues.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.cloud.apihub.v1.AttributeValues) { + entry = ((com.google.cloud.apihub.v1.AttributeValues) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.cloud.apihub.v1.AttributeValues.Builder) entry; + } + + 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 timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+     * Output only. Creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.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 timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000080); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.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 timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_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> + 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. Last update timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * + * + *
+     * Output only. Last update timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.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. Last update timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Last update timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Last update timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Last update timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000100); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Last update timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Last update timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.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. Last update timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.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_; + } + + @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.apihub.v1.ExternalApi) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.ExternalApi) + private static final com.google.cloud.apihub.v1.ExternalApi DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.ExternalApi(); + } + + public static com.google.cloud.apihub.v1.ExternalApi getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExternalApi parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.ExternalApi getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ExternalApiName.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ExternalApiName.java new file mode 100644 index 000000000000..79aa29afa7b8 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ExternalApiName.java @@ -0,0 +1,227 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +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 ExternalApiName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_EXTERNAL_API = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/externalApis/{external_api}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String externalApi; + + @Deprecated + protected ExternalApiName() { + project = null; + location = null; + externalApi = null; + } + + private ExternalApiName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + externalApi = Preconditions.checkNotNull(builder.getExternalApi()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getExternalApi() { + return externalApi; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ExternalApiName of(String project, String location, String externalApi) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setExternalApi(externalApi) + .build(); + } + + public static String format(String project, String location, String externalApi) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setExternalApi(externalApi) + .build() + .toString(); + } + + public static ExternalApiName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_EXTERNAL_API.validatedMatch( + formattedString, "ExternalApiName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("external_api")); + } + + 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 (ExternalApiName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_EXTERNAL_API.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); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (externalApi != null) { + fieldMapBuilder.put("external_api", externalApi); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_EXTERNAL_API.instantiate( + "project", project, "location", location, "external_api", externalApi); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + ExternalApiName that = ((ExternalApiName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.externalApi, that.externalApi); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(externalApi); + return h; + } + + /** Builder for projects/{project}/locations/{location}/externalApis/{external_api}. */ + public static class Builder { + private String project; + private String location; + private String externalApi; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getExternalApi() { + return externalApi; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setExternalApi(String externalApi) { + this.externalApi = externalApi; + return this; + } + + private Builder(ExternalApiName externalApiName) { + this.project = externalApiName.project; + this.location = externalApiName.location; + this.externalApi = externalApiName.externalApi; + } + + public ExternalApiName build() { + return new ExternalApiName(this); + } + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ExternalApiOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ExternalApiOrBuilder.java new file mode 100644 index 000000000000..234c2a66caf4 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ExternalApiOrBuilder.java @@ -0,0 +1,409 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface ExternalApiOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.ExternalApi) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. Format:
+   * `projects/{project}/locations/{location}/externalApi/{externalApi}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. Format:
+   * `projects/{project}/locations/{location}/externalApi/{externalApi}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. Display name of the external API. Max length is 63 characters
+   * (Unicode Code Points).
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. Display name of the external API. Max length is 63 characters
+   * (Unicode Code Points).
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Optional. Description of the external API. Max length is 2000 characters
+   * (Unicode Code Points).
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Optional. Description of the external API. Max length is 2000 characters
+   * (Unicode Code Points).
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Optional. List of endpoints on which this API is accessible.
+   * 
+ * + * repeated string endpoints = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the endpoints. + */ + java.util.List getEndpointsList(); + /** + * + * + *
+   * Optional. List of endpoints on which this API is accessible.
+   * 
+ * + * repeated string endpoints = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of endpoints. + */ + int getEndpointsCount(); + /** + * + * + *
+   * Optional. List of endpoints on which this API is accessible.
+   * 
+ * + * repeated string endpoints = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The endpoints at the given index. + */ + java.lang.String getEndpoints(int index); + /** + * + * + *
+   * Optional. List of endpoints on which this API is accessible.
+   * 
+ * + * repeated string endpoints = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the endpoints at the given index. + */ + com.google.protobuf.ByteString getEndpointsBytes(int index); + + /** + * + * + *
+   * Optional. List of paths served by this API.
+   * 
+ * + * repeated string paths = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the paths. + */ + java.util.List getPathsList(); + /** + * + * + *
+   * Optional. List of paths served by this API.
+   * 
+ * + * repeated string paths = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of paths. + */ + int getPathsCount(); + /** + * + * + *
+   * Optional. List of paths served by this API.
+   * 
+ * + * repeated string paths = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The paths at the given index. + */ + java.lang.String getPaths(int index); + /** + * + * + *
+   * Optional. List of paths served by this API.
+   * 
+ * + * repeated string paths = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the paths at the given index. + */ + com.google.protobuf.ByteString getPathsBytes(int index); + + /** + * + * + *
+   * Optional. Documentation of the external API.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the documentation field is set. + */ + boolean hasDocumentation(); + /** + * + * + *
+   * Optional. Documentation of the external API.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The documentation. + */ + com.google.cloud.apihub.v1.Documentation getDocumentation(); + /** + * + * + *
+   * Optional. Documentation of the external API.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.DocumentationOrBuilder getDocumentationOrBuilder(); + + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the Version
+   * resource. The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getAttributesCount(); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the Version
+   * resource. The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsAttributes(java.lang.String key); + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAttributes(); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the Version
+   * resource. The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getAttributesMap(); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the Version
+   * resource. The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues defaultValue); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the Version
+   * resource. The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.AttributeValues getAttributesOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. Creation timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Creation timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Creation timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Last update timestamp.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Last update timestamp.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Last update timestamp.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetApiHubInstanceRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetApiHubInstanceRequest.java new file mode 100644 index 000000000000..39ad3a5e1de1 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetApiHubInstanceRequest.java @@ -0,0 +1,657 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/provisioning_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The
+ * [GetApiHubInstance][google.cloud.apihub.v1.Provisioning.GetApiHubInstance]
+ * method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetApiHubInstanceRequest} + */ +public final class GetApiHubInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.GetApiHubInstanceRequest) + GetApiHubInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetApiHubInstanceRequest.newBuilder() to construct. + private GetApiHubInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetApiHubInstanceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetApiHubInstanceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ProvisioningServiceProto + .internal_static_google_cloud_apihub_v1_GetApiHubInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ProvisioningServiceProto + .internal_static_google_cloud_apihub_v1_GetApiHubInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetApiHubInstanceRequest.class, + com.google.cloud.apihub.v1.GetApiHubInstanceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the Api Hub instance to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`.
+   * 
+ * + * + * 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 Api Hub instance to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`.
+   * 
+ * + * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.apihub.v1.GetApiHubInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.GetApiHubInstanceRequest other = + (com.google.cloud.apihub.v1.GetApiHubInstanceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.GetApiHubInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetApiHubInstanceRequest 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.apihub.v1.GetApiHubInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetApiHubInstanceRequest 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.apihub.v1.GetApiHubInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetApiHubInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.GetApiHubInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetApiHubInstanceRequest 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.apihub.v1.GetApiHubInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetApiHubInstanceRequest 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.apihub.v1.GetApiHubInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetApiHubInstanceRequest 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.apihub.v1.GetApiHubInstanceRequest 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
+   * [GetApiHubInstance][google.cloud.apihub.v1.Provisioning.GetApiHubInstance]
+   * method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetApiHubInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.GetApiHubInstanceRequest) + com.google.cloud.apihub.v1.GetApiHubInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ProvisioningServiceProto + .internal_static_google_cloud_apihub_v1_GetApiHubInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ProvisioningServiceProto + .internal_static_google_cloud_apihub_v1_GetApiHubInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetApiHubInstanceRequest.class, + com.google.cloud.apihub.v1.GetApiHubInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.GetApiHubInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ProvisioningServiceProto + .internal_static_google_cloud_apihub_v1_GetApiHubInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetApiHubInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.GetApiHubInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetApiHubInstanceRequest build() { + com.google.cloud.apihub.v1.GetApiHubInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetApiHubInstanceRequest buildPartial() { + com.google.cloud.apihub.v1.GetApiHubInstanceRequest result = + new com.google.cloud.apihub.v1.GetApiHubInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.GetApiHubInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.apihub.v1.GetApiHubInstanceRequest) { + return mergeFrom((com.google.cloud.apihub.v1.GetApiHubInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.GetApiHubInstanceRequest other) { + if (other == com.google.cloud.apihub.v1.GetApiHubInstanceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the Api Hub instance to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`.
+     * 
+ * + * + * 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 Api Hub instance to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`.
+     * 
+ * + * + * 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 Api Hub instance to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Api Hub instance to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Api Hub instance to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.apihub.v1.GetApiHubInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.GetApiHubInstanceRequest) + private static final com.google.cloud.apihub.v1.GetApiHubInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.GetApiHubInstanceRequest(); + } + + public static com.google.cloud.apihub.v1.GetApiHubInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetApiHubInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.GetApiHubInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetApiHubInstanceRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetApiHubInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..4cf385406d11 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetApiHubInstanceRequestOrBuilder.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/provisioning_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface GetApiHubInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.GetApiHubInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Api Hub instance to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the Api Hub instance to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`.
+   * 
+ * + * + * 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-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetApiOperationRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetApiOperationRequest.java new file mode 100644 index 000000000000..74fab96a7c33 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetApiOperationRequest.java @@ -0,0 +1,655 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [GetApiOperation][google.cloud.apihub.v1.ApiHub.GetApiOperation] method's
+ * request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetApiOperationRequest} + */ +public final class GetApiOperationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.GetApiOperationRequest) + GetApiOperationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetApiOperationRequest.newBuilder() to construct. + private GetApiOperationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetApiOperationRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetApiOperationRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetApiOperationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetApiOperationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetApiOperationRequest.class, + com.google.cloud.apihub.v1.GetApiOperationRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the operation to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+   * 
+ * + * + * 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 operation to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+   * 
+ * + * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.apihub.v1.GetApiOperationRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.GetApiOperationRequest other = + (com.google.cloud.apihub.v1.GetApiOperationRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.GetApiOperationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetApiOperationRequest 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.apihub.v1.GetApiOperationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetApiOperationRequest 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.apihub.v1.GetApiOperationRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetApiOperationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.GetApiOperationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetApiOperationRequest 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.apihub.v1.GetApiOperationRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetApiOperationRequest 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.apihub.v1.GetApiOperationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetApiOperationRequest 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.apihub.v1.GetApiOperationRequest 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 [GetApiOperation][google.cloud.apihub.v1.ApiHub.GetApiOperation] method's
+   * request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetApiOperationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.GetApiOperationRequest) + com.google.cloud.apihub.v1.GetApiOperationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetApiOperationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetApiOperationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetApiOperationRequest.class, + com.google.cloud.apihub.v1.GetApiOperationRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.GetApiOperationRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetApiOperationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetApiOperationRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.GetApiOperationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetApiOperationRequest build() { + com.google.cloud.apihub.v1.GetApiOperationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetApiOperationRequest buildPartial() { + com.google.cloud.apihub.v1.GetApiOperationRequest result = + new com.google.cloud.apihub.v1.GetApiOperationRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.GetApiOperationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.apihub.v1.GetApiOperationRequest) { + return mergeFrom((com.google.cloud.apihub.v1.GetApiOperationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.GetApiOperationRequest other) { + if (other == com.google.cloud.apihub.v1.GetApiOperationRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the operation to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+     * 
+ * + * + * 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 operation to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+     * 
+ * + * + * 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 operation to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the operation to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the operation to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.apihub.v1.GetApiOperationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.GetApiOperationRequest) + private static final com.google.cloud.apihub.v1.GetApiOperationRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.GetApiOperationRequest(); + } + + public static com.google.cloud.apihub.v1.GetApiOperationRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetApiOperationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.GetApiOperationRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetApiOperationRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetApiOperationRequestOrBuilder.java new file mode 100644 index 000000000000..7eed414d73bc --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetApiOperationRequestOrBuilder.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface GetApiOperationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.GetApiOperationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the operation to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the operation to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+   * 
+ * + * + * 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-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetApiRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetApiRequest.java new file mode 100644 index 000000000000..be10865b2658 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetApiRequest.java @@ -0,0 +1,644 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [GetApi][google.cloud.apihub.v1.ApiHub.GetApi] method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetApiRequest} + */ +public final class GetApiRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.GetApiRequest) + GetApiRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetApiRequest.newBuilder() to construct. + private GetApiRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetApiRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetApiRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetApiRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetApiRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetApiRequest.class, + com.google.cloud.apihub.v1.GetApiRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the API resource to retrieve.
+   * Format: `projects/{project}/locations/{location}/apis/{api}`
+   * 
+ * + * + * 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 API resource to retrieve.
+   * Format: `projects/{project}/locations/{location}/apis/{api}`
+   * 
+ * + * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.apihub.v1.GetApiRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.GetApiRequest other = (com.google.cloud.apihub.v1.GetApiRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.GetApiRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetApiRequest 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.apihub.v1.GetApiRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetApiRequest 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.apihub.v1.GetApiRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetApiRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.GetApiRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetApiRequest 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.apihub.v1.GetApiRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetApiRequest 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.apihub.v1.GetApiRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetApiRequest 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.apihub.v1.GetApiRequest 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 [GetApi][google.cloud.apihub.v1.ApiHub.GetApi] method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetApiRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.GetApiRequest) + com.google.cloud.apihub.v1.GetApiRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetApiRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetApiRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetApiRequest.class, + com.google.cloud.apihub.v1.GetApiRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.GetApiRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetApiRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetApiRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.GetApiRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetApiRequest build() { + com.google.cloud.apihub.v1.GetApiRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetApiRequest buildPartial() { + com.google.cloud.apihub.v1.GetApiRequest result = + new com.google.cloud.apihub.v1.GetApiRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.GetApiRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.apihub.v1.GetApiRequest) { + return mergeFrom((com.google.cloud.apihub.v1.GetApiRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.GetApiRequest other) { + if (other == com.google.cloud.apihub.v1.GetApiRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the API resource to retrieve.
+     * Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * + * 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 API resource to retrieve.
+     * Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * + * 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 API resource to retrieve.
+     * Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the API resource to retrieve.
+     * Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the API resource to retrieve.
+     * Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.apihub.v1.GetApiRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.GetApiRequest) + private static final com.google.cloud.apihub.v1.GetApiRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.GetApiRequest(); + } + + public static com.google.cloud.apihub.v1.GetApiRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetApiRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.GetApiRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetApiRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetApiRequestOrBuilder.java new file mode 100644 index 000000000000..42cbcac4ada2 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetApiRequestOrBuilder.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface GetApiRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.GetApiRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the API resource to retrieve.
+   * Format: `projects/{project}/locations/{location}/apis/{api}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the API resource to retrieve.
+   * Format: `projects/{project}/locations/{location}/apis/{api}`
+   * 
+ * + * + * 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-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetAttributeRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetAttributeRequest.java new file mode 100644 index 000000000000..69d8dbe4f39f --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetAttributeRequest.java @@ -0,0 +1,654 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [GetAttribute][google.cloud.apihub.v1.ApiHub.GetAttribute] method's
+ * request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetAttributeRequest} + */ +public final class GetAttributeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.GetAttributeRequest) + GetAttributeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetAttributeRequest.newBuilder() to construct. + private GetAttributeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetAttributeRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetAttributeRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetAttributeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetAttributeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetAttributeRequest.class, + com.google.cloud.apihub.v1.GetAttributeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the attribute to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`
+   * 
+ * + * + * 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 attribute to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`
+   * 
+ * + * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.apihub.v1.GetAttributeRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.GetAttributeRequest other = + (com.google.cloud.apihub.v1.GetAttributeRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.GetAttributeRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetAttributeRequest 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.apihub.v1.GetAttributeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetAttributeRequest 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.apihub.v1.GetAttributeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetAttributeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.GetAttributeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetAttributeRequest 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.apihub.v1.GetAttributeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetAttributeRequest 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.apihub.v1.GetAttributeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetAttributeRequest 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.apihub.v1.GetAttributeRequest 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 [GetAttribute][google.cloud.apihub.v1.ApiHub.GetAttribute] method's
+   * request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetAttributeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.GetAttributeRequest) + com.google.cloud.apihub.v1.GetAttributeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetAttributeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetAttributeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetAttributeRequest.class, + com.google.cloud.apihub.v1.GetAttributeRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.GetAttributeRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetAttributeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetAttributeRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.GetAttributeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetAttributeRequest build() { + com.google.cloud.apihub.v1.GetAttributeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetAttributeRequest buildPartial() { + com.google.cloud.apihub.v1.GetAttributeRequest result = + new com.google.cloud.apihub.v1.GetAttributeRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.GetAttributeRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.apihub.v1.GetAttributeRequest) { + return mergeFrom((com.google.cloud.apihub.v1.GetAttributeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.GetAttributeRequest other) { + if (other == com.google.cloud.apihub.v1.GetAttributeRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the attribute to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`
+     * 
+ * + * + * 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 attribute to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`
+     * 
+ * + * + * 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 attribute to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the attribute to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the attribute to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.apihub.v1.GetAttributeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.GetAttributeRequest) + private static final com.google.cloud.apihub.v1.GetAttributeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.GetAttributeRequest(); + } + + public static com.google.cloud.apihub.v1.GetAttributeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetAttributeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.GetAttributeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetAttributeRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetAttributeRequestOrBuilder.java new file mode 100644 index 000000000000..41c9da2019a4 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetAttributeRequestOrBuilder.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface GetAttributeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.GetAttributeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the attribute to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the attribute to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`
+   * 
+ * + * + * 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-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetDefinitionRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetDefinitionRequest.java new file mode 100644 index 000000000000..8886dd85067c --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetDefinitionRequest.java @@ -0,0 +1,655 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [GetDefinition][google.cloud.apihub.v1.ApiHub.GetDefinition] method's
+ * request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetDefinitionRequest} + */ +public final class GetDefinitionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.GetDefinitionRequest) + GetDefinitionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetDefinitionRequest.newBuilder() to construct. + private GetDefinitionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetDefinitionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetDefinitionRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetDefinitionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetDefinitionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetDefinitionRequest.class, + com.google.cloud.apihub.v1.GetDefinitionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the definition to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+   * 
+ * + * + * 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 definition to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+   * 
+ * + * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.apihub.v1.GetDefinitionRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.GetDefinitionRequest other = + (com.google.cloud.apihub.v1.GetDefinitionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.GetDefinitionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetDefinitionRequest 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.apihub.v1.GetDefinitionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetDefinitionRequest 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.apihub.v1.GetDefinitionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetDefinitionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.GetDefinitionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetDefinitionRequest 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.apihub.v1.GetDefinitionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetDefinitionRequest 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.apihub.v1.GetDefinitionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetDefinitionRequest 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.apihub.v1.GetDefinitionRequest 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 [GetDefinition][google.cloud.apihub.v1.ApiHub.GetDefinition] method's
+   * request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetDefinitionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.GetDefinitionRequest) + com.google.cloud.apihub.v1.GetDefinitionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetDefinitionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetDefinitionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetDefinitionRequest.class, + com.google.cloud.apihub.v1.GetDefinitionRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.GetDefinitionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetDefinitionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetDefinitionRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.GetDefinitionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetDefinitionRequest build() { + com.google.cloud.apihub.v1.GetDefinitionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetDefinitionRequest buildPartial() { + com.google.cloud.apihub.v1.GetDefinitionRequest result = + new com.google.cloud.apihub.v1.GetDefinitionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.GetDefinitionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.apihub.v1.GetDefinitionRequest) { + return mergeFrom((com.google.cloud.apihub.v1.GetDefinitionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.GetDefinitionRequest other) { + if (other == com.google.cloud.apihub.v1.GetDefinitionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the definition to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+     * 
+ * + * + * 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 definition to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+     * 
+ * + * + * 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 definition to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the definition to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the definition to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.apihub.v1.GetDefinitionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.GetDefinitionRequest) + private static final com.google.cloud.apihub.v1.GetDefinitionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.GetDefinitionRequest(); + } + + public static com.google.cloud.apihub.v1.GetDefinitionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetDefinitionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.GetDefinitionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetDefinitionRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetDefinitionRequestOrBuilder.java new file mode 100644 index 000000000000..d7abf63eee0c --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetDefinitionRequestOrBuilder.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface GetDefinitionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.GetDefinitionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the definition to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the definition to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+   * 
+ * + * + * 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-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetDependencyRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetDependencyRequest.java new file mode 100644 index 000000000000..9b84121faa68 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetDependencyRequest.java @@ -0,0 +1,648 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [GetDependency][.ApiHubDependencies.GetDependency]
+ * method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetDependencyRequest} + */ +public final class GetDependencyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.GetDependencyRequest) + GetDependencyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetDependencyRequest.newBuilder() to construct. + private GetDependencyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetDependencyRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetDependencyRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetDependencyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetDependencyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetDependencyRequest.class, + com.google.cloud.apihub.v1.GetDependencyRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the dependency resource to retrieve.
+   * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+   * 
+ * + * + * 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 dependency resource to retrieve.
+   * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+   * 
+ * + * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.apihub.v1.GetDependencyRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.GetDependencyRequest other = + (com.google.cloud.apihub.v1.GetDependencyRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.GetDependencyRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetDependencyRequest 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.apihub.v1.GetDependencyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetDependencyRequest 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.apihub.v1.GetDependencyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetDependencyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.GetDependencyRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetDependencyRequest 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.apihub.v1.GetDependencyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetDependencyRequest 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.apihub.v1.GetDependencyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetDependencyRequest 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.apihub.v1.GetDependencyRequest 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 [GetDependency][.ApiHubDependencies.GetDependency]
+   * method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetDependencyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.GetDependencyRequest) + com.google.cloud.apihub.v1.GetDependencyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetDependencyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetDependencyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetDependencyRequest.class, + com.google.cloud.apihub.v1.GetDependencyRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.GetDependencyRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetDependencyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetDependencyRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.GetDependencyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetDependencyRequest build() { + com.google.cloud.apihub.v1.GetDependencyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetDependencyRequest buildPartial() { + com.google.cloud.apihub.v1.GetDependencyRequest result = + new com.google.cloud.apihub.v1.GetDependencyRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.GetDependencyRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.apihub.v1.GetDependencyRequest) { + return mergeFrom((com.google.cloud.apihub.v1.GetDependencyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.GetDependencyRequest other) { + if (other == com.google.cloud.apihub.v1.GetDependencyRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the dependency resource to retrieve.
+     * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+     * 
+ * + * + * 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 dependency resource to retrieve.
+     * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+     * 
+ * + * + * 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 dependency resource to retrieve.
+     * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the dependency resource to retrieve.
+     * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the dependency resource to retrieve.
+     * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.apihub.v1.GetDependencyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.GetDependencyRequest) + private static final com.google.cloud.apihub.v1.GetDependencyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.GetDependencyRequest(); + } + + public static com.google.cloud.apihub.v1.GetDependencyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetDependencyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.GetDependencyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetDependencyRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetDependencyRequestOrBuilder.java new file mode 100644 index 000000000000..ada0b10446eb --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetDependencyRequestOrBuilder.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface GetDependencyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.GetDependencyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the dependency resource to retrieve.
+   * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the dependency resource to retrieve.
+   * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+   * 
+ * + * + * 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-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetDeploymentRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetDeploymentRequest.java new file mode 100644 index 000000000000..2474c7ac7d1c --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetDeploymentRequest.java @@ -0,0 +1,648 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [GetDeployment][google.cloud.apihub.v1.ApiHub.GetDeployment] method's
+ * request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetDeploymentRequest} + */ +public final class GetDeploymentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.GetDeploymentRequest) + GetDeploymentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetDeploymentRequest.newBuilder() to construct. + private GetDeploymentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetDeploymentRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetDeploymentRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetDeploymentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetDeploymentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetDeploymentRequest.class, + com.google.cloud.apihub.v1.GetDeploymentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the deployment resource to retrieve.
+   * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * + * 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 deployment resource to retrieve.
+   * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.apihub.v1.GetDeploymentRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.GetDeploymentRequest other = + (com.google.cloud.apihub.v1.GetDeploymentRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.GetDeploymentRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetDeploymentRequest 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.apihub.v1.GetDeploymentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetDeploymentRequest 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.apihub.v1.GetDeploymentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetDeploymentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.GetDeploymentRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetDeploymentRequest 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.apihub.v1.GetDeploymentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetDeploymentRequest 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.apihub.v1.GetDeploymentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetDeploymentRequest 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.apihub.v1.GetDeploymentRequest 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 [GetDeployment][google.cloud.apihub.v1.ApiHub.GetDeployment] method's
+   * request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetDeploymentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.GetDeploymentRequest) + com.google.cloud.apihub.v1.GetDeploymentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetDeploymentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetDeploymentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetDeploymentRequest.class, + com.google.cloud.apihub.v1.GetDeploymentRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.GetDeploymentRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetDeploymentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetDeploymentRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.GetDeploymentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetDeploymentRequest build() { + com.google.cloud.apihub.v1.GetDeploymentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetDeploymentRequest buildPartial() { + com.google.cloud.apihub.v1.GetDeploymentRequest result = + new com.google.cloud.apihub.v1.GetDeploymentRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.GetDeploymentRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.apihub.v1.GetDeploymentRequest) { + return mergeFrom((com.google.cloud.apihub.v1.GetDeploymentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.GetDeploymentRequest other) { + if (other == com.google.cloud.apihub.v1.GetDeploymentRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the deployment resource to retrieve.
+     * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * 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 deployment resource to retrieve.
+     * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * 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 deployment resource to retrieve.
+     * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the deployment resource to retrieve.
+     * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the deployment resource to retrieve.
+     * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.apihub.v1.GetDeploymentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.GetDeploymentRequest) + private static final com.google.cloud.apihub.v1.GetDeploymentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.GetDeploymentRequest(); + } + + public static com.google.cloud.apihub.v1.GetDeploymentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetDeploymentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.GetDeploymentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetDeploymentRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetDeploymentRequestOrBuilder.java new file mode 100644 index 000000000000..e17b0f02aa9e --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetDeploymentRequestOrBuilder.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface GetDeploymentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.GetDeploymentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the deployment resource to retrieve.
+   * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the deployment resource to retrieve.
+   * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * + * 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-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetExternalApiRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetExternalApiRequest.java new file mode 100644 index 000000000000..ad43954a39dd --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetExternalApiRequest.java @@ -0,0 +1,655 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [GetExternalApi][google.cloud.apihub.v1.ApiHub.GetExternalApi] method's
+ * request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetExternalApiRequest} + */ +public final class GetExternalApiRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.GetExternalApiRequest) + GetExternalApiRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetExternalApiRequest.newBuilder() to construct. + private GetExternalApiRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetExternalApiRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetExternalApiRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetExternalApiRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetExternalApiRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetExternalApiRequest.class, + com.google.cloud.apihub.v1.GetExternalApiRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the External API resource to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+   * 
+ * + * + * 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 External API resource to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+   * 
+ * + * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.apihub.v1.GetExternalApiRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.GetExternalApiRequest other = + (com.google.cloud.apihub.v1.GetExternalApiRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.GetExternalApiRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetExternalApiRequest 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.apihub.v1.GetExternalApiRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetExternalApiRequest 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.apihub.v1.GetExternalApiRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetExternalApiRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.GetExternalApiRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetExternalApiRequest 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.apihub.v1.GetExternalApiRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetExternalApiRequest 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.apihub.v1.GetExternalApiRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetExternalApiRequest 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.apihub.v1.GetExternalApiRequest 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 [GetExternalApi][google.cloud.apihub.v1.ApiHub.GetExternalApi] method's
+   * request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetExternalApiRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.GetExternalApiRequest) + com.google.cloud.apihub.v1.GetExternalApiRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetExternalApiRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetExternalApiRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetExternalApiRequest.class, + com.google.cloud.apihub.v1.GetExternalApiRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.GetExternalApiRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetExternalApiRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetExternalApiRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.GetExternalApiRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetExternalApiRequest build() { + com.google.cloud.apihub.v1.GetExternalApiRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetExternalApiRequest buildPartial() { + com.google.cloud.apihub.v1.GetExternalApiRequest result = + new com.google.cloud.apihub.v1.GetExternalApiRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.GetExternalApiRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.apihub.v1.GetExternalApiRequest) { + return mergeFrom((com.google.cloud.apihub.v1.GetExternalApiRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.GetExternalApiRequest other) { + if (other == com.google.cloud.apihub.v1.GetExternalApiRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the External API resource to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+     * 
+ * + * + * 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 External API resource to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+     * 
+ * + * + * 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 External API resource to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the External API resource to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the External API resource to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.apihub.v1.GetExternalApiRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.GetExternalApiRequest) + private static final com.google.cloud.apihub.v1.GetExternalApiRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.GetExternalApiRequest(); + } + + public static com.google.cloud.apihub.v1.GetExternalApiRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetExternalApiRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.GetExternalApiRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetExternalApiRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetExternalApiRequestOrBuilder.java new file mode 100644 index 000000000000..99bdaf2a2a43 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetExternalApiRequestOrBuilder.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface GetExternalApiRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.GetExternalApiRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the External API resource to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the External API resource to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+   * 
+ * + * + * 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-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetHostProjectRegistrationRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetHostProjectRegistrationRequest.java new file mode 100644 index 000000000000..84d9b8fe2ae3 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetHostProjectRegistrationRequest.java @@ -0,0 +1,656 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/host_project_registration_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The
+ * [GetHostProjectRegistration][google.cloud.apihub.v1.HostProjectRegistrationService.GetHostProjectRegistration]
+ * method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetHostProjectRegistrationRequest} + */ +public final class GetHostProjectRegistrationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.GetHostProjectRegistrationRequest) + GetHostProjectRegistrationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetHostProjectRegistrationRequest.newBuilder() to construct. + private GetHostProjectRegistrationRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetHostProjectRegistrationRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetHostProjectRegistrationRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.HostProjectRegistrationServiceProto + .internal_static_google_cloud_apihub_v1_GetHostProjectRegistrationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.HostProjectRegistrationServiceProto + .internal_static_google_cloud_apihub_v1_GetHostProjectRegistrationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest.class, + com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Host project registration resource name.
+   * projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_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. Host project registration resource name.
+   * projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.apihub.v1.GetHostProjectRegistrationRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest other = + (com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest 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.apihub.v1.GetHostProjectRegistrationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest 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.apihub.v1.GetHostProjectRegistrationRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest 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.apihub.v1.GetHostProjectRegistrationRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest 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.apihub.v1.GetHostProjectRegistrationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest 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.apihub.v1.GetHostProjectRegistrationRequest 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
+   * [GetHostProjectRegistration][google.cloud.apihub.v1.HostProjectRegistrationService.GetHostProjectRegistration]
+   * method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetHostProjectRegistrationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.GetHostProjectRegistrationRequest) + com.google.cloud.apihub.v1.GetHostProjectRegistrationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.HostProjectRegistrationServiceProto + .internal_static_google_cloud_apihub_v1_GetHostProjectRegistrationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.HostProjectRegistrationServiceProto + .internal_static_google_cloud_apihub_v1_GetHostProjectRegistrationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest.class, + com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.HostProjectRegistrationServiceProto + .internal_static_google_cloud_apihub_v1_GetHostProjectRegistrationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest + getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest build() { + com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest buildPartial() { + com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest result = + new com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.apihub.v1.GetHostProjectRegistrationRequest) { + return mergeFrom((com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest other) { + if (other + == com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Host project registration resource name.
+     * projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_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. Host project registration resource name.
+     * projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_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. Host project registration resource name.
+     * projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Host project registration resource name.
+     * projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Host project registration resource name.
+     * projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_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; + bitField0_ |= 0x00000001; + 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.apihub.v1.GetHostProjectRegistrationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.GetHostProjectRegistrationRequest) + private static final com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest(); + } + + public static com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetHostProjectRegistrationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.GetHostProjectRegistrationRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetHostProjectRegistrationRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetHostProjectRegistrationRequestOrBuilder.java new file mode 100644 index 000000000000..22f940a52968 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetHostProjectRegistrationRequestOrBuilder.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/host_project_registration_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface GetHostProjectRegistrationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.GetHostProjectRegistrationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Host project registration resource name.
+   * projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Host project registration resource name.
+   * projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_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-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetPluginRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetPluginRequest.java new file mode 100644 index 000000000000..6c2bf35b2de1 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetPluginRequest.java @@ -0,0 +1,647 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/plugin_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [GetPlugin][google.cloud.apihub.v1.ApiHubPlugin.GetPlugin] method's
+ * request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetPluginRequest} + */ +public final class GetPluginRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.GetPluginRequest) + GetPluginRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetPluginRequest.newBuilder() to construct. + private GetPluginRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetPluginRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetPluginRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.PluginServiceProto + .internal_static_google_cloud_apihub_v1_GetPluginRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.PluginServiceProto + .internal_static_google_cloud_apihub_v1_GetPluginRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetPluginRequest.class, + com.google.cloud.apihub.v1.GetPluginRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the plugin to retrieve.
+   * Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
+   * 
+ * + * + * 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 plugin to retrieve.
+   * Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
+   * 
+ * + * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.apihub.v1.GetPluginRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.GetPluginRequest other = + (com.google.cloud.apihub.v1.GetPluginRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.GetPluginRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetPluginRequest 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.apihub.v1.GetPluginRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetPluginRequest 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.apihub.v1.GetPluginRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetPluginRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.GetPluginRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetPluginRequest 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.apihub.v1.GetPluginRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetPluginRequest 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.apihub.v1.GetPluginRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetPluginRequest 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.apihub.v1.GetPluginRequest 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 [GetPlugin][google.cloud.apihub.v1.ApiHubPlugin.GetPlugin] method's
+   * request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetPluginRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.GetPluginRequest) + com.google.cloud.apihub.v1.GetPluginRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.PluginServiceProto + .internal_static_google_cloud_apihub_v1_GetPluginRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.PluginServiceProto + .internal_static_google_cloud_apihub_v1_GetPluginRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetPluginRequest.class, + com.google.cloud.apihub.v1.GetPluginRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.GetPluginRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.PluginServiceProto + .internal_static_google_cloud_apihub_v1_GetPluginRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetPluginRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.GetPluginRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetPluginRequest build() { + com.google.cloud.apihub.v1.GetPluginRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetPluginRequest buildPartial() { + com.google.cloud.apihub.v1.GetPluginRequest result = + new com.google.cloud.apihub.v1.GetPluginRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.GetPluginRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.apihub.v1.GetPluginRequest) { + return mergeFrom((com.google.cloud.apihub.v1.GetPluginRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.GetPluginRequest other) { + if (other == com.google.cloud.apihub.v1.GetPluginRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the plugin to retrieve.
+     * Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
+     * 
+ * + * + * 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 plugin to retrieve.
+     * Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
+     * 
+ * + * + * 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 plugin to retrieve.
+     * Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the plugin to retrieve.
+     * Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the plugin to retrieve.
+     * Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.apihub.v1.GetPluginRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.GetPluginRequest) + private static final com.google.cloud.apihub.v1.GetPluginRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.GetPluginRequest(); + } + + public static com.google.cloud.apihub.v1.GetPluginRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetPluginRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.GetPluginRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetPluginRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetPluginRequestOrBuilder.java new file mode 100644 index 000000000000..da2b60f0ebce --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetPluginRequestOrBuilder.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/plugin_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface GetPluginRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.GetPluginRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the plugin to retrieve.
+   * Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the plugin to retrieve.
+   * Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
+   * 
+ * + * + * 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-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetRuntimeProjectAttachmentRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetRuntimeProjectAttachmentRequest.java new file mode 100644 index 000000000000..922359997939 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetRuntimeProjectAttachmentRequest.java @@ -0,0 +1,663 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/runtime_project_attachment_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The
+ * [GetRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.GetRuntimeProjectAttachment]
+ * method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest} + */ +public final class GetRuntimeProjectAttachmentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest) + GetRuntimeProjectAttachmentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetRuntimeProjectAttachmentRequest.newBuilder() to construct. + private GetRuntimeProjectAttachmentRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetRuntimeProjectAttachmentRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetRuntimeProjectAttachmentRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_GetRuntimeProjectAttachmentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_GetRuntimeProjectAttachmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest.class, + com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the API resource to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
+   * 
+ * + * + * 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 API resource to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
+   * 
+ * + * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.apihub.v1.GetRuntimeProjectAttachmentRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest other = + (com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest 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.apihub.v1.GetRuntimeProjectAttachmentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest 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.apihub.v1.GetRuntimeProjectAttachmentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest 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.apihub.v1.GetRuntimeProjectAttachmentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest 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.apihub.v1.GetRuntimeProjectAttachmentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest 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.apihub.v1.GetRuntimeProjectAttachmentRequest 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
+   * [GetRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.GetRuntimeProjectAttachment]
+   * method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest) + com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_GetRuntimeProjectAttachmentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_GetRuntimeProjectAttachmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest.class, + com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_GetRuntimeProjectAttachmentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest + getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest build() { + com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest buildPartial() { + com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest result = + new com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.apihub.v1.GetRuntimeProjectAttachmentRequest) { + return mergeFrom((com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest other) { + if (other + == com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the API resource to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
+     * 
+ * + * + * 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 API resource to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
+     * 
+ * + * + * 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 API resource to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the API resource to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the API resource to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.apihub.v1.GetRuntimeProjectAttachmentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest) + private static final com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest(); + } + + public static com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetRuntimeProjectAttachmentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.GetRuntimeProjectAttachmentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetRuntimeProjectAttachmentRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetRuntimeProjectAttachmentRequestOrBuilder.java new file mode 100644 index 000000000000..c992a96d96e7 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetRuntimeProjectAttachmentRequestOrBuilder.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/runtime_project_attachment_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface GetRuntimeProjectAttachmentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the API resource to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the API resource to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
+   * 
+ * + * + * 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-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetSpecContentsRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetSpecContentsRequest.java new file mode 100644 index 000000000000..a651ce26c8c8 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetSpecContentsRequest.java @@ -0,0 +1,655 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method's
+ * request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetSpecContentsRequest} + */ +public final class GetSpecContentsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.GetSpecContentsRequest) + GetSpecContentsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetSpecContentsRequest.newBuilder() to construct. + private GetSpecContentsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetSpecContentsRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetSpecContentsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetSpecContentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetSpecContentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetSpecContentsRequest.class, + com.google.cloud.apihub.v1.GetSpecContentsRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the spec whose contents need to be retrieved.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * 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 spec whose contents need to be retrieved.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.apihub.v1.GetSpecContentsRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.GetSpecContentsRequest other = + (com.google.cloud.apihub.v1.GetSpecContentsRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.GetSpecContentsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetSpecContentsRequest 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.apihub.v1.GetSpecContentsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetSpecContentsRequest 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.apihub.v1.GetSpecContentsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetSpecContentsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.GetSpecContentsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetSpecContentsRequest 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.apihub.v1.GetSpecContentsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetSpecContentsRequest 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.apihub.v1.GetSpecContentsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetSpecContentsRequest 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.apihub.v1.GetSpecContentsRequest 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 [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method's
+   * request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetSpecContentsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.GetSpecContentsRequest) + com.google.cloud.apihub.v1.GetSpecContentsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetSpecContentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetSpecContentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetSpecContentsRequest.class, + com.google.cloud.apihub.v1.GetSpecContentsRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.GetSpecContentsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetSpecContentsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetSpecContentsRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.GetSpecContentsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetSpecContentsRequest build() { + com.google.cloud.apihub.v1.GetSpecContentsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetSpecContentsRequest buildPartial() { + com.google.cloud.apihub.v1.GetSpecContentsRequest result = + new com.google.cloud.apihub.v1.GetSpecContentsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.GetSpecContentsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.apihub.v1.GetSpecContentsRequest) { + return mergeFrom((com.google.cloud.apihub.v1.GetSpecContentsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.GetSpecContentsRequest other) { + if (other == com.google.cloud.apihub.v1.GetSpecContentsRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the spec whose contents need to be retrieved.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * 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 spec whose contents need to be retrieved.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * 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 spec whose contents need to be retrieved.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the spec whose contents need to be retrieved.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the spec whose contents need to be retrieved.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.apihub.v1.GetSpecContentsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.GetSpecContentsRequest) + private static final com.google.cloud.apihub.v1.GetSpecContentsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.GetSpecContentsRequest(); + } + + public static com.google.cloud.apihub.v1.GetSpecContentsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetSpecContentsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.GetSpecContentsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetSpecContentsRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetSpecContentsRequestOrBuilder.java new file mode 100644 index 000000000000..8a1698c286fe --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetSpecContentsRequestOrBuilder.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface GetSpecContentsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.GetSpecContentsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the spec whose contents need to be retrieved.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the spec whose contents need to be retrieved.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * 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-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetSpecRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetSpecRequest.java new file mode 100644 index 000000000000..9d990c631c6c --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetSpecRequest.java @@ -0,0 +1,652 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetSpecRequest} + */ +public final class GetSpecRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.GetSpecRequest) + GetSpecRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetSpecRequest.newBuilder() to construct. + private GetSpecRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetSpecRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetSpecRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetSpecRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetSpecRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetSpecRequest.class, + com.google.cloud.apihub.v1.GetSpecRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the spec to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * 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 spec to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.apihub.v1.GetSpecRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.GetSpecRequest other = + (com.google.cloud.apihub.v1.GetSpecRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.GetSpecRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetSpecRequest 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.apihub.v1.GetSpecRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetSpecRequest 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.apihub.v1.GetSpecRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetSpecRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.GetSpecRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetSpecRequest 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.apihub.v1.GetSpecRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetSpecRequest 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.apihub.v1.GetSpecRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetSpecRequest 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.apihub.v1.GetSpecRequest 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 [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetSpecRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.GetSpecRequest) + com.google.cloud.apihub.v1.GetSpecRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetSpecRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetSpecRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetSpecRequest.class, + com.google.cloud.apihub.v1.GetSpecRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.GetSpecRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetSpecRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetSpecRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.GetSpecRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetSpecRequest build() { + com.google.cloud.apihub.v1.GetSpecRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetSpecRequest buildPartial() { + com.google.cloud.apihub.v1.GetSpecRequest result = + new com.google.cloud.apihub.v1.GetSpecRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.GetSpecRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.apihub.v1.GetSpecRequest) { + return mergeFrom((com.google.cloud.apihub.v1.GetSpecRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.GetSpecRequest other) { + if (other == com.google.cloud.apihub.v1.GetSpecRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the spec to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * 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 spec to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * 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 spec to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the spec to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the spec to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.apihub.v1.GetSpecRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.GetSpecRequest) + private static final com.google.cloud.apihub.v1.GetSpecRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.GetSpecRequest(); + } + + public static com.google.cloud.apihub.v1.GetSpecRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetSpecRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.GetSpecRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetSpecRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetSpecRequestOrBuilder.java new file mode 100644 index 000000000000..3e5685b82be0 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetSpecRequestOrBuilder.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface GetSpecRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.GetSpecRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the spec to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the spec to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * 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-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetStyleGuideContentsRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetStyleGuideContentsRequest.java new file mode 100644 index 000000000000..cbd8e517de0d --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetStyleGuideContentsRequest.java @@ -0,0 +1,661 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/linting_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [GetStyleGuideContents][ApiHub.GetStyleGuideContents] method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetStyleGuideContentsRequest} + */ +public final class GetStyleGuideContentsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.GetStyleGuideContentsRequest) + GetStyleGuideContentsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetStyleGuideContentsRequest.newBuilder() to construct. + private GetStyleGuideContentsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetStyleGuideContentsRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetStyleGuideContentsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_GetStyleGuideContentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_GetStyleGuideContentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetStyleGuideContentsRequest.class, + com.google.cloud.apihub.v1.GetStyleGuideContentsRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the StyleGuide whose contents need to be retrieved.
+   * There is exactly one style guide resource per project per location.
+   * The expected format is
+   * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`.
+   * 
+ * + * + * 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 StyleGuide whose contents need to be retrieved.
+   * There is exactly one style guide resource per project per location.
+   * The expected format is
+   * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`.
+   * 
+ * + * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.apihub.v1.GetStyleGuideContentsRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.GetStyleGuideContentsRequest other = + (com.google.cloud.apihub.v1.GetStyleGuideContentsRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.GetStyleGuideContentsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetStyleGuideContentsRequest 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.apihub.v1.GetStyleGuideContentsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetStyleGuideContentsRequest 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.apihub.v1.GetStyleGuideContentsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetStyleGuideContentsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.GetStyleGuideContentsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetStyleGuideContentsRequest 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.apihub.v1.GetStyleGuideContentsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetStyleGuideContentsRequest 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.apihub.v1.GetStyleGuideContentsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetStyleGuideContentsRequest 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.apihub.v1.GetStyleGuideContentsRequest 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 [GetStyleGuideContents][ApiHub.GetStyleGuideContents] method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetStyleGuideContentsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.GetStyleGuideContentsRequest) + com.google.cloud.apihub.v1.GetStyleGuideContentsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_GetStyleGuideContentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_GetStyleGuideContentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetStyleGuideContentsRequest.class, + com.google.cloud.apihub.v1.GetStyleGuideContentsRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.GetStyleGuideContentsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_GetStyleGuideContentsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetStyleGuideContentsRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.GetStyleGuideContentsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetStyleGuideContentsRequest build() { + com.google.cloud.apihub.v1.GetStyleGuideContentsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetStyleGuideContentsRequest buildPartial() { + com.google.cloud.apihub.v1.GetStyleGuideContentsRequest result = + new com.google.cloud.apihub.v1.GetStyleGuideContentsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.GetStyleGuideContentsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.apihub.v1.GetStyleGuideContentsRequest) { + return mergeFrom((com.google.cloud.apihub.v1.GetStyleGuideContentsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.GetStyleGuideContentsRequest other) { + if (other == com.google.cloud.apihub.v1.GetStyleGuideContentsRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the StyleGuide whose contents need to be retrieved.
+     * There is exactly one style guide resource per project per location.
+     * The expected format is
+     * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`.
+     * 
+ * + * + * 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 StyleGuide whose contents need to be retrieved.
+     * There is exactly one style guide resource per project per location.
+     * The expected format is
+     * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`.
+     * 
+ * + * + * 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 StyleGuide whose contents need to be retrieved.
+     * There is exactly one style guide resource per project per location.
+     * The expected format is
+     * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the StyleGuide whose contents need to be retrieved.
+     * There is exactly one style guide resource per project per location.
+     * The expected format is
+     * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the StyleGuide whose contents need to be retrieved.
+     * There is exactly one style guide resource per project per location.
+     * The expected format is
+     * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.apihub.v1.GetStyleGuideContentsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.GetStyleGuideContentsRequest) + private static final com.google.cloud.apihub.v1.GetStyleGuideContentsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.GetStyleGuideContentsRequest(); + } + + public static com.google.cloud.apihub.v1.GetStyleGuideContentsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetStyleGuideContentsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.GetStyleGuideContentsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetStyleGuideContentsRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetStyleGuideContentsRequestOrBuilder.java new file mode 100644 index 000000000000..8dcabbacbbbb --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetStyleGuideContentsRequestOrBuilder.java @@ -0,0 +1,61 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/linting_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface GetStyleGuideContentsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.GetStyleGuideContentsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the StyleGuide whose contents need to be retrieved.
+   * There is exactly one style guide resource per project per location.
+   * The expected format is
+   * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the StyleGuide whose contents need to be retrieved.
+   * There is exactly one style guide resource per project per location.
+   * The expected format is
+   * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`.
+   * 
+ * + * + * 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-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetStyleGuideRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetStyleGuideRequest.java new file mode 100644 index 000000000000..2eb98c73592b --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetStyleGuideRequest.java @@ -0,0 +1,653 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/linting_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [GetStyleGuide][ApiHub.GetStyleGuide] method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetStyleGuideRequest} + */ +public final class GetStyleGuideRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.GetStyleGuideRequest) + GetStyleGuideRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetStyleGuideRequest.newBuilder() to construct. + private GetStyleGuideRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetStyleGuideRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetStyleGuideRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_GetStyleGuideRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_GetStyleGuideRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetStyleGuideRequest.class, + com.google.cloud.apihub.v1.GetStyleGuideRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the spec to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`.
+   * 
+ * + * + * 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 spec to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`.
+   * 
+ * + * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.apihub.v1.GetStyleGuideRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.GetStyleGuideRequest other = + (com.google.cloud.apihub.v1.GetStyleGuideRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.GetStyleGuideRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetStyleGuideRequest 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.apihub.v1.GetStyleGuideRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetStyleGuideRequest 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.apihub.v1.GetStyleGuideRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetStyleGuideRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.GetStyleGuideRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetStyleGuideRequest 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.apihub.v1.GetStyleGuideRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetStyleGuideRequest 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.apihub.v1.GetStyleGuideRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetStyleGuideRequest 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.apihub.v1.GetStyleGuideRequest 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 [GetStyleGuide][ApiHub.GetStyleGuide] method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetStyleGuideRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.GetStyleGuideRequest) + com.google.cloud.apihub.v1.GetStyleGuideRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_GetStyleGuideRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_GetStyleGuideRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetStyleGuideRequest.class, + com.google.cloud.apihub.v1.GetStyleGuideRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.GetStyleGuideRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_GetStyleGuideRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetStyleGuideRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.GetStyleGuideRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetStyleGuideRequest build() { + com.google.cloud.apihub.v1.GetStyleGuideRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetStyleGuideRequest buildPartial() { + com.google.cloud.apihub.v1.GetStyleGuideRequest result = + new com.google.cloud.apihub.v1.GetStyleGuideRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.GetStyleGuideRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.apihub.v1.GetStyleGuideRequest) { + return mergeFrom((com.google.cloud.apihub.v1.GetStyleGuideRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.GetStyleGuideRequest other) { + if (other == com.google.cloud.apihub.v1.GetStyleGuideRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the spec to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`.
+     * 
+ * + * + * 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 spec to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`.
+     * 
+ * + * + * 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 spec to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the spec to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the spec to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.apihub.v1.GetStyleGuideRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.GetStyleGuideRequest) + private static final com.google.cloud.apihub.v1.GetStyleGuideRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.GetStyleGuideRequest(); + } + + public static com.google.cloud.apihub.v1.GetStyleGuideRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetStyleGuideRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.GetStyleGuideRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetStyleGuideRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetStyleGuideRequestOrBuilder.java new file mode 100644 index 000000000000..13a827dac110 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetStyleGuideRequestOrBuilder.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/linting_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface GetStyleGuideRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.GetStyleGuideRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the spec to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the spec to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`.
+   * 
+ * + * + * 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-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetVersionRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetVersionRequest.java new file mode 100644 index 000000000000..1e5957112255 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetVersionRequest.java @@ -0,0 +1,652 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [GetVersion][google.cloud.apihub.v1.ApiHub.GetVersion] method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetVersionRequest} + */ +public final class GetVersionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.GetVersionRequest) + GetVersionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetVersionRequest.newBuilder() to construct. + private GetVersionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetVersionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetVersionRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetVersionRequest.class, + com.google.cloud.apihub.v1.GetVersionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the API version to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * 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 API version to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.apihub.v1.GetVersionRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.GetVersionRequest other = + (com.google.cloud.apihub.v1.GetVersionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.GetVersionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetVersionRequest 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.apihub.v1.GetVersionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetVersionRequest 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.apihub.v1.GetVersionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.GetVersionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.GetVersionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetVersionRequest 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.apihub.v1.GetVersionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetVersionRequest 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.apihub.v1.GetVersionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.GetVersionRequest 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.apihub.v1.GetVersionRequest 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 [GetVersion][google.cloud.apihub.v1.ApiHub.GetVersion] method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.GetVersionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.GetVersionRequest) + com.google.cloud.apihub.v1.GetVersionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.GetVersionRequest.class, + com.google.cloud.apihub.v1.GetVersionRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.GetVersionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_GetVersionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetVersionRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.GetVersionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetVersionRequest build() { + com.google.cloud.apihub.v1.GetVersionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.GetVersionRequest buildPartial() { + com.google.cloud.apihub.v1.GetVersionRequest result = + new com.google.cloud.apihub.v1.GetVersionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.GetVersionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.apihub.v1.GetVersionRequest) { + return mergeFrom((com.google.cloud.apihub.v1.GetVersionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.GetVersionRequest other) { + if (other == com.google.cloud.apihub.v1.GetVersionRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the API version to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * 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 API version to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * 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 API version to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the API version to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the API version to retrieve.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.apihub.v1.GetVersionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.GetVersionRequest) + private static final com.google.cloud.apihub.v1.GetVersionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.GetVersionRequest(); + } + + public static com.google.cloud.apihub.v1.GetVersionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetVersionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.GetVersionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetVersionRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetVersionRequestOrBuilder.java new file mode 100644 index 000000000000..825b98923652 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/GetVersionRequestOrBuilder.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface GetVersionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.GetVersionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the API version to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the API version to retrieve.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * 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-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/HostProjectRegistration.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/HostProjectRegistration.java new file mode 100644 index 000000000000..a7b97ecdc121 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/HostProjectRegistration.java @@ -0,0 +1,1160 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/host_project_registration_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * Host project registration refers to the registration of a Google cloud
+ * project with Api Hub as a host project. This is the project where Api Hub is
+ * provisioned. It acts as the consumer project for the Api Hub instance
+ * provisioned. Multiple runtime projects can be attached to the host project
+ * and these attachments define the scope of Api Hub.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.HostProjectRegistration} + */ +public final class HostProjectRegistration extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.HostProjectRegistration) + HostProjectRegistrationOrBuilder { + private static final long serialVersionUID = 0L; + // Use HostProjectRegistration.newBuilder() to construct. + private HostProjectRegistration(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private HostProjectRegistration() { + name_ = ""; + gcpProject_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new HostProjectRegistration(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.HostProjectRegistrationServiceProto + .internal_static_google_cloud_apihub_v1_HostProjectRegistration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.HostProjectRegistrationServiceProto + .internal_static_google_cloud_apihub_v1_HostProjectRegistration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.HostProjectRegistration.class, + com.google.cloud.apihub.v1.HostProjectRegistration.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. The name of the host project registration.
+   * Format:
+   * "projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+   * Identifier. The name of the host project registration.
+   * Format:
+   * "projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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 GCP_PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object gcpProject_ = ""; + /** + * + * + *
+   * Required. Immutable. Google cloud project name in the format:
+   * "projects/abc" or "projects/123". As input, project name with either
+   * project id or number are accepted. As output, this field will contain
+   * project number.
+   * 
+ * + * + * string gcp_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The gcpProject. + */ + @java.lang.Override + public java.lang.String getGcpProject() { + java.lang.Object ref = gcpProject_; + 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(); + gcpProject_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Immutable. Google cloud project name in the format:
+   * "projects/abc" or "projects/123". As input, project name with either
+   * project id or number are accepted. As output, this field will contain
+   * project number.
+   * 
+ * + * + * string gcp_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for gcpProject. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGcpProjectBytes() { + java.lang.Object ref = gcpProject_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gcpProject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time at which the host project registration was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. The time at which the host project registration was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.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. The time at which the host project registration was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gcpProject_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, gcpProject_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getCreateTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gcpProject_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, gcpProject_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCreateTime()); + } + size += getUnknownFields().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.apihub.v1.HostProjectRegistration)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.HostProjectRegistration other = + (com.google.cloud.apihub.v1.HostProjectRegistration) obj; + + if (!getName().equals(other.getName())) return false; + if (!getGcpProject().equals(other.getGcpProject())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + GCP_PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getGcpProject().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.HostProjectRegistration parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.HostProjectRegistration 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.apihub.v1.HostProjectRegistration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.HostProjectRegistration 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.apihub.v1.HostProjectRegistration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.HostProjectRegistration parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.HostProjectRegistration parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.HostProjectRegistration 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.apihub.v1.HostProjectRegistration parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.HostProjectRegistration 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.apihub.v1.HostProjectRegistration parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.HostProjectRegistration 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.apihub.v1.HostProjectRegistration 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; + } + /** + * + * + *
+   * Host project registration refers to the registration of a Google cloud
+   * project with Api Hub as a host project. This is the project where Api Hub is
+   * provisioned. It acts as the consumer project for the Api Hub instance
+   * provisioned. Multiple runtime projects can be attached to the host project
+   * and these attachments define the scope of Api Hub.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.HostProjectRegistration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.HostProjectRegistration) + com.google.cloud.apihub.v1.HostProjectRegistrationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.HostProjectRegistrationServiceProto + .internal_static_google_cloud_apihub_v1_HostProjectRegistration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.HostProjectRegistrationServiceProto + .internal_static_google_cloud_apihub_v1_HostProjectRegistration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.HostProjectRegistration.class, + com.google.cloud.apihub.v1.HostProjectRegistration.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.HostProjectRegistration.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCreateTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + gcpProject_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.HostProjectRegistrationServiceProto + .internal_static_google_cloud_apihub_v1_HostProjectRegistration_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.HostProjectRegistration getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.HostProjectRegistration.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.HostProjectRegistration build() { + com.google.cloud.apihub.v1.HostProjectRegistration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.HostProjectRegistration buildPartial() { + com.google.cloud.apihub.v1.HostProjectRegistration result = + new com.google.cloud.apihub.v1.HostProjectRegistration(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.HostProjectRegistration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.gcpProject_ = gcpProject_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.HostProjectRegistration) { + return mergeFrom((com.google.cloud.apihub.v1.HostProjectRegistration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.HostProjectRegistration other) { + if (other == com.google.cloud.apihub.v1.HostProjectRegistration.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getGcpProject().isEmpty()) { + gcpProject_ = other.gcpProject_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + gcpProject_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. The name of the host project registration.
+     * Format:
+     * "projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. The name of the host project registration.
+     * Format:
+     * "projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. The name of the host project registration.
+     * Format:
+     * "projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The name of the host project registration.
+     * Format:
+     * "projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The name of the host project registration.
+     * Format:
+     * "projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object gcpProject_ = ""; + /** + * + * + *
+     * Required. Immutable. Google cloud project name in the format:
+     * "projects/abc" or "projects/123". As input, project name with either
+     * project id or number are accepted. As output, this field will contain
+     * project number.
+     * 
+ * + * + * string gcp_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The gcpProject. + */ + public java.lang.String getGcpProject() { + java.lang.Object ref = gcpProject_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gcpProject_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Immutable. Google cloud project name in the format:
+     * "projects/abc" or "projects/123". As input, project name with either
+     * project id or number are accepted. As output, this field will contain
+     * project number.
+     * 
+ * + * + * string gcp_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for gcpProject. + */ + public com.google.protobuf.ByteString getGcpProjectBytes() { + java.lang.Object ref = gcpProject_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gcpProject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Immutable. Google cloud project name in the format:
+     * "projects/abc" or "projects/123". As input, project name with either
+     * project id or number are accepted. As output, this field will contain
+     * project number.
+     * 
+ * + * + * string gcp_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @param value The gcpProject to set. + * @return This builder for chaining. + */ + public Builder setGcpProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + gcpProject_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. Google cloud project name in the format:
+     * "projects/abc" or "projects/123". As input, project name with either
+     * project id or number are accepted. As output, this field will contain
+     * project number.
+     * 
+ * + * + * string gcp_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearGcpProject() { + gcpProject_ = getDefaultInstance().getGcpProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. Google cloud project name in the format:
+     * "projects/abc" or "projects/123". As input, project name with either
+     * project id or number are accepted. As output, this field will contain
+     * project number.
+     * 
+ * + * + * string gcp_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for gcpProject to set. + * @return This builder for chaining. + */ + public Builder setGcpProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + gcpProject_ = value; + bitField0_ |= 0x00000002; + 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. The time at which the host project registration was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. The time at which the host project registration was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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. The time at which the host project registration was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the host project registration was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the host project registration was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The time at which the host project registration was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000004); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the host project registration was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time at which the host project registration was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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. The time at which the host project registration was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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_; + } + + @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.apihub.v1.HostProjectRegistration) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.HostProjectRegistration) + private static final com.google.cloud.apihub.v1.HostProjectRegistration DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.HostProjectRegistration(); + } + + public static com.google.cloud.apihub.v1.HostProjectRegistration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public HostProjectRegistration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.HostProjectRegistration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/HostProjectRegistrationName.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/HostProjectRegistrationName.java new file mode 100644 index 000000000000..744832f43cbf --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/HostProjectRegistrationName.java @@ -0,0 +1,240 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +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 HostProjectRegistrationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_HOST_PROJECT_REGISTRATION = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String hostProjectRegistration; + + @Deprecated + protected HostProjectRegistrationName() { + project = null; + location = null; + hostProjectRegistration = null; + } + + private HostProjectRegistrationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + hostProjectRegistration = Preconditions.checkNotNull(builder.getHostProjectRegistration()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getHostProjectRegistration() { + return hostProjectRegistration; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static HostProjectRegistrationName of( + String project, String location, String hostProjectRegistration) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setHostProjectRegistration(hostProjectRegistration) + .build(); + } + + public static String format(String project, String location, String hostProjectRegistration) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setHostProjectRegistration(hostProjectRegistration) + .build() + .toString(); + } + + public static HostProjectRegistrationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_HOST_PROJECT_REGISTRATION.validatedMatch( + formattedString, + "HostProjectRegistrationName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("host_project_registration")); + } + + 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 (HostProjectRegistrationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_HOST_PROJECT_REGISTRATION.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); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (hostProjectRegistration != null) { + fieldMapBuilder.put("host_project_registration", hostProjectRegistration); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_HOST_PROJECT_REGISTRATION.instantiate( + "project", + project, + "location", + location, + "host_project_registration", + hostProjectRegistration); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + HostProjectRegistrationName that = ((HostProjectRegistrationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.hostProjectRegistration, that.hostProjectRegistration); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(hostProjectRegistration); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}. + */ + public static class Builder { + private String project; + private String location; + private String hostProjectRegistration; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getHostProjectRegistration() { + return hostProjectRegistration; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setHostProjectRegistration(String hostProjectRegistration) { + this.hostProjectRegistration = hostProjectRegistration; + return this; + } + + private Builder(HostProjectRegistrationName hostProjectRegistrationName) { + this.project = hostProjectRegistrationName.project; + this.location = hostProjectRegistrationName.location; + this.hostProjectRegistration = hostProjectRegistrationName.hostProjectRegistration; + } + + public HostProjectRegistrationName build() { + return new HostProjectRegistrationName(this); + } + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/HostProjectRegistrationOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/HostProjectRegistrationOrBuilder.java new file mode 100644 index 000000000000..1dbaab846b63 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/HostProjectRegistrationOrBuilder.java @@ -0,0 +1,128 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/host_project_registration_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface HostProjectRegistrationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.HostProjectRegistration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. The name of the host project registration.
+   * Format:
+   * "projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. The name of the host project registration.
+   * Format:
+   * "projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. Immutable. Google cloud project name in the format:
+   * "projects/abc" or "projects/123". As input, project name with either
+   * project id or number are accepted. As output, this field will contain
+   * project number.
+   * 
+ * + * + * string gcp_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The gcpProject. + */ + java.lang.String getGcpProject(); + /** + * + * + *
+   * Required. Immutable. Google cloud project name in the format:
+   * "projects/abc" or "projects/123". As input, project name with either
+   * project id or number are accepted. As output, this field will contain
+   * project number.
+   * 
+ * + * + * string gcp_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for gcpProject. + */ + com.google.protobuf.ByteString getGcpProjectBytes(); + + /** + * + * + *
+   * Output only. The time at which the host project registration was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time at which the host project registration was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time at which the host project registration was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/HostProjectRegistrationServiceProto.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/HostProjectRegistrationServiceProto.java new file mode 100644 index 000000000000..77db8eea1418 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/HostProjectRegistrationServiceProto.java @@ -0,0 +1,190 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/host_project_registration_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public final class HostProjectRegistrationServiceProto { + private HostProjectRegistrationServiceProto() {} + + 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_apihub_v1_CreateHostProjectRegistrationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_CreateHostProjectRegistrationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_GetHostProjectRegistrationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_GetHostProjectRegistrationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_ListHostProjectRegistrationsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_ListHostProjectRegistrationsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_ListHostProjectRegistrationsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_ListHostProjectRegistrationsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_HostProjectRegistration_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_HostProjectRegistration_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/apihub/v1/host_project_re" + + "gistration_service.proto\022\026google.cloud.a" + + "pihub.v1\032\034google/api/annotations.proto\032\027" + + "google/api/client.proto\032\037google/api/fiel" + + "d_behavior.proto\032\031google/api/resource.pr" + + "oto\032\037google/protobuf/timestamp.proto\"\361\001\n" + + "$CreateHostProjectRegistrationRequest\022E\n" + + "\006parent\030\001 \001(\tB5\340A\002\372A/\022-apihub.googleapis" + + ".com/HostProjectRegistration\022)\n\034host_pro" + + "ject_registration_id\030\002 \001(\tB\003\340A\002\022W\n\031host_" + + "project_registration\030\003 \001(\0132/.google.clou" + + "d.apihub.v1.HostProjectRegistrationB\003\340A\002" + + "\"h\n!GetHostProjectRegistrationRequest\022C\n" + + "\004name\030\001 \001(\tB5\340A\002\372A/\n-apihub.googleapis.c" + + "om/HostProjectRegistration\"\311\001\n#ListHostP" + + "rojectRegistrationsRequest\022E\n\006parent\030\001 \001" + + "(\tB5\340A\002\372A/\022-apihub.googleapis.com/HostPr" + + "ojectRegistration\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\023\n\006filter\030\004 \001" + + "(\tB\003\340A\001\022\025\n\010order_by\030\005 \001(\tB\003\340A\001\"\224\001\n$ListH" + + "ostProjectRegistrationsResponse\022S\n\032host_" + + "project_registrations\030\001 \003(\0132/.google.clo" + + "ud.apihub.v1.HostProjectRegistration\022\027\n\017" + + "next_page_token\030\002 \001(\t\"\366\002\n\027HostProjectReg" + + "istration\022\021\n\004name\030\001 \001(\tB\003\340A\010\022K\n\013gcp_proj" + + "ect\030\002 \001(\tB6\340A\002\340A\005\372A-\n+cloudresourcemanag" + + "er.googleapis.com/Project\0224\n\013create_time" + + "\030\003 \001(\0132\032.google.protobuf.TimestampB\003\340A\003:" + + "\304\001\352A\300\001\n-apihub.googleapis.com/HostProjec" + + "tRegistration\022\\projects/{project}/locati" + + "ons/{location}/hostProjectRegistrations/" + + "{host_project_registration}*\030hostProject" + + "Registrations2\027hostProjectRegistration2\341" + + "\006\n\036HostProjectRegistrationService\022\260\002\n\035Cr" + + "eateHostProjectRegistration\022<.google.clo" + + "ud.apihub.v1.CreateHostProjectRegistrati" + + "onRequest\032/.google.cloud.apihub.v1.HostP" + + "rojectRegistration\"\237\001\332A=parent,host_proj" + + "ect_registration,host_project_registrati" + + "on_id\202\323\344\223\002Y\"\022\022 + * The HTTP Operation. + * + * + * Protobuf type {@code google.cloud.apihub.v1.HttpOperation} + */ +public final class HttpOperation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.HttpOperation) + HttpOperationOrBuilder { + private static final long serialVersionUID = 0L; + // Use HttpOperation.newBuilder() to construct. + private HttpOperation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private HttpOperation() { + method_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new HttpOperation(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_HttpOperation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_HttpOperation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.HttpOperation.class, + com.google.cloud.apihub.v1.HttpOperation.Builder.class); + } + + /** + * + * + *
+   * Enumeration of Method types.
+   * 
+ * + * Protobuf enum {@code google.cloud.apihub.v1.HttpOperation.Method} + */ + public enum Method implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Method unspecified.
+     * 
+ * + * METHOD_UNSPECIFIED = 0; + */ + METHOD_UNSPECIFIED(0), + /** + * + * + *
+     * Get Operation type.
+     * 
+ * + * GET = 1; + */ + GET(1), + /** + * + * + *
+     * Put Operation type.
+     * 
+ * + * PUT = 2; + */ + PUT(2), + /** + * + * + *
+     * Post Operation type.
+     * 
+ * + * POST = 3; + */ + POST(3), + /** + * + * + *
+     * Delete Operation type.
+     * 
+ * + * DELETE = 4; + */ + DELETE(4), + /** + * + * + *
+     * Options Operation type.
+     * 
+ * + * OPTIONS = 5; + */ + OPTIONS(5), + /** + * + * + *
+     * Head Operation type.
+     * 
+ * + * HEAD = 6; + */ + HEAD(6), + /** + * + * + *
+     * Patch Operation type.
+     * 
+ * + * PATCH = 7; + */ + PATCH(7), + /** + * + * + *
+     * Trace Operation type.
+     * 
+ * + * TRACE = 8; + */ + TRACE(8), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Method unspecified.
+     * 
+ * + * METHOD_UNSPECIFIED = 0; + */ + public static final int METHOD_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Get Operation type.
+     * 
+ * + * GET = 1; + */ + public static final int GET_VALUE = 1; + /** + * + * + *
+     * Put Operation type.
+     * 
+ * + * PUT = 2; + */ + public static final int PUT_VALUE = 2; + /** + * + * + *
+     * Post Operation type.
+     * 
+ * + * POST = 3; + */ + public static final int POST_VALUE = 3; + /** + * + * + *
+     * Delete Operation type.
+     * 
+ * + * DELETE = 4; + */ + public static final int DELETE_VALUE = 4; + /** + * + * + *
+     * Options Operation type.
+     * 
+ * + * OPTIONS = 5; + */ + public static final int OPTIONS_VALUE = 5; + /** + * + * + *
+     * Head Operation type.
+     * 
+ * + * HEAD = 6; + */ + public static final int HEAD_VALUE = 6; + /** + * + * + *
+     * Patch Operation type.
+     * 
+ * + * PATCH = 7; + */ + public static final int PATCH_VALUE = 7; + /** + * + * + *
+     * Trace Operation type.
+     * 
+ * + * TRACE = 8; + */ + public static final int TRACE_VALUE = 8; + + 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 Method 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 Method forNumber(int value) { + switch (value) { + case 0: + return METHOD_UNSPECIFIED; + case 1: + return GET; + case 2: + return PUT; + case 3: + return POST; + case 4: + return DELETE; + case 5: + return OPTIONS; + case 6: + return HEAD; + case 7: + return PATCH; + case 8: + return TRACE; + 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 Method findValueByNumber(int number) { + return Method.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.apihub.v1.HttpOperation.getDescriptor().getEnumTypes().get(0); + } + + private static final Method[] VALUES = values(); + + public static Method 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 Method(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.apihub.v1.HttpOperation.Method) + } + + private int bitField0_; + public static final int PATH_FIELD_NUMBER = 1; + private com.google.cloud.apihub.v1.Path path_; + /** + * + * + *
+   * Output only. The path details for the Operation.
+   * 
+ * + * .google.cloud.apihub.v1.Path path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the path field is set. + */ + @java.lang.Override + public boolean hasPath() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. The path details for the Operation.
+   * 
+ * + * .google.cloud.apihub.v1.Path path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The path. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Path getPath() { + return path_ == null ? com.google.cloud.apihub.v1.Path.getDefaultInstance() : path_; + } + /** + * + * + *
+   * Output only. The path details for the Operation.
+   * 
+ * + * .google.cloud.apihub.v1.Path path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.PathOrBuilder getPathOrBuilder() { + return path_ == null ? com.google.cloud.apihub.v1.Path.getDefaultInstance() : path_; + } + + public static final int METHOD_FIELD_NUMBER = 2; + private int method_ = 0; + /** + * + * + *
+   * Output only. Operation method
+   * 
+ * + * + * .google.cloud.apihub.v1.HttpOperation.Method method = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for method. + */ + @java.lang.Override + public int getMethodValue() { + return method_; + } + /** + * + * + *
+   * Output only. Operation method
+   * 
+ * + * + * .google.cloud.apihub.v1.HttpOperation.Method method = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The method. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.HttpOperation.Method getMethod() { + com.google.cloud.apihub.v1.HttpOperation.Method result = + com.google.cloud.apihub.v1.HttpOperation.Method.forNumber(method_); + return result == null ? com.google.cloud.apihub.v1.HttpOperation.Method.UNRECOGNIZED : result; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getPath()); + } + if (method_ != com.google.cloud.apihub.v1.HttpOperation.Method.METHOD_UNSPECIFIED.getNumber()) { + output.writeEnum(2, method_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPath()); + } + if (method_ != com.google.cloud.apihub.v1.HttpOperation.Method.METHOD_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, method_); + } + size += getUnknownFields().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.apihub.v1.HttpOperation)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.HttpOperation other = (com.google.cloud.apihub.v1.HttpOperation) obj; + + if (hasPath() != other.hasPath()) return false; + if (hasPath()) { + if (!getPath().equals(other.getPath())) return false; + } + if (method_ != other.method_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasPath()) { + hash = (37 * hash) + PATH_FIELD_NUMBER; + hash = (53 * hash) + getPath().hashCode(); + } + hash = (37 * hash) + METHOD_FIELD_NUMBER; + hash = (53 * hash) + method_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.HttpOperation parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.HttpOperation 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.apihub.v1.HttpOperation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.HttpOperation 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.apihub.v1.HttpOperation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.HttpOperation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.HttpOperation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.HttpOperation 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.apihub.v1.HttpOperation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.HttpOperation 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.apihub.v1.HttpOperation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.HttpOperation 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.apihub.v1.HttpOperation 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 HTTP Operation.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.HttpOperation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.HttpOperation) + com.google.cloud.apihub.v1.HttpOperationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_HttpOperation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_HttpOperation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.HttpOperation.class, + com.google.cloud.apihub.v1.HttpOperation.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.HttpOperation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPathFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + path_ = null; + if (pathBuilder_ != null) { + pathBuilder_.dispose(); + pathBuilder_ = null; + } + method_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_HttpOperation_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.HttpOperation getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.HttpOperation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.HttpOperation build() { + com.google.cloud.apihub.v1.HttpOperation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.HttpOperation buildPartial() { + com.google.cloud.apihub.v1.HttpOperation result = + new com.google.cloud.apihub.v1.HttpOperation(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.HttpOperation result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.path_ = pathBuilder_ == null ? path_ : pathBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.method_ = method_; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.HttpOperation) { + return mergeFrom((com.google.cloud.apihub.v1.HttpOperation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.HttpOperation other) { + if (other == com.google.cloud.apihub.v1.HttpOperation.getDefaultInstance()) return this; + if (other.hasPath()) { + mergePath(other.getPath()); + } + if (other.method_ != 0) { + setMethodValue(other.getMethodValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getPathFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + method_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.apihub.v1.Path path_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Path, + com.google.cloud.apihub.v1.Path.Builder, + com.google.cloud.apihub.v1.PathOrBuilder> + pathBuilder_; + /** + * + * + *
+     * Output only. The path details for the Operation.
+     * 
+ * + * .google.cloud.apihub.v1.Path path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the path field is set. + */ + public boolean hasPath() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Output only. The path details for the Operation.
+     * 
+ * + * .google.cloud.apihub.v1.Path path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The path. + */ + public com.google.cloud.apihub.v1.Path getPath() { + if (pathBuilder_ == null) { + return path_ == null ? com.google.cloud.apihub.v1.Path.getDefaultInstance() : path_; + } else { + return pathBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The path details for the Operation.
+     * 
+ * + * .google.cloud.apihub.v1.Path path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPath(com.google.cloud.apihub.v1.Path value) { + if (pathBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + path_ = value; + } else { + pathBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The path details for the Operation.
+     * 
+ * + * .google.cloud.apihub.v1.Path path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPath(com.google.cloud.apihub.v1.Path.Builder builderForValue) { + if (pathBuilder_ == null) { + path_ = builderForValue.build(); + } else { + pathBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The path details for the Operation.
+     * 
+ * + * .google.cloud.apihub.v1.Path path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergePath(com.google.cloud.apihub.v1.Path value) { + if (pathBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && path_ != null + && path_ != com.google.cloud.apihub.v1.Path.getDefaultInstance()) { + getPathBuilder().mergeFrom(value); + } else { + path_ = value; + } + } else { + pathBuilder_.mergeFrom(value); + } + if (path_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The path details for the Operation.
+     * 
+ * + * .google.cloud.apihub.v1.Path path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearPath() { + bitField0_ = (bitField0_ & ~0x00000001); + path_ = null; + if (pathBuilder_ != null) { + pathBuilder_.dispose(); + pathBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The path details for the Operation.
+     * 
+ * + * .google.cloud.apihub.v1.Path path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.apihub.v1.Path.Builder getPathBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getPathFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The path details for the Operation.
+     * 
+ * + * .google.cloud.apihub.v1.Path path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.apihub.v1.PathOrBuilder getPathOrBuilder() { + if (pathBuilder_ != null) { + return pathBuilder_.getMessageOrBuilder(); + } else { + return path_ == null ? com.google.cloud.apihub.v1.Path.getDefaultInstance() : path_; + } + } + /** + * + * + *
+     * Output only. The path details for the Operation.
+     * 
+ * + * .google.cloud.apihub.v1.Path path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Path, + com.google.cloud.apihub.v1.Path.Builder, + com.google.cloud.apihub.v1.PathOrBuilder> + getPathFieldBuilder() { + if (pathBuilder_ == null) { + pathBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Path, + com.google.cloud.apihub.v1.Path.Builder, + com.google.cloud.apihub.v1.PathOrBuilder>( + getPath(), getParentForChildren(), isClean()); + path_ = null; + } + return pathBuilder_; + } + + private int method_ = 0; + /** + * + * + *
+     * Output only. Operation method
+     * 
+ * + * + * .google.cloud.apihub.v1.HttpOperation.Method method = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for method. + */ + @java.lang.Override + public int getMethodValue() { + return method_; + } + /** + * + * + *
+     * Output only. Operation method
+     * 
+ * + * + * .google.cloud.apihub.v1.HttpOperation.Method method = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for method to set. + * @return This builder for chaining. + */ + public Builder setMethodValue(int value) { + method_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Operation method
+     * 
+ * + * + * .google.cloud.apihub.v1.HttpOperation.Method method = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The method. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.HttpOperation.Method getMethod() { + com.google.cloud.apihub.v1.HttpOperation.Method result = + com.google.cloud.apihub.v1.HttpOperation.Method.forNumber(method_); + return result == null ? com.google.cloud.apihub.v1.HttpOperation.Method.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. Operation method
+     * 
+ * + * + * .google.cloud.apihub.v1.HttpOperation.Method method = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The method to set. + * @return This builder for chaining. + */ + public Builder setMethod(com.google.cloud.apihub.v1.HttpOperation.Method value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + method_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Operation method
+     * 
+ * + * + * .google.cloud.apihub.v1.HttpOperation.Method method = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearMethod() { + bitField0_ = (bitField0_ & ~0x00000002); + method_ = 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.apihub.v1.HttpOperation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.HttpOperation) + private static final com.google.cloud.apihub.v1.HttpOperation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.HttpOperation(); + } + + public static com.google.cloud.apihub.v1.HttpOperation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public HttpOperation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.HttpOperation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/HttpOperationOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/HttpOperationOrBuilder.java new file mode 100644 index 000000000000..1d056ed0734d --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/HttpOperationOrBuilder.java @@ -0,0 +1,93 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface HttpOperationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.HttpOperation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The path details for the Operation.
+   * 
+ * + * .google.cloud.apihub.v1.Path path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the path field is set. + */ + boolean hasPath(); + /** + * + * + *
+   * Output only. The path details for the Operation.
+   * 
+ * + * .google.cloud.apihub.v1.Path path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The path. + */ + com.google.cloud.apihub.v1.Path getPath(); + /** + * + * + *
+   * Output only. The path details for the Operation.
+   * 
+ * + * .google.cloud.apihub.v1.Path path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.apihub.v1.PathOrBuilder getPathOrBuilder(); + + /** + * + * + *
+   * Output only. Operation method
+   * 
+ * + * + * .google.cloud.apihub.v1.HttpOperation.Method method = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for method. + */ + int getMethodValue(); + /** + * + * + *
+   * Output only. Operation method
+   * 
+ * + * + * .google.cloud.apihub.v1.HttpOperation.Method method = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The method. + */ + com.google.cloud.apihub.v1.HttpOperation.Method getMethod(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Issue.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Issue.java new file mode 100644 index 000000000000..ba7b837dab53 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Issue.java @@ -0,0 +1,1532 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * Issue contains the details of a single issue found by the linter.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Issue} + */ +public final class Issue extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.Issue) + IssueOrBuilder { + private static final long serialVersionUID = 0L; + // Use Issue.newBuilder() to construct. + private Issue(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Issue() { + code_ = ""; + path_ = com.google.protobuf.LazyStringArrayList.emptyList(); + message_ = ""; + severity_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Issue(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Issue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Issue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Issue.class, com.google.cloud.apihub.v1.Issue.Builder.class); + } + + private int bitField0_; + public static final int CODE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object code_ = ""; + /** + * + * + *
+   * Required. Rule code unique to each rule defined in linter.
+   * 
+ * + * string code = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The code. + */ + @java.lang.Override + public java.lang.String getCode() { + java.lang.Object ref = code_; + 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(); + code_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Rule code unique to each rule defined in linter.
+   * 
+ * + * string code = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for code. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCodeBytes() { + java.lang.Object ref = code_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + code_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PATH_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList path_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Required. An array of strings indicating the location in the analyzed
+   * document where the rule was triggered.
+   * 
+ * + * repeated string path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the path. + */ + public com.google.protobuf.ProtocolStringList getPathList() { + return path_; + } + /** + * + * + *
+   * Required. An array of strings indicating the location in the analyzed
+   * document where the rule was triggered.
+   * 
+ * + * repeated string path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of path. + */ + public int getPathCount() { + return path_.size(); + } + /** + * + * + *
+   * Required. An array of strings indicating the location in the analyzed
+   * document where the rule was triggered.
+   * 
+ * + * repeated string path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The path at the given index. + */ + public java.lang.String getPath(int index) { + return path_.get(index); + } + /** + * + * + *
+   * Required. An array of strings indicating the location in the analyzed
+   * document where the rule was triggered.
+   * 
+ * + * repeated string path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the path at the given index. + */ + public com.google.protobuf.ByteString getPathBytes(int index) { + return path_.getByteString(index); + } + + public static final int MESSAGE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object message_ = ""; + /** + * + * + *
+   * Required. Human-readable message describing the issue found by the linter.
+   * 
+ * + * string message = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + 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(); + message_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Human-readable message describing the issue found by the linter.
+   * 
+ * + * string message = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SEVERITY_FIELD_NUMBER = 4; + private int severity_ = 0; + /** + * + * + *
+   * Required. Severity level of the rule violation.
+   * 
+ * + * .google.cloud.apihub.v1.Severity severity = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + /** + * + * + *
+   * Required. Severity level of the rule violation.
+   * 
+ * + * .google.cloud.apihub.v1.Severity severity = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The severity. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Severity getSeverity() { + com.google.cloud.apihub.v1.Severity result = + com.google.cloud.apihub.v1.Severity.forNumber(severity_); + return result == null ? com.google.cloud.apihub.v1.Severity.UNRECOGNIZED : result; + } + + public static final int RANGE_FIELD_NUMBER = 5; + private com.google.cloud.apihub.v1.Range range_; + /** + * + * + *
+   * Required. Object describing where in the file the issue was found.
+   * 
+ * + * .google.cloud.apihub.v1.Range range = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the range field is set. + */ + @java.lang.Override + public boolean hasRange() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. Object describing where in the file the issue was found.
+   * 
+ * + * .google.cloud.apihub.v1.Range range = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The range. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Range getRange() { + return range_ == null ? com.google.cloud.apihub.v1.Range.getDefaultInstance() : range_; + } + /** + * + * + *
+   * Required. Object describing where in the file the issue was found.
+   * 
+ * + * .google.cloud.apihub.v1.Range range = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.RangeOrBuilder getRangeOrBuilder() { + return range_ == null ? com.google.cloud.apihub.v1.Range.getDefaultInstance() : range_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(code_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, code_); + } + for (int i = 0; i < path_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, path_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, message_); + } + if (severity_ != com.google.cloud.apihub.v1.Severity.SEVERITY_UNSPECIFIED.getNumber()) { + output.writeEnum(4, severity_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getRange()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(code_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, code_); + } + { + int dataSize = 0; + for (int i = 0; i < path_.size(); i++) { + dataSize += computeStringSizeNoTag(path_.getRaw(i)); + } + size += dataSize; + size += 1 * getPathList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, message_); + } + if (severity_ != com.google.cloud.apihub.v1.Severity.SEVERITY_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, severity_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getRange()); + } + size += getUnknownFields().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.apihub.v1.Issue)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.Issue other = (com.google.cloud.apihub.v1.Issue) obj; + + if (!getCode().equals(other.getCode())) return false; + if (!getPathList().equals(other.getPathList())) return false; + if (!getMessage().equals(other.getMessage())) return false; + if (severity_ != other.severity_) return false; + if (hasRange() != other.hasRange()) return false; + if (hasRange()) { + if (!getRange().equals(other.getRange())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + CODE_FIELD_NUMBER; + hash = (53 * hash) + getCode().hashCode(); + if (getPathCount() > 0) { + hash = (37 * hash) + PATH_FIELD_NUMBER; + hash = (53 * hash) + getPathList().hashCode(); + } + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + if (hasRange()) { + hash = (37 * hash) + RANGE_FIELD_NUMBER; + hash = (53 * hash) + getRange().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.Issue parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Issue 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.apihub.v1.Issue parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Issue 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.apihub.v1.Issue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Issue parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.Issue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Issue 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.apihub.v1.Issue parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Issue 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.apihub.v1.Issue parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Issue 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.apihub.v1.Issue 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; + } + /** + * + * + *
+   * Issue contains the details of a single issue found by the linter.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Issue} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.Issue) + com.google.cloud.apihub.v1.IssueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Issue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Issue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Issue.class, + com.google.cloud.apihub.v1.Issue.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.Issue.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRangeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + code_ = ""; + path_ = com.google.protobuf.LazyStringArrayList.emptyList(); + message_ = ""; + severity_ = 0; + range_ = null; + if (rangeBuilder_ != null) { + rangeBuilder_.dispose(); + rangeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Issue_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Issue getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.Issue.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Issue build() { + com.google.cloud.apihub.v1.Issue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Issue buildPartial() { + com.google.cloud.apihub.v1.Issue result = new com.google.cloud.apihub.v1.Issue(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.Issue result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.code_ = code_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + path_.makeImmutable(); + result.path_ = path_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.message_ = message_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.severity_ = severity_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.range_ = rangeBuilder_ == null ? range_ : rangeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.Issue) { + return mergeFrom((com.google.cloud.apihub.v1.Issue) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.Issue other) { + if (other == com.google.cloud.apihub.v1.Issue.getDefaultInstance()) return this; + if (!other.getCode().isEmpty()) { + code_ = other.code_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.path_.isEmpty()) { + if (path_.isEmpty()) { + path_ = other.path_; + bitField0_ |= 0x00000002; + } else { + ensurePathIsMutable(); + path_.addAll(other.path_); + } + onChanged(); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + if (other.hasRange()) { + mergeRange(other.getRange()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + code_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensurePathIsMutable(); + path_.add(s); + break; + } // case 18 + case 26: + { + message_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + severity_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + input.readMessage(getRangeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object code_ = ""; + /** + * + * + *
+     * Required. Rule code unique to each rule defined in linter.
+     * 
+ * + * string code = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The code. + */ + public java.lang.String getCode() { + java.lang.Object ref = code_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + code_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Rule code unique to each rule defined in linter.
+     * 
+ * + * string code = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for code. + */ + public com.google.protobuf.ByteString getCodeBytes() { + java.lang.Object ref = code_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + code_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Rule code unique to each rule defined in linter.
+     * 
+ * + * string code = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + code_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Rule code unique to each rule defined in linter.
+     * 
+ * + * string code = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearCode() { + code_ = getDefaultInstance().getCode(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Rule code unique to each rule defined in linter.
+     * 
+ * + * string code = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for code to set. + * @return This builder for chaining. + */ + public Builder setCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + code_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList path_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensurePathIsMutable() { + if (!path_.isModifiable()) { + path_ = new com.google.protobuf.LazyStringArrayList(path_); + } + bitField0_ |= 0x00000002; + } + /** + * + * + *
+     * Required. An array of strings indicating the location in the analyzed
+     * document where the rule was triggered.
+     * 
+ * + * repeated string path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the path. + */ + public com.google.protobuf.ProtocolStringList getPathList() { + path_.makeImmutable(); + return path_; + } + /** + * + * + *
+     * Required. An array of strings indicating the location in the analyzed
+     * document where the rule was triggered.
+     * 
+ * + * repeated string path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of path. + */ + public int getPathCount() { + return path_.size(); + } + /** + * + * + *
+     * Required. An array of strings indicating the location in the analyzed
+     * document where the rule was triggered.
+     * 
+ * + * repeated string path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The path at the given index. + */ + public java.lang.String getPath(int index) { + return path_.get(index); + } + /** + * + * + *
+     * Required. An array of strings indicating the location in the analyzed
+     * document where the rule was triggered.
+     * 
+ * + * repeated string path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the path at the given index. + */ + public com.google.protobuf.ByteString getPathBytes(int index) { + return path_.getByteString(index); + } + /** + * + * + *
+     * Required. An array of strings indicating the location in the analyzed
+     * document where the rule was triggered.
+     * 
+ * + * repeated string path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The path to set. + * @return This builder for chaining. + */ + public Builder setPath(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePathIsMutable(); + path_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. An array of strings indicating the location in the analyzed
+     * document where the rule was triggered.
+     * 
+ * + * repeated string path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The path to add. + * @return This builder for chaining. + */ + public Builder addPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePathIsMutable(); + path_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. An array of strings indicating the location in the analyzed
+     * document where the rule was triggered.
+     * 
+ * + * repeated string path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The path to add. + * @return This builder for chaining. + */ + public Builder addAllPath(java.lang.Iterable values) { + ensurePathIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, path_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. An array of strings indicating the location in the analyzed
+     * document where the rule was triggered.
+     * 
+ * + * repeated string path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPath() { + path_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. An array of strings indicating the location in the analyzed
+     * document where the rule was triggered.
+     * 
+ * + * repeated string path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the path to add. + * @return This builder for chaining. + */ + public Builder addPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePathIsMutable(); + path_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + /** + * + * + *
+     * Required. Human-readable message describing the issue found by the linter.
+     * 
+ * + * string message = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Human-readable message describing the issue found by the linter.
+     * 
+ * + * string message = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Human-readable message describing the issue found by the linter.
+     * 
+ * + * string message = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Human-readable message describing the issue found by the linter.
+     * 
+ * + * string message = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + message_ = getDefaultInstance().getMessage(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Human-readable message describing the issue found by the linter.
+     * 
+ * + * string message = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + message_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int severity_ = 0; + /** + * + * + *
+     * Required. Severity level of the rule violation.
+     * 
+ * + * + * .google.cloud.apihub.v1.Severity severity = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + /** + * + * + *
+     * Required. Severity level of the rule violation.
+     * 
+ * + * + * .google.cloud.apihub.v1.Severity severity = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for severity to set. + * @return This builder for chaining. + */ + public Builder setSeverityValue(int value) { + severity_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Severity level of the rule violation.
+     * 
+ * + * + * .google.cloud.apihub.v1.Severity severity = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The severity. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Severity getSeverity() { + com.google.cloud.apihub.v1.Severity result = + com.google.cloud.apihub.v1.Severity.forNumber(severity_); + return result == null ? com.google.cloud.apihub.v1.Severity.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Required. Severity level of the rule violation.
+     * 
+ * + * + * .google.cloud.apihub.v1.Severity severity = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The severity to set. + * @return This builder for chaining. + */ + public Builder setSeverity(com.google.cloud.apihub.v1.Severity value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + severity_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Severity level of the rule violation.
+     * 
+ * + * + * .google.cloud.apihub.v1.Severity severity = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearSeverity() { + bitField0_ = (bitField0_ & ~0x00000008); + severity_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.apihub.v1.Range range_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Range, + com.google.cloud.apihub.v1.Range.Builder, + com.google.cloud.apihub.v1.RangeOrBuilder> + rangeBuilder_; + /** + * + * + *
+     * Required. Object describing where in the file the issue was found.
+     * 
+ * + * .google.cloud.apihub.v1.Range range = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the range field is set. + */ + public boolean hasRange() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Required. Object describing where in the file the issue was found.
+     * 
+ * + * .google.cloud.apihub.v1.Range range = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The range. + */ + public com.google.cloud.apihub.v1.Range getRange() { + if (rangeBuilder_ == null) { + return range_ == null ? com.google.cloud.apihub.v1.Range.getDefaultInstance() : range_; + } else { + return rangeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Object describing where in the file the issue was found.
+     * 
+ * + * .google.cloud.apihub.v1.Range range = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRange(com.google.cloud.apihub.v1.Range value) { + if (rangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + range_ = value; + } else { + rangeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Object describing where in the file the issue was found.
+     * 
+ * + * .google.cloud.apihub.v1.Range range = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRange(com.google.cloud.apihub.v1.Range.Builder builderForValue) { + if (rangeBuilder_ == null) { + range_ = builderForValue.build(); + } else { + rangeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Object describing where in the file the issue was found.
+     * 
+ * + * .google.cloud.apihub.v1.Range range = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeRange(com.google.cloud.apihub.v1.Range value) { + if (rangeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && range_ != null + && range_ != com.google.cloud.apihub.v1.Range.getDefaultInstance()) { + getRangeBuilder().mergeFrom(value); + } else { + range_ = value; + } + } else { + rangeBuilder_.mergeFrom(value); + } + if (range_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. Object describing where in the file the issue was found.
+     * 
+ * + * .google.cloud.apihub.v1.Range range = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearRange() { + bitField0_ = (bitField0_ & ~0x00000010); + range_ = null; + if (rangeBuilder_ != null) { + rangeBuilder_.dispose(); + rangeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Object describing where in the file the issue was found.
+     * 
+ * + * .google.cloud.apihub.v1.Range range = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.Range.Builder getRangeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getRangeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Object describing where in the file the issue was found.
+     * 
+ * + * .google.cloud.apihub.v1.Range range = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.RangeOrBuilder getRangeOrBuilder() { + if (rangeBuilder_ != null) { + return rangeBuilder_.getMessageOrBuilder(); + } else { + return range_ == null ? com.google.cloud.apihub.v1.Range.getDefaultInstance() : range_; + } + } + /** + * + * + *
+     * Required. Object describing where in the file the issue was found.
+     * 
+ * + * .google.cloud.apihub.v1.Range range = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Range, + com.google.cloud.apihub.v1.Range.Builder, + com.google.cloud.apihub.v1.RangeOrBuilder> + getRangeFieldBuilder() { + if (rangeBuilder_ == null) { + rangeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Range, + com.google.cloud.apihub.v1.Range.Builder, + com.google.cloud.apihub.v1.RangeOrBuilder>( + getRange(), getParentForChildren(), isClean()); + range_ = null; + } + return rangeBuilder_; + } + + @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.apihub.v1.Issue) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.Issue) + private static final com.google.cloud.apihub.v1.Issue DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.Issue(); + } + + public static com.google.cloud.apihub.v1.Issue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Issue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.Issue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/IssueOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/IssueOrBuilder.java new file mode 100644 index 000000000000..545a15168943 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/IssueOrBuilder.java @@ -0,0 +1,193 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface IssueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.Issue) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Rule code unique to each rule defined in linter.
+   * 
+ * + * string code = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The code. + */ + java.lang.String getCode(); + /** + * + * + *
+   * Required. Rule code unique to each rule defined in linter.
+   * 
+ * + * string code = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for code. + */ + com.google.protobuf.ByteString getCodeBytes(); + + /** + * + * + *
+   * Required. An array of strings indicating the location in the analyzed
+   * document where the rule was triggered.
+   * 
+ * + * repeated string path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the path. + */ + java.util.List getPathList(); + /** + * + * + *
+   * Required. An array of strings indicating the location in the analyzed
+   * document where the rule was triggered.
+   * 
+ * + * repeated string path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of path. + */ + int getPathCount(); + /** + * + * + *
+   * Required. An array of strings indicating the location in the analyzed
+   * document where the rule was triggered.
+   * 
+ * + * repeated string path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The path at the given index. + */ + java.lang.String getPath(int index); + /** + * + * + *
+   * Required. An array of strings indicating the location in the analyzed
+   * document where the rule was triggered.
+   * 
+ * + * repeated string path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the path at the given index. + */ + com.google.protobuf.ByteString getPathBytes(int index); + + /** + * + * + *
+   * Required. Human-readable message describing the issue found by the linter.
+   * 
+ * + * string message = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The message. + */ + java.lang.String getMessage(); + /** + * + * + *
+   * Required. Human-readable message describing the issue found by the linter.
+   * 
+ * + * string message = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); + + /** + * + * + *
+   * Required. Severity level of the rule violation.
+   * 
+ * + * .google.cloud.apihub.v1.Severity severity = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for severity. + */ + int getSeverityValue(); + /** + * + * + *
+   * Required. Severity level of the rule violation.
+   * 
+ * + * .google.cloud.apihub.v1.Severity severity = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The severity. + */ + com.google.cloud.apihub.v1.Severity getSeverity(); + + /** + * + * + *
+   * Required. Object describing where in the file the issue was found.
+   * 
+ * + * .google.cloud.apihub.v1.Range range = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the range field is set. + */ + boolean hasRange(); + /** + * + * + *
+   * Required. Object describing where in the file the issue was found.
+   * 
+ * + * .google.cloud.apihub.v1.Range range = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The range. + */ + com.google.cloud.apihub.v1.Range getRange(); + /** + * + * + *
+   * Required. Object describing where in the file the issue was found.
+   * 
+ * + * .google.cloud.apihub.v1.Range range = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.apihub.v1.RangeOrBuilder getRangeOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LintResponse.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LintResponse.java new file mode 100644 index 000000000000..391df8f6d45c --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LintResponse.java @@ -0,0 +1,3031 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * LintResponse contains the response from the linter.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.LintResponse} + */ +public final class LintResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.LintResponse) + LintResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use LintResponse.newBuilder() to construct. + private LintResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LintResponse() { + issues_ = java.util.Collections.emptyList(); + summary_ = java.util.Collections.emptyList(); + state_ = 0; + source_ = ""; + linter_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LintResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_LintResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_LintResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.LintResponse.class, + com.google.cloud.apihub.v1.LintResponse.Builder.class); + } + + public interface SummaryEntryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.LintResponse.SummaryEntry) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. Severity of the issue.
+     * 
+ * + * + * .google.cloud.apihub.v1.Severity severity = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for severity. + */ + int getSeverityValue(); + /** + * + * + *
+     * Required. Severity of the issue.
+     * 
+ * + * + * .google.cloud.apihub.v1.Severity severity = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The severity. + */ + com.google.cloud.apihub.v1.Severity getSeverity(); + + /** + * + * + *
+     * Required. Count of issues with the given severity.
+     * 
+ * + * int32 count = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count. + */ + int getCount(); + } + /** + * + * + *
+   * Count of issues with a given severity.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.LintResponse.SummaryEntry} + */ + public static final class SummaryEntry extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.LintResponse.SummaryEntry) + SummaryEntryOrBuilder { + private static final long serialVersionUID = 0L; + // Use SummaryEntry.newBuilder() to construct. + private SummaryEntry(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SummaryEntry() { + severity_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SummaryEntry(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_LintResponse_SummaryEntry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_LintResponse_SummaryEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.LintResponse.SummaryEntry.class, + com.google.cloud.apihub.v1.LintResponse.SummaryEntry.Builder.class); + } + + public static final int SEVERITY_FIELD_NUMBER = 1; + private int severity_ = 0; + /** + * + * + *
+     * Required. Severity of the issue.
+     * 
+ * + * + * .google.cloud.apihub.v1.Severity severity = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + /** + * + * + *
+     * Required. Severity of the issue.
+     * 
+ * + * + * .google.cloud.apihub.v1.Severity severity = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The severity. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Severity getSeverity() { + com.google.cloud.apihub.v1.Severity result = + com.google.cloud.apihub.v1.Severity.forNumber(severity_); + return result == null ? com.google.cloud.apihub.v1.Severity.UNRECOGNIZED : result; + } + + public static final int COUNT_FIELD_NUMBER = 2; + private int count_ = 0; + /** + * + * + *
+     * Required. Count of issues with the given severity.
+     * 
+ * + * int32 count = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count. + */ + @java.lang.Override + public int getCount() { + return count_; + } + + 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 (severity_ != com.google.cloud.apihub.v1.Severity.SEVERITY_UNSPECIFIED.getNumber()) { + output.writeEnum(1, severity_); + } + if (count_ != 0) { + output.writeInt32(2, count_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (severity_ != com.google.cloud.apihub.v1.Severity.SEVERITY_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, severity_); + } + if (count_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, count_); + } + size += getUnknownFields().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.apihub.v1.LintResponse.SummaryEntry)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.LintResponse.SummaryEntry other = + (com.google.cloud.apihub.v1.LintResponse.SummaryEntry) obj; + + if (severity_ != other.severity_) return false; + if (getCount() != other.getCount()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + hash = (37 * hash) + COUNT_FIELD_NUMBER; + hash = (53 * hash) + getCount(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.LintResponse.SummaryEntry parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.LintResponse.SummaryEntry 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.apihub.v1.LintResponse.SummaryEntry parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.LintResponse.SummaryEntry 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.apihub.v1.LintResponse.SummaryEntry parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.LintResponse.SummaryEntry parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.LintResponse.SummaryEntry parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.LintResponse.SummaryEntry 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.apihub.v1.LintResponse.SummaryEntry parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.LintResponse.SummaryEntry 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.apihub.v1.LintResponse.SummaryEntry parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.LintResponse.SummaryEntry 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.apihub.v1.LintResponse.SummaryEntry 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; + } + /** + * + * + *
+     * Count of issues with a given severity.
+     * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.LintResponse.SummaryEntry} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.LintResponse.SummaryEntry) + com.google.cloud.apihub.v1.LintResponse.SummaryEntryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_LintResponse_SummaryEntry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_LintResponse_SummaryEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.LintResponse.SummaryEntry.class, + com.google.cloud.apihub.v1.LintResponse.SummaryEntry.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.LintResponse.SummaryEntry.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + severity_ = 0; + count_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_LintResponse_SummaryEntry_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.LintResponse.SummaryEntry getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.LintResponse.SummaryEntry.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.LintResponse.SummaryEntry build() { + com.google.cloud.apihub.v1.LintResponse.SummaryEntry result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.LintResponse.SummaryEntry buildPartial() { + com.google.cloud.apihub.v1.LintResponse.SummaryEntry result = + new com.google.cloud.apihub.v1.LintResponse.SummaryEntry(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.LintResponse.SummaryEntry result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.severity_ = severity_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.count_ = count_; + } + } + + @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.apihub.v1.LintResponse.SummaryEntry) { + return mergeFrom((com.google.cloud.apihub.v1.LintResponse.SummaryEntry) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.LintResponse.SummaryEntry other) { + if (other == com.google.cloud.apihub.v1.LintResponse.SummaryEntry.getDefaultInstance()) + return this; + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + if (other.getCount() != 0) { + setCount(other.getCount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + severity_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + count_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int severity_ = 0; + /** + * + * + *
+       * Required. Severity of the issue.
+       * 
+ * + * + * .google.cloud.apihub.v1.Severity severity = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + /** + * + * + *
+       * Required. Severity of the issue.
+       * 
+ * + * + * .google.cloud.apihub.v1.Severity severity = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for severity to set. + * @return This builder for chaining. + */ + public Builder setSeverityValue(int value) { + severity_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Severity of the issue.
+       * 
+ * + * + * .google.cloud.apihub.v1.Severity severity = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The severity. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Severity getSeverity() { + com.google.cloud.apihub.v1.Severity result = + com.google.cloud.apihub.v1.Severity.forNumber(severity_); + return result == null ? com.google.cloud.apihub.v1.Severity.UNRECOGNIZED : result; + } + /** + * + * + *
+       * Required. Severity of the issue.
+       * 
+ * + * + * .google.cloud.apihub.v1.Severity severity = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The severity to set. + * @return This builder for chaining. + */ + public Builder setSeverity(com.google.cloud.apihub.v1.Severity value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + severity_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Severity of the issue.
+       * 
+ * + * + * .google.cloud.apihub.v1.Severity severity = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearSeverity() { + bitField0_ = (bitField0_ & ~0x00000001); + severity_ = 0; + onChanged(); + return this; + } + + private int count_; + /** + * + * + *
+       * Required. Count of issues with the given severity.
+       * 
+ * + * int32 count = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count. + */ + @java.lang.Override + public int getCount() { + return count_; + } + /** + * + * + *
+       * Required. Count of issues with the given severity.
+       * 
+ * + * int32 count = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The count to set. + * @return This builder for chaining. + */ + public Builder setCount(int value) { + + count_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Count of issues with the given severity.
+       * 
+ * + * int32 count = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearCount() { + bitField0_ = (bitField0_ & ~0x00000002); + count_ = 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.apihub.v1.LintResponse.SummaryEntry) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.LintResponse.SummaryEntry) + private static final com.google.cloud.apihub.v1.LintResponse.SummaryEntry DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.LintResponse.SummaryEntry(); + } + + public static com.google.cloud.apihub.v1.LintResponse.SummaryEntry getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SummaryEntry parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.LintResponse.SummaryEntry getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int ISSUES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List issues_; + /** + * + * + *
+   * Optional. Array of issues found in the analyzed document.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.Issue issues = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List getIssuesList() { + return issues_; + } + /** + * + * + *
+   * Optional. Array of issues found in the analyzed document.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.Issue issues = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getIssuesOrBuilderList() { + return issues_; + } + /** + * + * + *
+   * Optional. Array of issues found in the analyzed document.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.Issue issues = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getIssuesCount() { + return issues_.size(); + } + /** + * + * + *
+   * Optional. Array of issues found in the analyzed document.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.Issue issues = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Issue getIssues(int index) { + return issues_.get(index); + } + /** + * + * + *
+   * Optional. Array of issues found in the analyzed document.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.Issue issues = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.IssueOrBuilder getIssuesOrBuilder(int index) { + return issues_.get(index); + } + + public static final int SUMMARY_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List summary_; + /** + * + * + *
+   * Optional. Summary of all issue types and counts for each severity level.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.LintResponse.SummaryEntry summary = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List getSummaryList() { + return summary_; + } + /** + * + * + *
+   * Optional. Summary of all issue types and counts for each severity level.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.LintResponse.SummaryEntry summary = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getSummaryOrBuilderList() { + return summary_; + } + /** + * + * + *
+   * Optional. Summary of all issue types and counts for each severity level.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.LintResponse.SummaryEntry summary = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getSummaryCount() { + return summary_.size(); + } + /** + * + * + *
+   * Optional. Summary of all issue types and counts for each severity level.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.LintResponse.SummaryEntry summary = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.LintResponse.SummaryEntry getSummary(int index) { + return summary_.get(index); + } + /** + * + * + *
+   * Optional. Summary of all issue types and counts for each severity level.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.LintResponse.SummaryEntry summary = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.LintResponse.SummaryEntryOrBuilder getSummaryOrBuilder( + int index) { + return summary_.get(index); + } + + public static final int STATE_FIELD_NUMBER = 3; + private int state_ = 0; + /** + * + * + *
+   * Required. Lint state represents success or failure for linting.
+   * 
+ * + * .google.cloud.apihub.v1.LintState state = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Required. Lint state represents success or failure for linting.
+   * 
+ * + * .google.cloud.apihub.v1.LintState state = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.LintState getState() { + com.google.cloud.apihub.v1.LintState result = + com.google.cloud.apihub.v1.LintState.forNumber(state_); + return result == null ? com.google.cloud.apihub.v1.LintState.UNRECOGNIZED : result; + } + + public static final int SOURCE_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object source_ = ""; + /** + * + * + *
+   * Required. Name of the linting application.
+   * 
+ * + * string source = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The source. + */ + @java.lang.Override + public java.lang.String getSource() { + java.lang.Object ref = source_; + 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(); + source_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the linting application.
+   * 
+ * + * string source = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for source. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceBytes() { + java.lang.Object ref = source_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + source_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LINTER_FIELD_NUMBER = 5; + private int linter_ = 0; + /** + * + * + *
+   * Required. Name of the linter used.
+   * 
+ * + * .google.cloud.apihub.v1.Linter linter = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for linter. + */ + @java.lang.Override + public int getLinterValue() { + return linter_; + } + /** + * + * + *
+   * Required. Name of the linter used.
+   * 
+ * + * .google.cloud.apihub.v1.Linter linter = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The linter. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Linter getLinter() { + com.google.cloud.apihub.v1.Linter result = com.google.cloud.apihub.v1.Linter.forNumber(linter_); + return result == null ? com.google.cloud.apihub.v1.Linter.UNRECOGNIZED : result; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Required. Timestamp when the linting response was generated.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. Timestamp when the linting response was generated.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Required. Timestamp when the linting response was generated.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + 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 < issues_.size(); i++) { + output.writeMessage(1, issues_.get(i)); + } + for (int i = 0; i < summary_.size(); i++) { + output.writeMessage(2, summary_.get(i)); + } + if (state_ != com.google.cloud.apihub.v1.LintState.LINT_STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(3, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(source_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, source_); + } + if (linter_ != com.google.cloud.apihub.v1.Linter.LINTER_UNSPECIFIED.getNumber()) { + output.writeEnum(5, linter_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getCreateTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < issues_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, issues_.get(i)); + } + for (int i = 0; i < summary_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, summary_.get(i)); + } + if (state_ != com.google.cloud.apihub.v1.LintState.LINT_STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(source_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, source_); + } + if (linter_ != com.google.cloud.apihub.v1.Linter.LINTER_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, linter_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getCreateTime()); + } + size += getUnknownFields().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.apihub.v1.LintResponse)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.LintResponse other = (com.google.cloud.apihub.v1.LintResponse) obj; + + if (!getIssuesList().equals(other.getIssuesList())) return false; + if (!getSummaryList().equals(other.getSummaryList())) return false; + if (state_ != other.state_) return false; + if (!getSource().equals(other.getSource())) return false; + if (linter_ != other.linter_) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getIssuesCount() > 0) { + hash = (37 * hash) + ISSUES_FIELD_NUMBER; + hash = (53 * hash) + getIssuesList().hashCode(); + } + if (getSummaryCount() > 0) { + hash = (37 * hash) + SUMMARY_FIELD_NUMBER; + hash = (53 * hash) + getSummaryList().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getSource().hashCode(); + hash = (37 * hash) + LINTER_FIELD_NUMBER; + hash = (53 * hash) + linter_; + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.LintResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.LintResponse 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.apihub.v1.LintResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.LintResponse 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.apihub.v1.LintResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.LintResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.LintResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.LintResponse 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.apihub.v1.LintResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.LintResponse 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.apihub.v1.LintResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.LintResponse 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.apihub.v1.LintResponse 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; + } + /** + * + * + *
+   * LintResponse contains the response from the linter.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.LintResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.LintResponse) + com.google.cloud.apihub.v1.LintResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_LintResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_LintResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.LintResponse.class, + com.google.cloud.apihub.v1.LintResponse.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.LintResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getIssuesFieldBuilder(); + getSummaryFieldBuilder(); + getCreateTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (issuesBuilder_ == null) { + issues_ = java.util.Collections.emptyList(); + } else { + issues_ = null; + issuesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (summaryBuilder_ == null) { + summary_ = java.util.Collections.emptyList(); + } else { + summary_ = null; + summaryBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + state_ = 0; + source_ = ""; + linter_ = 0; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_LintResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.LintResponse getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.LintResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.LintResponse build() { + com.google.cloud.apihub.v1.LintResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.LintResponse buildPartial() { + com.google.cloud.apihub.v1.LintResponse result = + new com.google.cloud.apihub.v1.LintResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.apihub.v1.LintResponse result) { + if (issuesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + issues_ = java.util.Collections.unmodifiableList(issues_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.issues_ = issues_; + } else { + result.issues_ = issuesBuilder_.build(); + } + if (summaryBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + summary_ = java.util.Collections.unmodifiableList(summary_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.summary_ = summary_; + } else { + result.summary_ = summaryBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.apihub.v1.LintResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.source_ = source_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.linter_ = linter_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000020) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.LintResponse) { + return mergeFrom((com.google.cloud.apihub.v1.LintResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.LintResponse other) { + if (other == com.google.cloud.apihub.v1.LintResponse.getDefaultInstance()) return this; + if (issuesBuilder_ == null) { + if (!other.issues_.isEmpty()) { + if (issues_.isEmpty()) { + issues_ = other.issues_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureIssuesIsMutable(); + issues_.addAll(other.issues_); + } + onChanged(); + } + } else { + if (!other.issues_.isEmpty()) { + if (issuesBuilder_.isEmpty()) { + issuesBuilder_.dispose(); + issuesBuilder_ = null; + issues_ = other.issues_; + bitField0_ = (bitField0_ & ~0x00000001); + issuesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getIssuesFieldBuilder() + : null; + } else { + issuesBuilder_.addAllMessages(other.issues_); + } + } + } + if (summaryBuilder_ == null) { + if (!other.summary_.isEmpty()) { + if (summary_.isEmpty()) { + summary_ = other.summary_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSummaryIsMutable(); + summary_.addAll(other.summary_); + } + onChanged(); + } + } else { + if (!other.summary_.isEmpty()) { + if (summaryBuilder_.isEmpty()) { + summaryBuilder_.dispose(); + summaryBuilder_ = null; + summary_ = other.summary_; + bitField0_ = (bitField0_ & ~0x00000002); + summaryBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSummaryFieldBuilder() + : null; + } else { + summaryBuilder_.addAllMessages(other.summary_); + } + } + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getSource().isEmpty()) { + source_ = other.source_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.linter_ != 0) { + setLinterValue(other.getLinterValue()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.apihub.v1.Issue m = + input.readMessage(com.google.cloud.apihub.v1.Issue.parser(), extensionRegistry); + if (issuesBuilder_ == null) { + ensureIssuesIsMutable(); + issues_.add(m); + } else { + issuesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + com.google.cloud.apihub.v1.LintResponse.SummaryEntry m = + input.readMessage( + com.google.cloud.apihub.v1.LintResponse.SummaryEntry.parser(), + extensionRegistry); + if (summaryBuilder_ == null) { + ensureSummaryIsMutable(); + summary_.add(m); + } else { + summaryBuilder_.addMessage(m); + } + break; + } // case 18 + case 24: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + source_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + linter_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List issues_ = + java.util.Collections.emptyList(); + + private void ensureIssuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + issues_ = new java.util.ArrayList(issues_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.Issue, + com.google.cloud.apihub.v1.Issue.Builder, + com.google.cloud.apihub.v1.IssueOrBuilder> + issuesBuilder_; + + /** + * + * + *
+     * Optional. Array of issues found in the analyzed document.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Issue issues = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List getIssuesList() { + if (issuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(issues_); + } else { + return issuesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Optional. Array of issues found in the analyzed document.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Issue issues = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getIssuesCount() { + if (issuesBuilder_ == null) { + return issues_.size(); + } else { + return issuesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Optional. Array of issues found in the analyzed document.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Issue issues = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.Issue getIssues(int index) { + if (issuesBuilder_ == null) { + return issues_.get(index); + } else { + return issuesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Optional. Array of issues found in the analyzed document.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Issue issues = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setIssues(int index, com.google.cloud.apihub.v1.Issue value) { + if (issuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIssuesIsMutable(); + issues_.set(index, value); + onChanged(); + } else { + issuesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. Array of issues found in the analyzed document.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Issue issues = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setIssues(int index, com.google.cloud.apihub.v1.Issue.Builder builderForValue) { + if (issuesBuilder_ == null) { + ensureIssuesIsMutable(); + issues_.set(index, builderForValue.build()); + onChanged(); + } else { + issuesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Array of issues found in the analyzed document.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Issue issues = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addIssues(com.google.cloud.apihub.v1.Issue value) { + if (issuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIssuesIsMutable(); + issues_.add(value); + onChanged(); + } else { + issuesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Optional. Array of issues found in the analyzed document.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Issue issues = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addIssues(int index, com.google.cloud.apihub.v1.Issue value) { + if (issuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIssuesIsMutable(); + issues_.add(index, value); + onChanged(); + } else { + issuesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. Array of issues found in the analyzed document.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Issue issues = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addIssues(com.google.cloud.apihub.v1.Issue.Builder builderForValue) { + if (issuesBuilder_ == null) { + ensureIssuesIsMutable(); + issues_.add(builderForValue.build()); + onChanged(); + } else { + issuesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Array of issues found in the analyzed document.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Issue issues = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addIssues(int index, com.google.cloud.apihub.v1.Issue.Builder builderForValue) { + if (issuesBuilder_ == null) { + ensureIssuesIsMutable(); + issues_.add(index, builderForValue.build()); + onChanged(); + } else { + issuesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Array of issues found in the analyzed document.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Issue issues = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllIssues( + java.lang.Iterable values) { + if (issuesBuilder_ == null) { + ensureIssuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, issues_); + onChanged(); + } else { + issuesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Optional. Array of issues found in the analyzed document.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Issue issues = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearIssues() { + if (issuesBuilder_ == null) { + issues_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + issuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. Array of issues found in the analyzed document.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Issue issues = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeIssues(int index) { + if (issuesBuilder_ == null) { + ensureIssuesIsMutable(); + issues_.remove(index); + onChanged(); + } else { + issuesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Optional. Array of issues found in the analyzed document.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Issue issues = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.Issue.Builder getIssuesBuilder(int index) { + return getIssuesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Optional. Array of issues found in the analyzed document.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Issue issues = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.IssueOrBuilder getIssuesOrBuilder(int index) { + if (issuesBuilder_ == null) { + return issues_.get(index); + } else { + return issuesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Optional. Array of issues found in the analyzed document.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Issue issues = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getIssuesOrBuilderList() { + if (issuesBuilder_ != null) { + return issuesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(issues_); + } + } + /** + * + * + *
+     * Optional. Array of issues found in the analyzed document.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Issue issues = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.Issue.Builder addIssuesBuilder() { + return getIssuesFieldBuilder() + .addBuilder(com.google.cloud.apihub.v1.Issue.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. Array of issues found in the analyzed document.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Issue issues = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.Issue.Builder addIssuesBuilder(int index) { + return getIssuesFieldBuilder() + .addBuilder(index, com.google.cloud.apihub.v1.Issue.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. Array of issues found in the analyzed document.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.Issue issues = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List getIssuesBuilderList() { + return getIssuesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.Issue, + com.google.cloud.apihub.v1.Issue.Builder, + com.google.cloud.apihub.v1.IssueOrBuilder> + getIssuesFieldBuilder() { + if (issuesBuilder_ == null) { + issuesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.Issue, + com.google.cloud.apihub.v1.Issue.Builder, + com.google.cloud.apihub.v1.IssueOrBuilder>( + issues_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + issues_ = null; + } + return issuesBuilder_; + } + + private java.util.List summary_ = + java.util.Collections.emptyList(); + + private void ensureSummaryIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + summary_ = + new java.util.ArrayList(summary_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.LintResponse.SummaryEntry, + com.google.cloud.apihub.v1.LintResponse.SummaryEntry.Builder, + com.google.cloud.apihub.v1.LintResponse.SummaryEntryOrBuilder> + summaryBuilder_; + + /** + * + * + *
+     * Optional. Summary of all issue types and counts for each severity level.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.LintResponse.SummaryEntry summary = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List getSummaryList() { + if (summaryBuilder_ == null) { + return java.util.Collections.unmodifiableList(summary_); + } else { + return summaryBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Optional. Summary of all issue types and counts for each severity level.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.LintResponse.SummaryEntry summary = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getSummaryCount() { + if (summaryBuilder_ == null) { + return summary_.size(); + } else { + return summaryBuilder_.getCount(); + } + } + /** + * + * + *
+     * Optional. Summary of all issue types and counts for each severity level.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.LintResponse.SummaryEntry summary = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.LintResponse.SummaryEntry getSummary(int index) { + if (summaryBuilder_ == null) { + return summary_.get(index); + } else { + return summaryBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Optional. Summary of all issue types and counts for each severity level.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.LintResponse.SummaryEntry summary = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSummary( + int index, com.google.cloud.apihub.v1.LintResponse.SummaryEntry value) { + if (summaryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSummaryIsMutable(); + summary_.set(index, value); + onChanged(); + } else { + summaryBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. Summary of all issue types and counts for each severity level.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.LintResponse.SummaryEntry summary = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSummary( + int index, com.google.cloud.apihub.v1.LintResponse.SummaryEntry.Builder builderForValue) { + if (summaryBuilder_ == null) { + ensureSummaryIsMutable(); + summary_.set(index, builderForValue.build()); + onChanged(); + } else { + summaryBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Summary of all issue types and counts for each severity level.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.LintResponse.SummaryEntry summary = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSummary(com.google.cloud.apihub.v1.LintResponse.SummaryEntry value) { + if (summaryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSummaryIsMutable(); + summary_.add(value); + onChanged(); + } else { + summaryBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Optional. Summary of all issue types and counts for each severity level.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.LintResponse.SummaryEntry summary = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSummary( + int index, com.google.cloud.apihub.v1.LintResponse.SummaryEntry value) { + if (summaryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSummaryIsMutable(); + summary_.add(index, value); + onChanged(); + } else { + summaryBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. Summary of all issue types and counts for each severity level.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.LintResponse.SummaryEntry summary = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSummary( + com.google.cloud.apihub.v1.LintResponse.SummaryEntry.Builder builderForValue) { + if (summaryBuilder_ == null) { + ensureSummaryIsMutable(); + summary_.add(builderForValue.build()); + onChanged(); + } else { + summaryBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Summary of all issue types and counts for each severity level.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.LintResponse.SummaryEntry summary = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSummary( + int index, com.google.cloud.apihub.v1.LintResponse.SummaryEntry.Builder builderForValue) { + if (summaryBuilder_ == null) { + ensureSummaryIsMutable(); + summary_.add(index, builderForValue.build()); + onChanged(); + } else { + summaryBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Summary of all issue types and counts for each severity level.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.LintResponse.SummaryEntry summary = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllSummary( + java.lang.Iterable values) { + if (summaryBuilder_ == null) { + ensureSummaryIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, summary_); + onChanged(); + } else { + summaryBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Optional. Summary of all issue types and counts for each severity level.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.LintResponse.SummaryEntry summary = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearSummary() { + if (summaryBuilder_ == null) { + summary_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + summaryBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. Summary of all issue types and counts for each severity level.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.LintResponse.SummaryEntry summary = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeSummary(int index) { + if (summaryBuilder_ == null) { + ensureSummaryIsMutable(); + summary_.remove(index); + onChanged(); + } else { + summaryBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Optional. Summary of all issue types and counts for each severity level.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.LintResponse.SummaryEntry summary = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.LintResponse.SummaryEntry.Builder getSummaryBuilder( + int index) { + return getSummaryFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Optional. Summary of all issue types and counts for each severity level.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.LintResponse.SummaryEntry summary = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.LintResponse.SummaryEntryOrBuilder getSummaryOrBuilder( + int index) { + if (summaryBuilder_ == null) { + return summary_.get(index); + } else { + return summaryBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Optional. Summary of all issue types and counts for each severity level.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.LintResponse.SummaryEntry summary = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getSummaryOrBuilderList() { + if (summaryBuilder_ != null) { + return summaryBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(summary_); + } + } + /** + * + * + *
+     * Optional. Summary of all issue types and counts for each severity level.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.LintResponse.SummaryEntry summary = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.LintResponse.SummaryEntry.Builder addSummaryBuilder() { + return getSummaryFieldBuilder() + .addBuilder(com.google.cloud.apihub.v1.LintResponse.SummaryEntry.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. Summary of all issue types and counts for each severity level.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.LintResponse.SummaryEntry summary = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.LintResponse.SummaryEntry.Builder addSummaryBuilder( + int index) { + return getSummaryFieldBuilder() + .addBuilder( + index, com.google.cloud.apihub.v1.LintResponse.SummaryEntry.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. Summary of all issue types and counts for each severity level.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.LintResponse.SummaryEntry summary = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getSummaryBuilderList() { + return getSummaryFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.LintResponse.SummaryEntry, + com.google.cloud.apihub.v1.LintResponse.SummaryEntry.Builder, + com.google.cloud.apihub.v1.LintResponse.SummaryEntryOrBuilder> + getSummaryFieldBuilder() { + if (summaryBuilder_ == null) { + summaryBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.LintResponse.SummaryEntry, + com.google.cloud.apihub.v1.LintResponse.SummaryEntry.Builder, + com.google.cloud.apihub.v1.LintResponse.SummaryEntryOrBuilder>( + summary_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + summary_ = null; + } + return summaryBuilder_; + } + + private int state_ = 0; + /** + * + * + *
+     * Required. Lint state represents success or failure for linting.
+     * 
+ * + * .google.cloud.apihub.v1.LintState state = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Required. Lint state represents success or failure for linting.
+     * 
+ * + * .google.cloud.apihub.v1.LintState state = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Lint state represents success or failure for linting.
+     * 
+ * + * .google.cloud.apihub.v1.LintState state = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.LintState getState() { + com.google.cloud.apihub.v1.LintState result = + com.google.cloud.apihub.v1.LintState.forNumber(state_); + return result == null ? com.google.cloud.apihub.v1.LintState.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Required. Lint state represents success or failure for linting.
+     * 
+ * + * .google.cloud.apihub.v1.LintState state = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.apihub.v1.LintState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Lint state represents success or failure for linting.
+     * 
+ * + * .google.cloud.apihub.v1.LintState state = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000004); + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object source_ = ""; + /** + * + * + *
+     * Required. Name of the linting application.
+     * 
+ * + * string source = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The source. + */ + public java.lang.String getSource() { + java.lang.Object ref = source_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + source_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the linting application.
+     * 
+ * + * string source = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for source. + */ + public com.google.protobuf.ByteString getSourceBytes() { + java.lang.Object ref = source_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + source_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the linting application.
+     * 
+ * + * string source = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The source to set. + * @return This builder for chaining. + */ + public Builder setSource(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the linting application.
+     * 
+ * + * string source = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearSource() { + source_ = getDefaultInstance().getSource(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the linting application.
+     * 
+ * + * string source = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for source to set. + * @return This builder for chaining. + */ + public Builder setSourceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + source_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private int linter_ = 0; + /** + * + * + *
+     * Required. Name of the linter used.
+     * 
+ * + * .google.cloud.apihub.v1.Linter linter = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for linter. + */ + @java.lang.Override + public int getLinterValue() { + return linter_; + } + /** + * + * + *
+     * Required. Name of the linter used.
+     * 
+ * + * .google.cloud.apihub.v1.Linter linter = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for linter to set. + * @return This builder for chaining. + */ + public Builder setLinterValue(int value) { + linter_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the linter used.
+     * 
+ * + * .google.cloud.apihub.v1.Linter linter = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The linter. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Linter getLinter() { + com.google.cloud.apihub.v1.Linter result = + com.google.cloud.apihub.v1.Linter.forNumber(linter_); + return result == null ? com.google.cloud.apihub.v1.Linter.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Required. Name of the linter used.
+     * 
+ * + * .google.cloud.apihub.v1.Linter linter = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The linter to set. + * @return This builder for chaining. + */ + public Builder setLinter(com.google.cloud.apihub.v1.Linter value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + linter_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the linter used.
+     * 
+ * + * .google.cloud.apihub.v1.Linter linter = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearLinter() { + bitField0_ = (bitField0_ & ~0x00000010); + linter_ = 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_; + /** + * + * + *
+     * Required. Timestamp when the linting response was generated.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Required. Timestamp when the linting response was generated.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Required. Timestamp when the linting response was generated.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Timestamp when the linting response was generated.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Timestamp when the linting response was generated.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. Timestamp when the linting response was generated.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000020); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Timestamp when the linting response was generated.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Timestamp when the linting response was generated.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Required. Timestamp when the linting response was generated.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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_; + } + + @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.apihub.v1.LintResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.LintResponse) + private static final com.google.cloud.apihub.v1.LintResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.LintResponse(); + } + + public static com.google.cloud.apihub.v1.LintResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LintResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.LintResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LintResponseOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LintResponseOrBuilder.java new file mode 100644 index 000000000000..4968d9693702 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LintResponseOrBuilder.java @@ -0,0 +1,266 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface LintResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.LintResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Array of issues found in the analyzed document.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.Issue issues = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getIssuesList(); + /** + * + * + *
+   * Optional. Array of issues found in the analyzed document.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.Issue issues = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.Issue getIssues(int index); + /** + * + * + *
+   * Optional. Array of issues found in the analyzed document.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.Issue issues = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getIssuesCount(); + /** + * + * + *
+   * Optional. Array of issues found in the analyzed document.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.Issue issues = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getIssuesOrBuilderList(); + /** + * + * + *
+   * Optional. Array of issues found in the analyzed document.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.Issue issues = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.IssueOrBuilder getIssuesOrBuilder(int index); + + /** + * + * + *
+   * Optional. Summary of all issue types and counts for each severity level.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.LintResponse.SummaryEntry summary = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getSummaryList(); + /** + * + * + *
+   * Optional. Summary of all issue types and counts for each severity level.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.LintResponse.SummaryEntry summary = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.LintResponse.SummaryEntry getSummary(int index); + /** + * + * + *
+   * Optional. Summary of all issue types and counts for each severity level.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.LintResponse.SummaryEntry summary = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getSummaryCount(); + /** + * + * + *
+   * Optional. Summary of all issue types and counts for each severity level.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.LintResponse.SummaryEntry summary = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getSummaryOrBuilderList(); + /** + * + * + *
+   * Optional. Summary of all issue types and counts for each severity level.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.LintResponse.SummaryEntry summary = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.LintResponse.SummaryEntryOrBuilder getSummaryOrBuilder(int index); + + /** + * + * + *
+   * Required. Lint state represents success or failure for linting.
+   * 
+ * + * .google.cloud.apihub.v1.LintState state = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Required. Lint state represents success or failure for linting.
+   * 
+ * + * .google.cloud.apihub.v1.LintState state = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The state. + */ + com.google.cloud.apihub.v1.LintState getState(); + + /** + * + * + *
+   * Required. Name of the linting application.
+   * 
+ * + * string source = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The source. + */ + java.lang.String getSource(); + /** + * + * + *
+   * Required. Name of the linting application.
+   * 
+ * + * string source = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for source. + */ + com.google.protobuf.ByteString getSourceBytes(); + + /** + * + * + *
+   * Required. Name of the linter used.
+   * 
+ * + * .google.cloud.apihub.v1.Linter linter = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for linter. + */ + int getLinterValue(); + /** + * + * + *
+   * Required. Name of the linter used.
+   * 
+ * + * .google.cloud.apihub.v1.Linter linter = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The linter. + */ + com.google.cloud.apihub.v1.Linter getLinter(); + + /** + * + * + *
+   * Required. Timestamp when the linting response was generated.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Required. Timestamp when the linting response was generated.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Required. Timestamp when the linting response was generated.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LintSpecRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LintSpecRequest.java new file mode 100644 index 000000000000..bfd0060e5256 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LintSpecRequest.java @@ -0,0 +1,652 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/linting_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [LintSpec][ApiHub.LintSpec] method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.LintSpecRequest} + */ +public final class LintSpecRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.LintSpecRequest) + LintSpecRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use LintSpecRequest.newBuilder() to construct. + private LintSpecRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LintSpecRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LintSpecRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_LintSpecRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_LintSpecRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.LintSpecRequest.class, + com.google.cloud.apihub.v1.LintSpecRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the spec to be linted.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * 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 spec to be linted.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.apihub.v1.LintSpecRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.LintSpecRequest other = + (com.google.cloud.apihub.v1.LintSpecRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.LintSpecRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.LintSpecRequest 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.apihub.v1.LintSpecRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.LintSpecRequest 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.apihub.v1.LintSpecRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.LintSpecRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.LintSpecRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.LintSpecRequest 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.apihub.v1.LintSpecRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.LintSpecRequest 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.apihub.v1.LintSpecRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.LintSpecRequest 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.apihub.v1.LintSpecRequest 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 [LintSpec][ApiHub.LintSpec] method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.LintSpecRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.LintSpecRequest) + com.google.cloud.apihub.v1.LintSpecRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_LintSpecRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_LintSpecRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.LintSpecRequest.class, + com.google.cloud.apihub.v1.LintSpecRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.LintSpecRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_LintSpecRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.LintSpecRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.LintSpecRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.LintSpecRequest build() { + com.google.cloud.apihub.v1.LintSpecRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.LintSpecRequest buildPartial() { + com.google.cloud.apihub.v1.LintSpecRequest result = + new com.google.cloud.apihub.v1.LintSpecRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.LintSpecRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.apihub.v1.LintSpecRequest) { + return mergeFrom((com.google.cloud.apihub.v1.LintSpecRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.LintSpecRequest other) { + if (other == com.google.cloud.apihub.v1.LintSpecRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the spec to be linted.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * 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 spec to be linted.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * 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 spec to be linted.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the spec to be linted.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the spec to be linted.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.apihub.v1.LintSpecRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.LintSpecRequest) + private static final com.google.cloud.apihub.v1.LintSpecRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.LintSpecRequest(); + } + + public static com.google.cloud.apihub.v1.LintSpecRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LintSpecRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.LintSpecRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LintSpecRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LintSpecRequestOrBuilder.java new file mode 100644 index 000000000000..ece164d37b7f --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LintSpecRequestOrBuilder.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/linting_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface LintSpecRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.LintSpecRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the spec to be linted.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the spec to be linted.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * 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-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LintState.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LintState.java new file mode 100644 index 000000000000..b75141b89bd6 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LintState.java @@ -0,0 +1,177 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * Lint state represents success or failure for linting.
+ * 
+ * + * Protobuf enum {@code google.cloud.apihub.v1.LintState} + */ +public enum LintState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Lint state unspecified.
+   * 
+ * + * LINT_STATE_UNSPECIFIED = 0; + */ + LINT_STATE_UNSPECIFIED(0), + /** + * + * + *
+   * Linting was completed successfully.
+   * 
+ * + * LINT_STATE_SUCCESS = 1; + */ + LINT_STATE_SUCCESS(1), + /** + * + * + *
+   * Linting encountered errors.
+   * 
+ * + * LINT_STATE_ERROR = 2; + */ + LINT_STATE_ERROR(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Lint state unspecified.
+   * 
+ * + * LINT_STATE_UNSPECIFIED = 0; + */ + public static final int LINT_STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Linting was completed successfully.
+   * 
+ * + * LINT_STATE_SUCCESS = 1; + */ + public static final int LINT_STATE_SUCCESS_VALUE = 1; + /** + * + * + *
+   * Linting encountered errors.
+   * 
+ * + * LINT_STATE_ERROR = 2; + */ + public static final int LINT_STATE_ERROR_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 LintState 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 LintState forNumber(int value) { + switch (value) { + case 0: + return LINT_STATE_UNSPECIFIED; + case 1: + return LINT_STATE_SUCCESS; + case 2: + return LINT_STATE_ERROR; + 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 LintState findValueByNumber(int number) { + return LintState.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.apihub.v1.CommonFieldsProto.getDescriptor().getEnumTypes().get(0); + } + + private static final LintState[] VALUES = values(); + + public static LintState 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 LintState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.apihub.v1.LintState) +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Linter.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Linter.java new file mode 100644 index 000000000000..741e71ddbbbc --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Linter.java @@ -0,0 +1,177 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * Enumeration of linter types.
+ * 
+ * + * Protobuf enum {@code google.cloud.apihub.v1.Linter} + */ +public enum Linter implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Linter type unspecified.
+   * 
+ * + * LINTER_UNSPECIFIED = 0; + */ + LINTER_UNSPECIFIED(0), + /** + * + * + *
+   * Linter type spectral.
+   * 
+ * + * SPECTRAL = 1; + */ + SPECTRAL(1), + /** + * + * + *
+   * Linter type other.
+   * 
+ * + * OTHER = 2; + */ + OTHER(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Linter type unspecified.
+   * 
+ * + * LINTER_UNSPECIFIED = 0; + */ + public static final int LINTER_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Linter type spectral.
+   * 
+ * + * SPECTRAL = 1; + */ + public static final int SPECTRAL_VALUE = 1; + /** + * + * + *
+   * Linter type other.
+   * 
+ * + * OTHER = 2; + */ + public static final int OTHER_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 Linter 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 Linter forNumber(int value) { + switch (value) { + case 0: + return LINTER_UNSPECIFIED; + case 1: + return SPECTRAL; + case 2: + return OTHER; + 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 Linter findValueByNumber(int number) { + return Linter.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.apihub.v1.CommonFieldsProto.getDescriptor().getEnumTypes().get(1); + } + + private static final Linter[] VALUES = values(); + + public static Linter 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 Linter(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.apihub.v1.Linter) +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LintingServiceProto.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LintingServiceProto.java new file mode 100644 index 000000000000..a22a103115d7 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LintingServiceProto.java @@ -0,0 +1,198 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/linting_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public final class LintingServiceProto { + private LintingServiceProto() {} + + 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_apihub_v1_GetStyleGuideRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_GetStyleGuideRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_UpdateStyleGuideRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_UpdateStyleGuideRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_GetStyleGuideContentsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_GetStyleGuideContentsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_LintSpecRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_LintSpecRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_StyleGuideContents_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_StyleGuideContents_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_StyleGuide_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_StyleGuide_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/apihub/v1/linting_service" + + ".proto\022\026google.cloud.apihub.v1\032\034google/a" + + "pi/annotations.proto\032\027google/api/client." + + "proto\032\037google/api/field_behavior.proto\032\031" + + "google/api/resource.proto\032*google/cloud/" + + "apihub/v1/common_fields.proto\032\033google/pr" + + "otobuf/empty.proto\032 google/protobuf/fiel" + + "d_mask.proto\"N\n\024GetStyleGuideRequest\0226\n\004" + + "name\030\001 \001(\tB(\340A\002\372A\"\n apihub.googleapis.co" + + "m/StyleGuide\"\215\001\n\027UpdateStyleGuideRequest" + + "\022<\n\013style_guide\030\001 \001(\0132\".google.cloud.api" + + "hub.v1.StyleGuideB\003\340A\002\0224\n\013update_mask\030\002 " + + "\001(\0132\032.google.protobuf.FieldMaskB\003\340A\001\"V\n\034" + + "GetStyleGuideContentsRequest\0226\n\004name\030\001 \001" + + "(\tB(\340A\002\372A\"\n apihub.googleapis.com/StyleG" + + "uide\"C\n\017LintSpecRequest\0220\n\004name\030\001 \001(\tB\"\340" + + "A\002\372A\034\n\032apihub.googleapis.com/Spec\"C\n\022Sty" + + "leGuideContents\022\025\n\010contents\030\001 \001(\014B\003\340A\002\022\026" + + "\n\tmime_type\030\002 \001(\tB\003\340A\002\"\241\002\n\nStyleGuide\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\010\0223\n\006linter\030\002 \001(\0162\036.googl" + + "e.cloud.apihub.v1.LinterB\003\340A\002\022D\n\010content" + + "s\030\003 \001(\0132*.google.cloud.apihub.v1.StyleGu" + + "ideContentsB\006\340A\002\340A\004:\204\001\352A\200\001\n apihub.googl" + + "eapis.com/StyleGuide\022Cprojects/{project}" + + "/locations/{location}/plugins/{plugin}/s" + + "tyleGuide*\013styleGuides2\nstyleGuide2\312\006\n\016L" + + "intingService\022\250\001\n\rGetStyleGuide\022,.google" + + ".cloud.apihub.v1.GetStyleGuideRequest\032\"." + + "google.cloud.apihub.v1.StyleGuide\"E\332A\004na" + + "me\202\323\344\223\0028\0226/v1/{name=projects/*/locations" + + "/*/plugins/*/styleGuide}\022\332\001\n\020UpdateStyle" + + "Guide\022/.google.cloud.apihub.v1.UpdateSty" + + "leGuideRequest\032\".google.cloud.apihub.v1." + + "StyleGuide\"q\332A\027style_guide,update_mask\202\323" + + "\344\223\002Q2B/v1/{style_guide.name=projects/*/l" + + "ocations/*/plugins/*/styleGuide}:\013style_" + + "guide\022\311\001\n\025GetStyleGuideContents\0224.google" + + ".cloud.apihub.v1.GetStyleGuideContentsRe" + + "quest\032*.google.cloud.apihub.v1.StyleGuid" + + "eContents\"N\332A\004name\202\323\344\223\002A\022?/v1/{name=proj" + + "ects/*/locations/*/plugins/*/styleGuide}" + + ":contents\022\230\001\n\010LintSpec\022\'.google.cloud.ap" + + "ihub.v1.LintSpecRequest\032\026.google.protobu" + + "f.Empty\"K\202\323\344\223\002E\"@/v1/{name=projects/*/lo" + + "cations/*/apis/*/versions/*/specs/*}:lin" + + "t:\001*\032I\312A\025apihub.googleapis.com\322A.https:/" + + "/www.googleapis.com/auth/cloud-platformB" + + "\265\001\n\032com.google.cloud.apihub.v1B\023LintingS" + + "erviceProtoP\001Z2cloud.google.com/go/apihu" + + "b/apiv1/apihubpb;apihubpb\252\002\026Google.Cloud" + + ".ApiHub.V1\312\002\026Google\\Cloud\\ApiHub\\V1\352\002\031Go" + + "ogle::Cloud::ApiHub::V1b\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.cloud.apihub.v1.CommonFieldsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }); + internal_static_google_cloud_apihub_v1_GetStyleGuideRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_apihub_v1_GetStyleGuideRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_GetStyleGuideRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_apihub_v1_UpdateStyleGuideRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_apihub_v1_UpdateStyleGuideRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_UpdateStyleGuideRequest_descriptor, + new java.lang.String[] { + "StyleGuide", "UpdateMask", + }); + internal_static_google_cloud_apihub_v1_GetStyleGuideContentsRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_apihub_v1_GetStyleGuideContentsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_GetStyleGuideContentsRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_apihub_v1_LintSpecRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_apihub_v1_LintSpecRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_LintSpecRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_apihub_v1_StyleGuideContents_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_apihub_v1_StyleGuideContents_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_StyleGuideContents_descriptor, + new java.lang.String[] { + "Contents", "MimeType", + }); + internal_static_google_cloud_apihub_v1_StyleGuide_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_apihub_v1_StyleGuide_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_StyleGuide_descriptor, + new java.lang.String[] { + "Name", "Linter", "Contents", + }); + 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.cloud.apihub.v1.CommonFieldsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApiOperationsRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApiOperationsRequest.java new file mode 100644 index 000000000000..8289b8235a02 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApiOperationsRequest.java @@ -0,0 +1,1425 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [ListApiOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
+ * method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListApiOperationsRequest} + */ +public final class ListApiOperationsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.ListApiOperationsRequest) + ListApiOperationsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListApiOperationsRequest.newBuilder() to construct. + private ListApiOperationsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListApiOperationsRequest() { + parent_ = ""; + filter_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListApiOperationsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListApiOperationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListApiOperationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListApiOperationsRequest.class, + com.google.cloud.apihub.v1.ListApiOperationsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent which owns this collection of operations i.e., the API
+   * version. Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * 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 parent which owns this collection of operations i.e., the API
+   * version. Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * 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 FILTER_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. An expression that filters the list of ApiOperations.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string or a
+   * boolean. The comparison operator must be one of: `<`, `>` or
+   * `=`. Filters are not case sensitive.
+   *
+   * The following fields in the `ApiOperation` are eligible for filtering:
+   *   * `name` - The ApiOperation resource name. Allowed comparison
+   *   operators:
+   *   `=`.
+   *   * `details.http_operation.path.path` - The http operation's complete path
+   *   relative to server endpoint. Allowed comparison operators: `=`.
+   *   * `details.http_operation.method` - The http operation method type.
+   *   Allowed comparison operators: `=`.
+   *   * `details.deprecated` - Indicates if the ApiOperation is deprecated.
+   *   Allowed values are True / False indicating the deprycation status of the
+   *   ApiOperation. Allowed comparison operators: `=`.
+   *   * `create_time` - The time at which the ApiOperation was created. The
+   *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+   *   format. Allowed comparison operators: `>` and `<`.
+   *
+   * Expressions are combined with either `AND` logic operator or `OR` logical
+   * operator but not both of them together i.e. only one of the `AND` or `OR`
+   * operator can be used throughout the filter string and both the operators
+   * cannot be used together. No other logical operators are supported. At most
+   * three filter fields are allowed in the filter string and if provided
+   * more than that then `INVALID_ARGUMENT` error is returned by the API.
+   *
+   * Here are a few examples:
+   *
+   *   * `details.deprecated = True` -  The ApiOperation is deprecated.
+   *   * `details.http_operation.method = GET AND create_time <
+   *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+   *   The method of the http operation of the ApiOperation is _GET_ and the
+   *   spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10
+   *   12:00:00 UTC_.
+   *   * `details.http_operation.method = GET OR details.http_operation.method =
+   *   POST`. - The http operation of the method of ApiOperation is _GET_ or
+   *   _POST_.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + 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(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An expression that filters the list of ApiOperations.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string or a
+   * boolean. The comparison operator must be one of: `<`, `>` or
+   * `=`. Filters are not case sensitive.
+   *
+   * The following fields in the `ApiOperation` are eligible for filtering:
+   *   * `name` - The ApiOperation resource name. Allowed comparison
+   *   operators:
+   *   `=`.
+   *   * `details.http_operation.path.path` - The http operation's complete path
+   *   relative to server endpoint. Allowed comparison operators: `=`.
+   *   * `details.http_operation.method` - The http operation method type.
+   *   Allowed comparison operators: `=`.
+   *   * `details.deprecated` - Indicates if the ApiOperation is deprecated.
+   *   Allowed values are True / False indicating the deprycation status of the
+   *   ApiOperation. Allowed comparison operators: `=`.
+   *   * `create_time` - The time at which the ApiOperation was created. The
+   *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+   *   format. Allowed comparison operators: `>` and `<`.
+   *
+   * Expressions are combined with either `AND` logic operator or `OR` logical
+   * operator but not both of them together i.e. only one of the `AND` or `OR`
+   * operator can be used throughout the filter string and both the operators
+   * cannot be used together. No other logical operators are supported. At most
+   * three filter fields are allowed in the filter string and if provided
+   * more than that then `INVALID_ARGUMENT` error is returned by the API.
+   *
+   * Here are a few examples:
+   *
+   *   * `details.deprecated = True` -  The ApiOperation is deprecated.
+   *   * `details.http_operation.method = GET AND create_time <
+   *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+   *   The method of the http operation of the ApiOperation is _GET_ and the
+   *   spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10
+   *   12:00:00 UTC_.
+   *   * `details.http_operation.method = GET OR details.http_operation.method =
+   *   POST`. - The http operation of the method of ApiOperation is _GET_ or
+   *   _POST_.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_ = 0; + /** + * + * + *
+   * Optional. The maximum number of operations to return. The service may
+   * return fewer than this value. If unspecified, at most 50 operations will be
+   * returned. The maximum value is 1000; values above 1000 will be coerced to
+   * 1000.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Optional. A page token, received from a previous `ListApiOperations` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters (except page_size) provided to
+   * `ListApiOperations` must match the call that provided the page token.
+   * 
+ * + * string page_token = 4 [(.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 page token, received from a previous `ListApiOperations` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters (except page_size) provided to
+   * `ListApiOperations` must match the call that provided the page token.
+   * 
+ * + * string page_token = 4 [(.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + size += getUnknownFields().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.apihub.v1.ListApiOperationsRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.ListApiOperationsRequest other = + (com.google.cloud.apihub.v1.ListApiOperationsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.ListApiOperationsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListApiOperationsRequest 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.apihub.v1.ListApiOperationsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListApiOperationsRequest 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.apihub.v1.ListApiOperationsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListApiOperationsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.ListApiOperationsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListApiOperationsRequest 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.apihub.v1.ListApiOperationsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListApiOperationsRequest 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.apihub.v1.ListApiOperationsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListApiOperationsRequest 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.apihub.v1.ListApiOperationsRequest 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 [ListApiOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
+   * method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListApiOperationsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.ListApiOperationsRequest) + com.google.cloud.apihub.v1.ListApiOperationsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListApiOperationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListApiOperationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListApiOperationsRequest.class, + com.google.cloud.apihub.v1.ListApiOperationsRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.ListApiOperationsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + filter_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListApiOperationsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListApiOperationsRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.ListApiOperationsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListApiOperationsRequest build() { + com.google.cloud.apihub.v1.ListApiOperationsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListApiOperationsRequest buildPartial() { + com.google.cloud.apihub.v1.ListApiOperationsRequest result = + new com.google.cloud.apihub.v1.ListApiOperationsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.ListApiOperationsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @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.apihub.v1.ListApiOperationsRequest) { + return mergeFrom((com.google.cloud.apihub.v1.ListApiOperationsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.ListApiOperationsRequest other) { + if (other == com.google.cloud.apihub.v1.ListApiOperationsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent which owns this collection of operations i.e., the API
+     * version. Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * 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 parent which owns this collection of operations i.e., the API
+     * version. Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * 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 parent which owns this collection of operations i.e., the API
+     * version. Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent which owns this collection of operations i.e., the API
+     * version. Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent which owns this collection of operations i.e., the API
+     * version. Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. An expression that filters the list of ApiOperations.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string or a
+     * boolean. The comparison operator must be one of: `<`, `>` or
+     * `=`. Filters are not case sensitive.
+     *
+     * The following fields in the `ApiOperation` are eligible for filtering:
+     *   * `name` - The ApiOperation resource name. Allowed comparison
+     *   operators:
+     *   `=`.
+     *   * `details.http_operation.path.path` - The http operation's complete path
+     *   relative to server endpoint. Allowed comparison operators: `=`.
+     *   * `details.http_operation.method` - The http operation method type.
+     *   Allowed comparison operators: `=`.
+     *   * `details.deprecated` - Indicates if the ApiOperation is deprecated.
+     *   Allowed values are True / False indicating the deprycation status of the
+     *   ApiOperation. Allowed comparison operators: `=`.
+     *   * `create_time` - The time at which the ApiOperation was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are supported. At most
+     * three filter fields are allowed in the filter string and if provided
+     * more than that then `INVALID_ARGUMENT` error is returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `details.deprecated = True` -  The ApiOperation is deprecated.
+     *   * `details.http_operation.method = GET AND create_time <
+     *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+     *   The method of the http operation of the ApiOperation is _GET_ and the
+     *   spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10
+     *   12:00:00 UTC_.
+     *   * `details.http_operation.method = GET OR details.http_operation.method =
+     *   POST`. - The http operation of the method of ApiOperation is _GET_ or
+     *   _POST_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An expression that filters the list of ApiOperations.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string or a
+     * boolean. The comparison operator must be one of: `<`, `>` or
+     * `=`. Filters are not case sensitive.
+     *
+     * The following fields in the `ApiOperation` are eligible for filtering:
+     *   * `name` - The ApiOperation resource name. Allowed comparison
+     *   operators:
+     *   `=`.
+     *   * `details.http_operation.path.path` - The http operation's complete path
+     *   relative to server endpoint. Allowed comparison operators: `=`.
+     *   * `details.http_operation.method` - The http operation method type.
+     *   Allowed comparison operators: `=`.
+     *   * `details.deprecated` - Indicates if the ApiOperation is deprecated.
+     *   Allowed values are True / False indicating the deprycation status of the
+     *   ApiOperation. Allowed comparison operators: `=`.
+     *   * `create_time` - The time at which the ApiOperation was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are supported. At most
+     * three filter fields are allowed in the filter string and if provided
+     * more than that then `INVALID_ARGUMENT` error is returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `details.deprecated = True` -  The ApiOperation is deprecated.
+     *   * `details.http_operation.method = GET AND create_time <
+     *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+     *   The method of the http operation of the ApiOperation is _GET_ and the
+     *   spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10
+     *   12:00:00 UTC_.
+     *   * `details.http_operation.method = GET OR details.http_operation.method =
+     *   POST`. - The http operation of the method of ApiOperation is _GET_ or
+     *   _POST_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An expression that filters the list of ApiOperations.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string or a
+     * boolean. The comparison operator must be one of: `<`, `>` or
+     * `=`. Filters are not case sensitive.
+     *
+     * The following fields in the `ApiOperation` are eligible for filtering:
+     *   * `name` - The ApiOperation resource name. Allowed comparison
+     *   operators:
+     *   `=`.
+     *   * `details.http_operation.path.path` - The http operation's complete path
+     *   relative to server endpoint. Allowed comparison operators: `=`.
+     *   * `details.http_operation.method` - The http operation method type.
+     *   Allowed comparison operators: `=`.
+     *   * `details.deprecated` - Indicates if the ApiOperation is deprecated.
+     *   Allowed values are True / False indicating the deprycation status of the
+     *   ApiOperation. Allowed comparison operators: `=`.
+     *   * `create_time` - The time at which the ApiOperation was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are supported. At most
+     * three filter fields are allowed in the filter string and if provided
+     * more than that then `INVALID_ARGUMENT` error is returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `details.deprecated = True` -  The ApiOperation is deprecated.
+     *   * `details.http_operation.method = GET AND create_time <
+     *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+     *   The method of the http operation of the ApiOperation is _GET_ and the
+     *   spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10
+     *   12:00:00 UTC_.
+     *   * `details.http_operation.method = GET OR details.http_operation.method =
+     *   POST`. - The http operation of the method of ApiOperation is _GET_ or
+     *   _POST_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An expression that filters the list of ApiOperations.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string or a
+     * boolean. The comparison operator must be one of: `<`, `>` or
+     * `=`. Filters are not case sensitive.
+     *
+     * The following fields in the `ApiOperation` are eligible for filtering:
+     *   * `name` - The ApiOperation resource name. Allowed comparison
+     *   operators:
+     *   `=`.
+     *   * `details.http_operation.path.path` - The http operation's complete path
+     *   relative to server endpoint. Allowed comparison operators: `=`.
+     *   * `details.http_operation.method` - The http operation method type.
+     *   Allowed comparison operators: `=`.
+     *   * `details.deprecated` - Indicates if the ApiOperation is deprecated.
+     *   Allowed values are True / False indicating the deprycation status of the
+     *   ApiOperation. Allowed comparison operators: `=`.
+     *   * `create_time` - The time at which the ApiOperation was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are supported. At most
+     * three filter fields are allowed in the filter string and if provided
+     * more than that then `INVALID_ARGUMENT` error is returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `details.deprecated = True` -  The ApiOperation is deprecated.
+     *   * `details.http_operation.method = GET AND create_time <
+     *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+     *   The method of the http operation of the ApiOperation is _GET_ and the
+     *   spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10
+     *   12:00:00 UTC_.
+     *   * `details.http_operation.method = GET OR details.http_operation.method =
+     *   POST`. - The http operation of the method of ApiOperation is _GET_ or
+     *   _POST_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An expression that filters the list of ApiOperations.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string or a
+     * boolean. The comparison operator must be one of: `<`, `>` or
+     * `=`. Filters are not case sensitive.
+     *
+     * The following fields in the `ApiOperation` are eligible for filtering:
+     *   * `name` - The ApiOperation resource name. Allowed comparison
+     *   operators:
+     *   `=`.
+     *   * `details.http_operation.path.path` - The http operation's complete path
+     *   relative to server endpoint. Allowed comparison operators: `=`.
+     *   * `details.http_operation.method` - The http operation method type.
+     *   Allowed comparison operators: `=`.
+     *   * `details.deprecated` - Indicates if the ApiOperation is deprecated.
+     *   Allowed values are True / False indicating the deprycation status of the
+     *   ApiOperation. Allowed comparison operators: `=`.
+     *   * `create_time` - The time at which the ApiOperation was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are supported. At most
+     * three filter fields are allowed in the filter string and if provided
+     * more than that then `INVALID_ARGUMENT` error is returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `details.deprecated = True` -  The ApiOperation is deprecated.
+     *   * `details.http_operation.method = GET AND create_time <
+     *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+     *   The method of the http operation of the ApiOperation is _GET_ and the
+     *   spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10
+     *   12:00:00 UTC_.
+     *   * `details.http_operation.method = GET OR details.http_operation.method =
+     *   POST`. - The http operation of the method of ApiOperation is _GET_ or
+     *   _POST_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of operations to return. The service may
+     * return fewer than this value. If unspecified, at most 50 operations will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * 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 operations to return. The service may
+     * return fewer than this value. If unspecified, at most 50 operations will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of operations to return. The service may
+     * return fewer than this value. If unspecified, at most 50 operations will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000004); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A page token, received from a previous `ListApiOperations` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListApiOperations` must match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.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 page token, received from a previous `ListApiOperations` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListApiOperations` must match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.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 page token, received from a previous `ListApiOperations` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListApiOperations` must match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous `ListApiOperations` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListApiOperations` must match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous `ListApiOperations` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListApiOperations` must match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.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; + bitField0_ |= 0x00000008; + 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.apihub.v1.ListApiOperationsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.ListApiOperationsRequest) + private static final com.google.cloud.apihub.v1.ListApiOperationsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.ListApiOperationsRequest(); + } + + public static com.google.cloud.apihub.v1.ListApiOperationsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListApiOperationsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.ListApiOperationsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApiOperationsRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApiOperationsRequestOrBuilder.java new file mode 100644 index 000000000000..0608d7af93fb --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApiOperationsRequestOrBuilder.java @@ -0,0 +1,211 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface ListApiOperationsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.ListApiOperationsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent which owns this collection of operations i.e., the API
+   * version. Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent which owns this collection of operations i.e., the API
+   * version. Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. An expression that filters the list of ApiOperations.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string or a
+   * boolean. The comparison operator must be one of: `<`, `>` or
+   * `=`. Filters are not case sensitive.
+   *
+   * The following fields in the `ApiOperation` are eligible for filtering:
+   *   * `name` - The ApiOperation resource name. Allowed comparison
+   *   operators:
+   *   `=`.
+   *   * `details.http_operation.path.path` - The http operation's complete path
+   *   relative to server endpoint. Allowed comparison operators: `=`.
+   *   * `details.http_operation.method` - The http operation method type.
+   *   Allowed comparison operators: `=`.
+   *   * `details.deprecated` - Indicates if the ApiOperation is deprecated.
+   *   Allowed values are True / False indicating the deprycation status of the
+   *   ApiOperation. Allowed comparison operators: `=`.
+   *   * `create_time` - The time at which the ApiOperation was created. The
+   *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+   *   format. Allowed comparison operators: `>` and `<`.
+   *
+   * Expressions are combined with either `AND` logic operator or `OR` logical
+   * operator but not both of them together i.e. only one of the `AND` or `OR`
+   * operator can be used throughout the filter string and both the operators
+   * cannot be used together. No other logical operators are supported. At most
+   * three filter fields are allowed in the filter string and if provided
+   * more than that then `INVALID_ARGUMENT` error is returned by the API.
+   *
+   * Here are a few examples:
+   *
+   *   * `details.deprecated = True` -  The ApiOperation is deprecated.
+   *   * `details.http_operation.method = GET AND create_time <
+   *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+   *   The method of the http operation of the ApiOperation is _GET_ and the
+   *   spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10
+   *   12:00:00 UTC_.
+   *   * `details.http_operation.method = GET OR details.http_operation.method =
+   *   POST`. - The http operation of the method of ApiOperation is _GET_ or
+   *   _POST_.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. An expression that filters the list of ApiOperations.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string or a
+   * boolean. The comparison operator must be one of: `<`, `>` or
+   * `=`. Filters are not case sensitive.
+   *
+   * The following fields in the `ApiOperation` are eligible for filtering:
+   *   * `name` - The ApiOperation resource name. Allowed comparison
+   *   operators:
+   *   `=`.
+   *   * `details.http_operation.path.path` - The http operation's complete path
+   *   relative to server endpoint. Allowed comparison operators: `=`.
+   *   * `details.http_operation.method` - The http operation method type.
+   *   Allowed comparison operators: `=`.
+   *   * `details.deprecated` - Indicates if the ApiOperation is deprecated.
+   *   Allowed values are True / False indicating the deprycation status of the
+   *   ApiOperation. Allowed comparison operators: `=`.
+   *   * `create_time` - The time at which the ApiOperation was created. The
+   *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+   *   format. Allowed comparison operators: `>` and `<`.
+   *
+   * Expressions are combined with either `AND` logic operator or `OR` logical
+   * operator but not both of them together i.e. only one of the `AND` or `OR`
+   * operator can be used throughout the filter string and both the operators
+   * cannot be used together. No other logical operators are supported. At most
+   * three filter fields are allowed in the filter string and if provided
+   * more than that then `INVALID_ARGUMENT` error is returned by the API.
+   *
+   * Here are a few examples:
+   *
+   *   * `details.deprecated = True` -  The ApiOperation is deprecated.
+   *   * `details.http_operation.method = GET AND create_time <
+   *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+   *   The method of the http operation of the ApiOperation is _GET_ and the
+   *   spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10
+   *   12:00:00 UTC_.
+   *   * `details.http_operation.method = GET OR details.http_operation.method =
+   *   POST`. - The http operation of the method of ApiOperation is _GET_ or
+   *   _POST_.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. The maximum number of operations to return. The service may
+   * return fewer than this value. If unspecified, at most 50 operations will be
+   * returned. The maximum value is 1000; values above 1000 will be coerced to
+   * 1000.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListApiOperations` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters (except page_size) provided to
+   * `ListApiOperations` must match the call that provided the page token.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A page token, received from a previous `ListApiOperations` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters (except page_size) provided to
+   * `ListApiOperations` must match the call that provided the page token.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApiOperationsResponse.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApiOperationsResponse.java new file mode 100644 index 000000000000..e496e15c9453 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApiOperationsResponse.java @@ -0,0 +1,1201 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [ListApiOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
+ * method's response.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListApiOperationsResponse} + */ +public final class ListApiOperationsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.ListApiOperationsResponse) + ListApiOperationsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListApiOperationsResponse.newBuilder() to construct. + private ListApiOperationsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListApiOperationsResponse() { + apiOperations_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListApiOperationsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListApiOperationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListApiOperationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListApiOperationsResponse.class, + com.google.cloud.apihub.v1.ListApiOperationsResponse.Builder.class); + } + + public static final int API_OPERATIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List apiOperations_; + /** + * + * + *
+   * The operations corresponding to an API version.
+   * Only following field will be populated in the response: name,
+   * spec, details.deprecated, details.http_operation.path.path,
+   * details.http_operation.method and details.documentation.external_uri.
+   * 
+ * + * repeated .google.cloud.apihub.v1.ApiOperation api_operations = 1; + */ + @java.lang.Override + public java.util.List getApiOperationsList() { + return apiOperations_; + } + /** + * + * + *
+   * The operations corresponding to an API version.
+   * Only following field will be populated in the response: name,
+   * spec, details.deprecated, details.http_operation.path.path,
+   * details.http_operation.method and details.documentation.external_uri.
+   * 
+ * + * repeated .google.cloud.apihub.v1.ApiOperation api_operations = 1; + */ + @java.lang.Override + public java.util.List + getApiOperationsOrBuilderList() { + return apiOperations_; + } + /** + * + * + *
+   * The operations corresponding to an API version.
+   * Only following field will be populated in the response: name,
+   * spec, details.deprecated, details.http_operation.path.path,
+   * details.http_operation.method and details.documentation.external_uri.
+   * 
+ * + * repeated .google.cloud.apihub.v1.ApiOperation api_operations = 1; + */ + @java.lang.Override + public int getApiOperationsCount() { + return apiOperations_.size(); + } + /** + * + * + *
+   * The operations corresponding to an API version.
+   * Only following field will be populated in the response: name,
+   * spec, details.deprecated, details.http_operation.path.path,
+   * details.http_operation.method and details.documentation.external_uri.
+   * 
+ * + * repeated .google.cloud.apihub.v1.ApiOperation api_operations = 1; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.ApiOperation getApiOperations(int index) { + return apiOperations_.get(index); + } + /** + * + * + *
+   * The operations corresponding to an API version.
+   * Only following field will be populated in the response: name,
+   * spec, details.deprecated, details.http_operation.path.path,
+   * details.http_operation.method and details.documentation.external_uri.
+   * 
+ * + * repeated .google.cloud.apihub.v1.ApiOperation api_operations = 1; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.ApiOperationOrBuilder getApiOperationsOrBuilder(int index) { + return apiOperations_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * 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 < apiOperations_.size(); i++) { + output.writeMessage(1, apiOperations_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < apiOperations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, apiOperations_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().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.apihub.v1.ListApiOperationsResponse)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.ListApiOperationsResponse other = + (com.google.cloud.apihub.v1.ListApiOperationsResponse) obj; + + if (!getApiOperationsList().equals(other.getApiOperationsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getApiOperationsCount() > 0) { + hash = (37 * hash) + API_OPERATIONS_FIELD_NUMBER; + hash = (53 * hash) + getApiOperationsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.ListApiOperationsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListApiOperationsResponse 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.apihub.v1.ListApiOperationsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListApiOperationsResponse 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.apihub.v1.ListApiOperationsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListApiOperationsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.ListApiOperationsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListApiOperationsResponse 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.apihub.v1.ListApiOperationsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListApiOperationsResponse 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.apihub.v1.ListApiOperationsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListApiOperationsResponse 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.apihub.v1.ListApiOperationsResponse 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 [ListApiOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
+   * method's response.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListApiOperationsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.ListApiOperationsResponse) + com.google.cloud.apihub.v1.ListApiOperationsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListApiOperationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListApiOperationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListApiOperationsResponse.class, + com.google.cloud.apihub.v1.ListApiOperationsResponse.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.ListApiOperationsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (apiOperationsBuilder_ == null) { + apiOperations_ = java.util.Collections.emptyList(); + } else { + apiOperations_ = null; + apiOperationsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListApiOperationsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListApiOperationsResponse getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.ListApiOperationsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListApiOperationsResponse build() { + com.google.cloud.apihub.v1.ListApiOperationsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListApiOperationsResponse buildPartial() { + com.google.cloud.apihub.v1.ListApiOperationsResponse result = + new com.google.cloud.apihub.v1.ListApiOperationsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.apihub.v1.ListApiOperationsResponse result) { + if (apiOperationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + apiOperations_ = java.util.Collections.unmodifiableList(apiOperations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.apiOperations_ = apiOperations_; + } else { + result.apiOperations_ = apiOperationsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.apihub.v1.ListApiOperationsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.apihub.v1.ListApiOperationsResponse) { + return mergeFrom((com.google.cloud.apihub.v1.ListApiOperationsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.ListApiOperationsResponse other) { + if (other == com.google.cloud.apihub.v1.ListApiOperationsResponse.getDefaultInstance()) + return this; + if (apiOperationsBuilder_ == null) { + if (!other.apiOperations_.isEmpty()) { + if (apiOperations_.isEmpty()) { + apiOperations_ = other.apiOperations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureApiOperationsIsMutable(); + apiOperations_.addAll(other.apiOperations_); + } + onChanged(); + } + } else { + if (!other.apiOperations_.isEmpty()) { + if (apiOperationsBuilder_.isEmpty()) { + apiOperationsBuilder_.dispose(); + apiOperationsBuilder_ = null; + apiOperations_ = other.apiOperations_; + bitField0_ = (bitField0_ & ~0x00000001); + apiOperationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getApiOperationsFieldBuilder() + : null; + } else { + apiOperationsBuilder_.addAllMessages(other.apiOperations_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.apihub.v1.ApiOperation m = + input.readMessage( + com.google.cloud.apihub.v1.ApiOperation.parser(), extensionRegistry); + if (apiOperationsBuilder_ == null) { + ensureApiOperationsIsMutable(); + apiOperations_.add(m); + } else { + apiOperationsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List apiOperations_ = + java.util.Collections.emptyList(); + + private void ensureApiOperationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + apiOperations_ = + new java.util.ArrayList(apiOperations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.ApiOperation, + com.google.cloud.apihub.v1.ApiOperation.Builder, + com.google.cloud.apihub.v1.ApiOperationOrBuilder> + apiOperationsBuilder_; + + /** + * + * + *
+     * The operations corresponding to an API version.
+     * Only following field will be populated in the response: name,
+     * spec, details.deprecated, details.http_operation.path.path,
+     * details.http_operation.method and details.documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ApiOperation api_operations = 1; + */ + public java.util.List getApiOperationsList() { + if (apiOperationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(apiOperations_); + } else { + return apiOperationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The operations corresponding to an API version.
+     * Only following field will be populated in the response: name,
+     * spec, details.deprecated, details.http_operation.path.path,
+     * details.http_operation.method and details.documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ApiOperation api_operations = 1; + */ + public int getApiOperationsCount() { + if (apiOperationsBuilder_ == null) { + return apiOperations_.size(); + } else { + return apiOperationsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The operations corresponding to an API version.
+     * Only following field will be populated in the response: name,
+     * spec, details.deprecated, details.http_operation.path.path,
+     * details.http_operation.method and details.documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ApiOperation api_operations = 1; + */ + public com.google.cloud.apihub.v1.ApiOperation getApiOperations(int index) { + if (apiOperationsBuilder_ == null) { + return apiOperations_.get(index); + } else { + return apiOperationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The operations corresponding to an API version.
+     * Only following field will be populated in the response: name,
+     * spec, details.deprecated, details.http_operation.path.path,
+     * details.http_operation.method and details.documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ApiOperation api_operations = 1; + */ + public Builder setApiOperations(int index, com.google.cloud.apihub.v1.ApiOperation value) { + if (apiOperationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureApiOperationsIsMutable(); + apiOperations_.set(index, value); + onChanged(); + } else { + apiOperationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The operations corresponding to an API version.
+     * Only following field will be populated in the response: name,
+     * spec, details.deprecated, details.http_operation.path.path,
+     * details.http_operation.method and details.documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ApiOperation api_operations = 1; + */ + public Builder setApiOperations( + int index, com.google.cloud.apihub.v1.ApiOperation.Builder builderForValue) { + if (apiOperationsBuilder_ == null) { + ensureApiOperationsIsMutable(); + apiOperations_.set(index, builderForValue.build()); + onChanged(); + } else { + apiOperationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The operations corresponding to an API version.
+     * Only following field will be populated in the response: name,
+     * spec, details.deprecated, details.http_operation.path.path,
+     * details.http_operation.method and details.documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ApiOperation api_operations = 1; + */ + public Builder addApiOperations(com.google.cloud.apihub.v1.ApiOperation value) { + if (apiOperationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureApiOperationsIsMutable(); + apiOperations_.add(value); + onChanged(); + } else { + apiOperationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The operations corresponding to an API version.
+     * Only following field will be populated in the response: name,
+     * spec, details.deprecated, details.http_operation.path.path,
+     * details.http_operation.method and details.documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ApiOperation api_operations = 1; + */ + public Builder addApiOperations(int index, com.google.cloud.apihub.v1.ApiOperation value) { + if (apiOperationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureApiOperationsIsMutable(); + apiOperations_.add(index, value); + onChanged(); + } else { + apiOperationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The operations corresponding to an API version.
+     * Only following field will be populated in the response: name,
+     * spec, details.deprecated, details.http_operation.path.path,
+     * details.http_operation.method and details.documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ApiOperation api_operations = 1; + */ + public Builder addApiOperations( + com.google.cloud.apihub.v1.ApiOperation.Builder builderForValue) { + if (apiOperationsBuilder_ == null) { + ensureApiOperationsIsMutable(); + apiOperations_.add(builderForValue.build()); + onChanged(); + } else { + apiOperationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The operations corresponding to an API version.
+     * Only following field will be populated in the response: name,
+     * spec, details.deprecated, details.http_operation.path.path,
+     * details.http_operation.method and details.documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ApiOperation api_operations = 1; + */ + public Builder addApiOperations( + int index, com.google.cloud.apihub.v1.ApiOperation.Builder builderForValue) { + if (apiOperationsBuilder_ == null) { + ensureApiOperationsIsMutable(); + apiOperations_.add(index, builderForValue.build()); + onChanged(); + } else { + apiOperationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The operations corresponding to an API version.
+     * Only following field will be populated in the response: name,
+     * spec, details.deprecated, details.http_operation.path.path,
+     * details.http_operation.method and details.documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ApiOperation api_operations = 1; + */ + public Builder addAllApiOperations( + java.lang.Iterable values) { + if (apiOperationsBuilder_ == null) { + ensureApiOperationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, apiOperations_); + onChanged(); + } else { + apiOperationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The operations corresponding to an API version.
+     * Only following field will be populated in the response: name,
+     * spec, details.deprecated, details.http_operation.path.path,
+     * details.http_operation.method and details.documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ApiOperation api_operations = 1; + */ + public Builder clearApiOperations() { + if (apiOperationsBuilder_ == null) { + apiOperations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + apiOperationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The operations corresponding to an API version.
+     * Only following field will be populated in the response: name,
+     * spec, details.deprecated, details.http_operation.path.path,
+     * details.http_operation.method and details.documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ApiOperation api_operations = 1; + */ + public Builder removeApiOperations(int index) { + if (apiOperationsBuilder_ == null) { + ensureApiOperationsIsMutable(); + apiOperations_.remove(index); + onChanged(); + } else { + apiOperationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The operations corresponding to an API version.
+     * Only following field will be populated in the response: name,
+     * spec, details.deprecated, details.http_operation.path.path,
+     * details.http_operation.method and details.documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ApiOperation api_operations = 1; + */ + public com.google.cloud.apihub.v1.ApiOperation.Builder getApiOperationsBuilder(int index) { + return getApiOperationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The operations corresponding to an API version.
+     * Only following field will be populated in the response: name,
+     * spec, details.deprecated, details.http_operation.path.path,
+     * details.http_operation.method and details.documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ApiOperation api_operations = 1; + */ + public com.google.cloud.apihub.v1.ApiOperationOrBuilder getApiOperationsOrBuilder(int index) { + if (apiOperationsBuilder_ == null) { + return apiOperations_.get(index); + } else { + return apiOperationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The operations corresponding to an API version.
+     * Only following field will be populated in the response: name,
+     * spec, details.deprecated, details.http_operation.path.path,
+     * details.http_operation.method and details.documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ApiOperation api_operations = 1; + */ + public java.util.List + getApiOperationsOrBuilderList() { + if (apiOperationsBuilder_ != null) { + return apiOperationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(apiOperations_); + } + } + /** + * + * + *
+     * The operations corresponding to an API version.
+     * Only following field will be populated in the response: name,
+     * spec, details.deprecated, details.http_operation.path.path,
+     * details.http_operation.method and details.documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ApiOperation api_operations = 1; + */ + public com.google.cloud.apihub.v1.ApiOperation.Builder addApiOperationsBuilder() { + return getApiOperationsFieldBuilder() + .addBuilder(com.google.cloud.apihub.v1.ApiOperation.getDefaultInstance()); + } + /** + * + * + *
+     * The operations corresponding to an API version.
+     * Only following field will be populated in the response: name,
+     * spec, details.deprecated, details.http_operation.path.path,
+     * details.http_operation.method and details.documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ApiOperation api_operations = 1; + */ + public com.google.cloud.apihub.v1.ApiOperation.Builder addApiOperationsBuilder(int index) { + return getApiOperationsFieldBuilder() + .addBuilder(index, com.google.cloud.apihub.v1.ApiOperation.getDefaultInstance()); + } + /** + * + * + *
+     * The operations corresponding to an API version.
+     * Only following field will be populated in the response: name,
+     * spec, details.deprecated, details.http_operation.path.path,
+     * details.http_operation.method and details.documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ApiOperation api_operations = 1; + */ + public java.util.List + getApiOperationsBuilderList() { + return getApiOperationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.ApiOperation, + com.google.cloud.apihub.v1.ApiOperation.Builder, + com.google.cloud.apihub.v1.ApiOperationOrBuilder> + getApiOperationsFieldBuilder() { + if (apiOperationsBuilder_ == null) { + apiOperationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.ApiOperation, + com.google.cloud.apihub.v1.ApiOperation.Builder, + com.google.cloud.apihub.v1.ApiOperationOrBuilder>( + apiOperations_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + apiOperations_ = null; + } + return apiOperationsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + 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.apihub.v1.ListApiOperationsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.ListApiOperationsResponse) + private static final com.google.cloud.apihub.v1.ListApiOperationsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.ListApiOperationsResponse(); + } + + public static com.google.cloud.apihub.v1.ListApiOperationsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListApiOperationsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.ListApiOperationsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApiOperationsResponseOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApiOperationsResponseOrBuilder.java new file mode 100644 index 000000000000..da5646d6e3ea --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApiOperationsResponseOrBuilder.java @@ -0,0 +1,120 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface ListApiOperationsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.ListApiOperationsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The operations corresponding to an API version.
+   * Only following field will be populated in the response: name,
+   * spec, details.deprecated, details.http_operation.path.path,
+   * details.http_operation.method and details.documentation.external_uri.
+   * 
+ * + * repeated .google.cloud.apihub.v1.ApiOperation api_operations = 1; + */ + java.util.List getApiOperationsList(); + /** + * + * + *
+   * The operations corresponding to an API version.
+   * Only following field will be populated in the response: name,
+   * spec, details.deprecated, details.http_operation.path.path,
+   * details.http_operation.method and details.documentation.external_uri.
+   * 
+ * + * repeated .google.cloud.apihub.v1.ApiOperation api_operations = 1; + */ + com.google.cloud.apihub.v1.ApiOperation getApiOperations(int index); + /** + * + * + *
+   * The operations corresponding to an API version.
+   * Only following field will be populated in the response: name,
+   * spec, details.deprecated, details.http_operation.path.path,
+   * details.http_operation.method and details.documentation.external_uri.
+   * 
+ * + * repeated .google.cloud.apihub.v1.ApiOperation api_operations = 1; + */ + int getApiOperationsCount(); + /** + * + * + *
+   * The operations corresponding to an API version.
+   * Only following field will be populated in the response: name,
+   * spec, details.deprecated, details.http_operation.path.path,
+   * details.http_operation.method and details.documentation.external_uri.
+   * 
+ * + * repeated .google.cloud.apihub.v1.ApiOperation api_operations = 1; + */ + java.util.List + getApiOperationsOrBuilderList(); + /** + * + * + *
+   * The operations corresponding to an API version.
+   * Only following field will be populated in the response: name,
+   * spec, details.deprecated, details.http_operation.path.path,
+   * details.http_operation.method and details.documentation.external_uri.
+   * 
+ * + * repeated .google.cloud.apihub.v1.ApiOperation api_operations = 1; + */ + com.google.cloud.apihub.v1.ApiOperationOrBuilder getApiOperationsOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApisRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApisRequest.java new file mode 100644 index 000000000000..5068d9942e12 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApisRequest.java @@ -0,0 +1,1632 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [ListApis][google.cloud.apihub.v1.ApiHub.ListApis] method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListApisRequest} + */ +public final class ListApisRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.ListApisRequest) + ListApisRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListApisRequest.newBuilder() to construct. + private ListApisRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListApisRequest() { + parent_ = ""; + filter_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListApisRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListApisRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListApisRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListApisRequest.class, + com.google.cloud.apihub.v1.ListApisRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent, which owns this collection of API resources.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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 parent, which owns this collection of API resources.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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 FILTER_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. An expression that filters the list of ApiResources.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string. The
+   * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not
+   * case sensitive.
+   *
+   * The following fields in the `ApiResource` are eligible for filtering:
+   *
+   *   * `owner.email` - The email of the team which owns the ApiResource.
+   *   Allowed comparison operators: `=`.
+   *   * `create_time` - The time at which the ApiResource was created. The
+   *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+   *   format. Allowed comparison operators: `>` and `<`.
+   *   * `display_name` - The display name of the ApiResource. Allowed
+   *   comparison operators: `=`.
+   *   * `target_user.enum_values.values.id` - The allowed value id of the
+   *   target users attribute associated with the ApiResource. Allowed
+   *   comparison operator is `:`.
+   *   * `target_user.enum_values.values.display_name` - The allowed value
+   *   display name of the target users attribute associated with the
+   *   ApiResource. Allowed comparison operator is `:`.
+   *   * `team.enum_values.values.id` - The allowed value id of the team
+   *   attribute associated with the ApiResource. Allowed comparison operator is
+   *   `:`.
+   *   * `team.enum_values.values.display_name` - The allowed value display name
+   *   of the team attribute associated with the ApiResource. Allowed comparison
+   *   operator is `:`.
+   *   * `business_unit.enum_values.values.id` - The allowed value id of the
+   *   business unit attribute associated with the ApiResource. Allowed
+   *   comparison operator is `:`.
+   *   * `business_unit.enum_values.values.display_name` - The allowed value
+   *   display name of the business unit attribute associated with the
+   *   ApiResource. Allowed comparison operator is `:`.
+   *   * `maturity_level.enum_values.values.id` - The allowed value id of the
+   *   maturity level attribute associated with the ApiResource. Allowed
+   *   comparison operator is `:`.
+   *   * `maturity_level.enum_values.values.display_name` - The allowed value
+   *   display name of the maturity level attribute associated with the
+   *   ApiResource. Allowed comparison operator is `:`.
+   *   * `api_style.enum_values.values.id` - The allowed value id of the
+   *   api style attribute associated with the ApiResource. Allowed
+   *   comparison operator is `:`.
+   *   * `api_style.enum_values.values.display_name` - The allowed value display
+   *   name of the api style attribute associated with the ApiResource. Allowed
+   *   comparison operator is `:`.
+   *
+   * Expressions are combined with either `AND` logic operator or `OR` logical
+   * operator but not both of them together i.e. only one of the `AND` or `OR`
+   * operator can be used throughout the filter string and both the operators
+   * cannot be used together. No other logical operators are supported. At most
+   * three filter fields are allowed in the filter string and if provided
+   * more than that then `INVALID_ARGUMENT` error is returned by the API.
+   *
+   * Here are a few examples:
+   *
+   *   * `owner.email = \"apihub@google.com\"` -  - The owner team email is
+   *   _apihub@google.com_.
+   *   * `owner.email = \"apihub@google.com\" AND create_time <
+   *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+   *   The owner team email is _apihub@google.com_ and the api was created
+   *   before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
+   *   * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id:
+   *   apihub-team-id` - The filter string specifies the APIs where the owner
+   *   team email is _apihub@google.com_ or the id of the allowed value
+   *   associated with the team attribute is _apihub-team-id_.
+   *   * `owner.email = \"apihub@google.com\" OR
+   *   team.enum_values.values.display_name: ApiHub Team` - The filter string
+   *   specifies the APIs where the owner team email is _apihub@google.com_ or
+   *   the display name of the allowed value associated with the team attribute
+   *   is `ApiHub Team`.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + 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(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An expression that filters the list of ApiResources.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string. The
+   * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not
+   * case sensitive.
+   *
+   * The following fields in the `ApiResource` are eligible for filtering:
+   *
+   *   * `owner.email` - The email of the team which owns the ApiResource.
+   *   Allowed comparison operators: `=`.
+   *   * `create_time` - The time at which the ApiResource was created. The
+   *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+   *   format. Allowed comparison operators: `>` and `<`.
+   *   * `display_name` - The display name of the ApiResource. Allowed
+   *   comparison operators: `=`.
+   *   * `target_user.enum_values.values.id` - The allowed value id of the
+   *   target users attribute associated with the ApiResource. Allowed
+   *   comparison operator is `:`.
+   *   * `target_user.enum_values.values.display_name` - The allowed value
+   *   display name of the target users attribute associated with the
+   *   ApiResource. Allowed comparison operator is `:`.
+   *   * `team.enum_values.values.id` - The allowed value id of the team
+   *   attribute associated with the ApiResource. Allowed comparison operator is
+   *   `:`.
+   *   * `team.enum_values.values.display_name` - The allowed value display name
+   *   of the team attribute associated with the ApiResource. Allowed comparison
+   *   operator is `:`.
+   *   * `business_unit.enum_values.values.id` - The allowed value id of the
+   *   business unit attribute associated with the ApiResource. Allowed
+   *   comparison operator is `:`.
+   *   * `business_unit.enum_values.values.display_name` - The allowed value
+   *   display name of the business unit attribute associated with the
+   *   ApiResource. Allowed comparison operator is `:`.
+   *   * `maturity_level.enum_values.values.id` - The allowed value id of the
+   *   maturity level attribute associated with the ApiResource. Allowed
+   *   comparison operator is `:`.
+   *   * `maturity_level.enum_values.values.display_name` - The allowed value
+   *   display name of the maturity level attribute associated with the
+   *   ApiResource. Allowed comparison operator is `:`.
+   *   * `api_style.enum_values.values.id` - The allowed value id of the
+   *   api style attribute associated with the ApiResource. Allowed
+   *   comparison operator is `:`.
+   *   * `api_style.enum_values.values.display_name` - The allowed value display
+   *   name of the api style attribute associated with the ApiResource. Allowed
+   *   comparison operator is `:`.
+   *
+   * Expressions are combined with either `AND` logic operator or `OR` logical
+   * operator but not both of them together i.e. only one of the `AND` or `OR`
+   * operator can be used throughout the filter string and both the operators
+   * cannot be used together. No other logical operators are supported. At most
+   * three filter fields are allowed in the filter string and if provided
+   * more than that then `INVALID_ARGUMENT` error is returned by the API.
+   *
+   * Here are a few examples:
+   *
+   *   * `owner.email = \"apihub@google.com\"` -  - The owner team email is
+   *   _apihub@google.com_.
+   *   * `owner.email = \"apihub@google.com\" AND create_time <
+   *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+   *   The owner team email is _apihub@google.com_ and the api was created
+   *   before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
+   *   * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id:
+   *   apihub-team-id` - The filter string specifies the APIs where the owner
+   *   team email is _apihub@google.com_ or the id of the allowed value
+   *   associated with the team attribute is _apihub-team-id_.
+   *   * `owner.email = \"apihub@google.com\" OR
+   *   team.enum_values.values.display_name: ApiHub Team` - The filter string
+   *   specifies the APIs where the owner team email is _apihub@google.com_ or
+   *   the display name of the allowed value associated with the team attribute
+   *   is `ApiHub Team`.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_ = 0; + /** + * + * + *
+   * Optional. The maximum number of API resources to return. The service may
+   * return fewer than this value. If unspecified, at most 50 Apis will be
+   * returned. The maximum value is 1000; values above 1000 will be coerced to
+   * 1000.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Optional. A page token, received from a previous `ListApis` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters (except page_size) provided to
+   * `ListApis` must match the call that provided the page token.
+   * 
+ * + * string page_token = 4 [(.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 page token, received from a previous `ListApis` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters (except page_size) provided to
+   * `ListApis` must match the call that provided the page token.
+   * 
+ * + * string page_token = 4 [(.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + size += getUnknownFields().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.apihub.v1.ListApisRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.ListApisRequest other = + (com.google.cloud.apihub.v1.ListApisRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.ListApisRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListApisRequest 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.apihub.v1.ListApisRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListApisRequest 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.apihub.v1.ListApisRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListApisRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.ListApisRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListApisRequest 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.apihub.v1.ListApisRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListApisRequest 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.apihub.v1.ListApisRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListApisRequest 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.apihub.v1.ListApisRequest 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 [ListApis][google.cloud.apihub.v1.ApiHub.ListApis] method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListApisRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.ListApisRequest) + com.google.cloud.apihub.v1.ListApisRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListApisRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListApisRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListApisRequest.class, + com.google.cloud.apihub.v1.ListApisRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.ListApisRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + filter_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListApisRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListApisRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.ListApisRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListApisRequest build() { + com.google.cloud.apihub.v1.ListApisRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListApisRequest buildPartial() { + com.google.cloud.apihub.v1.ListApisRequest result = + new com.google.cloud.apihub.v1.ListApisRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.ListApisRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @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.apihub.v1.ListApisRequest) { + return mergeFrom((com.google.cloud.apihub.v1.ListApisRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.ListApisRequest other) { + if (other == com.google.cloud.apihub.v1.ListApisRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent, which owns this collection of API resources.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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 parent, which owns this collection of API resources.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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 parent, which owns this collection of API resources.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent, which owns this collection of API resources.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent, which owns this collection of API resources.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. An expression that filters the list of ApiResources.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string. The
+     * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not
+     * case sensitive.
+     *
+     * The following fields in the `ApiResource` are eligible for filtering:
+     *
+     *   * `owner.email` - The email of the team which owns the ApiResource.
+     *   Allowed comparison operators: `=`.
+     *   * `create_time` - The time at which the ApiResource was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *   * `display_name` - The display name of the ApiResource. Allowed
+     *   comparison operators: `=`.
+     *   * `target_user.enum_values.values.id` - The allowed value id of the
+     *   target users attribute associated with the ApiResource. Allowed
+     *   comparison operator is `:`.
+     *   * `target_user.enum_values.values.display_name` - The allowed value
+     *   display name of the target users attribute associated with the
+     *   ApiResource. Allowed comparison operator is `:`.
+     *   * `team.enum_values.values.id` - The allowed value id of the team
+     *   attribute associated with the ApiResource. Allowed comparison operator is
+     *   `:`.
+     *   * `team.enum_values.values.display_name` - The allowed value display name
+     *   of the team attribute associated with the ApiResource. Allowed comparison
+     *   operator is `:`.
+     *   * `business_unit.enum_values.values.id` - The allowed value id of the
+     *   business unit attribute associated with the ApiResource. Allowed
+     *   comparison operator is `:`.
+     *   * `business_unit.enum_values.values.display_name` - The allowed value
+     *   display name of the business unit attribute associated with the
+     *   ApiResource. Allowed comparison operator is `:`.
+     *   * `maturity_level.enum_values.values.id` - The allowed value id of the
+     *   maturity level attribute associated with the ApiResource. Allowed
+     *   comparison operator is `:`.
+     *   * `maturity_level.enum_values.values.display_name` - The allowed value
+     *   display name of the maturity level attribute associated with the
+     *   ApiResource. Allowed comparison operator is `:`.
+     *   * `api_style.enum_values.values.id` - The allowed value id of the
+     *   api style attribute associated with the ApiResource. Allowed
+     *   comparison operator is `:`.
+     *   * `api_style.enum_values.values.display_name` - The allowed value display
+     *   name of the api style attribute associated with the ApiResource. Allowed
+     *   comparison operator is `:`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are supported. At most
+     * three filter fields are allowed in the filter string and if provided
+     * more than that then `INVALID_ARGUMENT` error is returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `owner.email = \"apihub@google.com\"` -  - The owner team email is
+     *   _apihub@google.com_.
+     *   * `owner.email = \"apihub@google.com\" AND create_time <
+     *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+     *   The owner team email is _apihub@google.com_ and the api was created
+     *   before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
+     *   * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id:
+     *   apihub-team-id` - The filter string specifies the APIs where the owner
+     *   team email is _apihub@google.com_ or the id of the allowed value
+     *   associated with the team attribute is _apihub-team-id_.
+     *   * `owner.email = \"apihub@google.com\" OR
+     *   team.enum_values.values.display_name: ApiHub Team` - The filter string
+     *   specifies the APIs where the owner team email is _apihub@google.com_ or
+     *   the display name of the allowed value associated with the team attribute
+     *   is `ApiHub Team`.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An expression that filters the list of ApiResources.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string. The
+     * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not
+     * case sensitive.
+     *
+     * The following fields in the `ApiResource` are eligible for filtering:
+     *
+     *   * `owner.email` - The email of the team which owns the ApiResource.
+     *   Allowed comparison operators: `=`.
+     *   * `create_time` - The time at which the ApiResource was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *   * `display_name` - The display name of the ApiResource. Allowed
+     *   comparison operators: `=`.
+     *   * `target_user.enum_values.values.id` - The allowed value id of the
+     *   target users attribute associated with the ApiResource. Allowed
+     *   comparison operator is `:`.
+     *   * `target_user.enum_values.values.display_name` - The allowed value
+     *   display name of the target users attribute associated with the
+     *   ApiResource. Allowed comparison operator is `:`.
+     *   * `team.enum_values.values.id` - The allowed value id of the team
+     *   attribute associated with the ApiResource. Allowed comparison operator is
+     *   `:`.
+     *   * `team.enum_values.values.display_name` - The allowed value display name
+     *   of the team attribute associated with the ApiResource. Allowed comparison
+     *   operator is `:`.
+     *   * `business_unit.enum_values.values.id` - The allowed value id of the
+     *   business unit attribute associated with the ApiResource. Allowed
+     *   comparison operator is `:`.
+     *   * `business_unit.enum_values.values.display_name` - The allowed value
+     *   display name of the business unit attribute associated with the
+     *   ApiResource. Allowed comparison operator is `:`.
+     *   * `maturity_level.enum_values.values.id` - The allowed value id of the
+     *   maturity level attribute associated with the ApiResource. Allowed
+     *   comparison operator is `:`.
+     *   * `maturity_level.enum_values.values.display_name` - The allowed value
+     *   display name of the maturity level attribute associated with the
+     *   ApiResource. Allowed comparison operator is `:`.
+     *   * `api_style.enum_values.values.id` - The allowed value id of the
+     *   api style attribute associated with the ApiResource. Allowed
+     *   comparison operator is `:`.
+     *   * `api_style.enum_values.values.display_name` - The allowed value display
+     *   name of the api style attribute associated with the ApiResource. Allowed
+     *   comparison operator is `:`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are supported. At most
+     * three filter fields are allowed in the filter string and if provided
+     * more than that then `INVALID_ARGUMENT` error is returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `owner.email = \"apihub@google.com\"` -  - The owner team email is
+     *   _apihub@google.com_.
+     *   * `owner.email = \"apihub@google.com\" AND create_time <
+     *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+     *   The owner team email is _apihub@google.com_ and the api was created
+     *   before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
+     *   * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id:
+     *   apihub-team-id` - The filter string specifies the APIs where the owner
+     *   team email is _apihub@google.com_ or the id of the allowed value
+     *   associated with the team attribute is _apihub-team-id_.
+     *   * `owner.email = \"apihub@google.com\" OR
+     *   team.enum_values.values.display_name: ApiHub Team` - The filter string
+     *   specifies the APIs where the owner team email is _apihub@google.com_ or
+     *   the display name of the allowed value associated with the team attribute
+     *   is `ApiHub Team`.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An expression that filters the list of ApiResources.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string. The
+     * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not
+     * case sensitive.
+     *
+     * The following fields in the `ApiResource` are eligible for filtering:
+     *
+     *   * `owner.email` - The email of the team which owns the ApiResource.
+     *   Allowed comparison operators: `=`.
+     *   * `create_time` - The time at which the ApiResource was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *   * `display_name` - The display name of the ApiResource. Allowed
+     *   comparison operators: `=`.
+     *   * `target_user.enum_values.values.id` - The allowed value id of the
+     *   target users attribute associated with the ApiResource. Allowed
+     *   comparison operator is `:`.
+     *   * `target_user.enum_values.values.display_name` - The allowed value
+     *   display name of the target users attribute associated with the
+     *   ApiResource. Allowed comparison operator is `:`.
+     *   * `team.enum_values.values.id` - The allowed value id of the team
+     *   attribute associated with the ApiResource. Allowed comparison operator is
+     *   `:`.
+     *   * `team.enum_values.values.display_name` - The allowed value display name
+     *   of the team attribute associated with the ApiResource. Allowed comparison
+     *   operator is `:`.
+     *   * `business_unit.enum_values.values.id` - The allowed value id of the
+     *   business unit attribute associated with the ApiResource. Allowed
+     *   comparison operator is `:`.
+     *   * `business_unit.enum_values.values.display_name` - The allowed value
+     *   display name of the business unit attribute associated with the
+     *   ApiResource. Allowed comparison operator is `:`.
+     *   * `maturity_level.enum_values.values.id` - The allowed value id of the
+     *   maturity level attribute associated with the ApiResource. Allowed
+     *   comparison operator is `:`.
+     *   * `maturity_level.enum_values.values.display_name` - The allowed value
+     *   display name of the maturity level attribute associated with the
+     *   ApiResource. Allowed comparison operator is `:`.
+     *   * `api_style.enum_values.values.id` - The allowed value id of the
+     *   api style attribute associated with the ApiResource. Allowed
+     *   comparison operator is `:`.
+     *   * `api_style.enum_values.values.display_name` - The allowed value display
+     *   name of the api style attribute associated with the ApiResource. Allowed
+     *   comparison operator is `:`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are supported. At most
+     * three filter fields are allowed in the filter string and if provided
+     * more than that then `INVALID_ARGUMENT` error is returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `owner.email = \"apihub@google.com\"` -  - The owner team email is
+     *   _apihub@google.com_.
+     *   * `owner.email = \"apihub@google.com\" AND create_time <
+     *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+     *   The owner team email is _apihub@google.com_ and the api was created
+     *   before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
+     *   * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id:
+     *   apihub-team-id` - The filter string specifies the APIs where the owner
+     *   team email is _apihub@google.com_ or the id of the allowed value
+     *   associated with the team attribute is _apihub-team-id_.
+     *   * `owner.email = \"apihub@google.com\" OR
+     *   team.enum_values.values.display_name: ApiHub Team` - The filter string
+     *   specifies the APIs where the owner team email is _apihub@google.com_ or
+     *   the display name of the allowed value associated with the team attribute
+     *   is `ApiHub Team`.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An expression that filters the list of ApiResources.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string. The
+     * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not
+     * case sensitive.
+     *
+     * The following fields in the `ApiResource` are eligible for filtering:
+     *
+     *   * `owner.email` - The email of the team which owns the ApiResource.
+     *   Allowed comparison operators: `=`.
+     *   * `create_time` - The time at which the ApiResource was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *   * `display_name` - The display name of the ApiResource. Allowed
+     *   comparison operators: `=`.
+     *   * `target_user.enum_values.values.id` - The allowed value id of the
+     *   target users attribute associated with the ApiResource. Allowed
+     *   comparison operator is `:`.
+     *   * `target_user.enum_values.values.display_name` - The allowed value
+     *   display name of the target users attribute associated with the
+     *   ApiResource. Allowed comparison operator is `:`.
+     *   * `team.enum_values.values.id` - The allowed value id of the team
+     *   attribute associated with the ApiResource. Allowed comparison operator is
+     *   `:`.
+     *   * `team.enum_values.values.display_name` - The allowed value display name
+     *   of the team attribute associated with the ApiResource. Allowed comparison
+     *   operator is `:`.
+     *   * `business_unit.enum_values.values.id` - The allowed value id of the
+     *   business unit attribute associated with the ApiResource. Allowed
+     *   comparison operator is `:`.
+     *   * `business_unit.enum_values.values.display_name` - The allowed value
+     *   display name of the business unit attribute associated with the
+     *   ApiResource. Allowed comparison operator is `:`.
+     *   * `maturity_level.enum_values.values.id` - The allowed value id of the
+     *   maturity level attribute associated with the ApiResource. Allowed
+     *   comparison operator is `:`.
+     *   * `maturity_level.enum_values.values.display_name` - The allowed value
+     *   display name of the maturity level attribute associated with the
+     *   ApiResource. Allowed comparison operator is `:`.
+     *   * `api_style.enum_values.values.id` - The allowed value id of the
+     *   api style attribute associated with the ApiResource. Allowed
+     *   comparison operator is `:`.
+     *   * `api_style.enum_values.values.display_name` - The allowed value display
+     *   name of the api style attribute associated with the ApiResource. Allowed
+     *   comparison operator is `:`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are supported. At most
+     * three filter fields are allowed in the filter string and if provided
+     * more than that then `INVALID_ARGUMENT` error is returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `owner.email = \"apihub@google.com\"` -  - The owner team email is
+     *   _apihub@google.com_.
+     *   * `owner.email = \"apihub@google.com\" AND create_time <
+     *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+     *   The owner team email is _apihub@google.com_ and the api was created
+     *   before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
+     *   * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id:
+     *   apihub-team-id` - The filter string specifies the APIs where the owner
+     *   team email is _apihub@google.com_ or the id of the allowed value
+     *   associated with the team attribute is _apihub-team-id_.
+     *   * `owner.email = \"apihub@google.com\" OR
+     *   team.enum_values.values.display_name: ApiHub Team` - The filter string
+     *   specifies the APIs where the owner team email is _apihub@google.com_ or
+     *   the display name of the allowed value associated with the team attribute
+     *   is `ApiHub Team`.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An expression that filters the list of ApiResources.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string. The
+     * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not
+     * case sensitive.
+     *
+     * The following fields in the `ApiResource` are eligible for filtering:
+     *
+     *   * `owner.email` - The email of the team which owns the ApiResource.
+     *   Allowed comparison operators: `=`.
+     *   * `create_time` - The time at which the ApiResource was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *   * `display_name` - The display name of the ApiResource. Allowed
+     *   comparison operators: `=`.
+     *   * `target_user.enum_values.values.id` - The allowed value id of the
+     *   target users attribute associated with the ApiResource. Allowed
+     *   comparison operator is `:`.
+     *   * `target_user.enum_values.values.display_name` - The allowed value
+     *   display name of the target users attribute associated with the
+     *   ApiResource. Allowed comparison operator is `:`.
+     *   * `team.enum_values.values.id` - The allowed value id of the team
+     *   attribute associated with the ApiResource. Allowed comparison operator is
+     *   `:`.
+     *   * `team.enum_values.values.display_name` - The allowed value display name
+     *   of the team attribute associated with the ApiResource. Allowed comparison
+     *   operator is `:`.
+     *   * `business_unit.enum_values.values.id` - The allowed value id of the
+     *   business unit attribute associated with the ApiResource. Allowed
+     *   comparison operator is `:`.
+     *   * `business_unit.enum_values.values.display_name` - The allowed value
+     *   display name of the business unit attribute associated with the
+     *   ApiResource. Allowed comparison operator is `:`.
+     *   * `maturity_level.enum_values.values.id` - The allowed value id of the
+     *   maturity level attribute associated with the ApiResource. Allowed
+     *   comparison operator is `:`.
+     *   * `maturity_level.enum_values.values.display_name` - The allowed value
+     *   display name of the maturity level attribute associated with the
+     *   ApiResource. Allowed comparison operator is `:`.
+     *   * `api_style.enum_values.values.id` - The allowed value id of the
+     *   api style attribute associated with the ApiResource. Allowed
+     *   comparison operator is `:`.
+     *   * `api_style.enum_values.values.display_name` - The allowed value display
+     *   name of the api style attribute associated with the ApiResource. Allowed
+     *   comparison operator is `:`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are supported. At most
+     * three filter fields are allowed in the filter string and if provided
+     * more than that then `INVALID_ARGUMENT` error is returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `owner.email = \"apihub@google.com\"` -  - The owner team email is
+     *   _apihub@google.com_.
+     *   * `owner.email = \"apihub@google.com\" AND create_time <
+     *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+     *   The owner team email is _apihub@google.com_ and the api was created
+     *   before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
+     *   * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id:
+     *   apihub-team-id` - The filter string specifies the APIs where the owner
+     *   team email is _apihub@google.com_ or the id of the allowed value
+     *   associated with the team attribute is _apihub-team-id_.
+     *   * `owner.email = \"apihub@google.com\" OR
+     *   team.enum_values.values.display_name: ApiHub Team` - The filter string
+     *   specifies the APIs where the owner team email is _apihub@google.com_ or
+     *   the display name of the allowed value associated with the team attribute
+     *   is `ApiHub Team`.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of API resources to return. The service may
+     * return fewer than this value. If unspecified, at most 50 Apis will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * 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 API resources to return. The service may
+     * return fewer than this value. If unspecified, at most 50 Apis will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of API resources to return. The service may
+     * return fewer than this value. If unspecified, at most 50 Apis will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000004); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A page token, received from a previous `ListApis` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListApis` must match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.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 page token, received from a previous `ListApis` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListApis` must match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.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 page token, received from a previous `ListApis` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListApis` must match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous `ListApis` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListApis` must match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous `ListApis` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListApis` must match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.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; + bitField0_ |= 0x00000008; + 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.apihub.v1.ListApisRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.ListApisRequest) + private static final com.google.cloud.apihub.v1.ListApisRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.ListApisRequest(); + } + + public static com.google.cloud.apihub.v1.ListApisRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListApisRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.ListApisRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApisRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApisRequestOrBuilder.java new file mode 100644 index 000000000000..a39f45873123 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApisRequestOrBuilder.java @@ -0,0 +1,271 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface ListApisRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.ListApisRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent, which owns this collection of API resources.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent, which owns this collection of API resources.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. An expression that filters the list of ApiResources.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string. The
+   * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not
+   * case sensitive.
+   *
+   * The following fields in the `ApiResource` are eligible for filtering:
+   *
+   *   * `owner.email` - The email of the team which owns the ApiResource.
+   *   Allowed comparison operators: `=`.
+   *   * `create_time` - The time at which the ApiResource was created. The
+   *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+   *   format. Allowed comparison operators: `>` and `<`.
+   *   * `display_name` - The display name of the ApiResource. Allowed
+   *   comparison operators: `=`.
+   *   * `target_user.enum_values.values.id` - The allowed value id of the
+   *   target users attribute associated with the ApiResource. Allowed
+   *   comparison operator is `:`.
+   *   * `target_user.enum_values.values.display_name` - The allowed value
+   *   display name of the target users attribute associated with the
+   *   ApiResource. Allowed comparison operator is `:`.
+   *   * `team.enum_values.values.id` - The allowed value id of the team
+   *   attribute associated with the ApiResource. Allowed comparison operator is
+   *   `:`.
+   *   * `team.enum_values.values.display_name` - The allowed value display name
+   *   of the team attribute associated with the ApiResource. Allowed comparison
+   *   operator is `:`.
+   *   * `business_unit.enum_values.values.id` - The allowed value id of the
+   *   business unit attribute associated with the ApiResource. Allowed
+   *   comparison operator is `:`.
+   *   * `business_unit.enum_values.values.display_name` - The allowed value
+   *   display name of the business unit attribute associated with the
+   *   ApiResource. Allowed comparison operator is `:`.
+   *   * `maturity_level.enum_values.values.id` - The allowed value id of the
+   *   maturity level attribute associated with the ApiResource. Allowed
+   *   comparison operator is `:`.
+   *   * `maturity_level.enum_values.values.display_name` - The allowed value
+   *   display name of the maturity level attribute associated with the
+   *   ApiResource. Allowed comparison operator is `:`.
+   *   * `api_style.enum_values.values.id` - The allowed value id of the
+   *   api style attribute associated with the ApiResource. Allowed
+   *   comparison operator is `:`.
+   *   * `api_style.enum_values.values.display_name` - The allowed value display
+   *   name of the api style attribute associated with the ApiResource. Allowed
+   *   comparison operator is `:`.
+   *
+   * Expressions are combined with either `AND` logic operator or `OR` logical
+   * operator but not both of them together i.e. only one of the `AND` or `OR`
+   * operator can be used throughout the filter string and both the operators
+   * cannot be used together. No other logical operators are supported. At most
+   * three filter fields are allowed in the filter string and if provided
+   * more than that then `INVALID_ARGUMENT` error is returned by the API.
+   *
+   * Here are a few examples:
+   *
+   *   * `owner.email = \"apihub@google.com\"` -  - The owner team email is
+   *   _apihub@google.com_.
+   *   * `owner.email = \"apihub@google.com\" AND create_time <
+   *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+   *   The owner team email is _apihub@google.com_ and the api was created
+   *   before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
+   *   * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id:
+   *   apihub-team-id` - The filter string specifies the APIs where the owner
+   *   team email is _apihub@google.com_ or the id of the allowed value
+   *   associated with the team attribute is _apihub-team-id_.
+   *   * `owner.email = \"apihub@google.com\" OR
+   *   team.enum_values.values.display_name: ApiHub Team` - The filter string
+   *   specifies the APIs where the owner team email is _apihub@google.com_ or
+   *   the display name of the allowed value associated with the team attribute
+   *   is `ApiHub Team`.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. An expression that filters the list of ApiResources.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string. The
+   * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not
+   * case sensitive.
+   *
+   * The following fields in the `ApiResource` are eligible for filtering:
+   *
+   *   * `owner.email` - The email of the team which owns the ApiResource.
+   *   Allowed comparison operators: `=`.
+   *   * `create_time` - The time at which the ApiResource was created. The
+   *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+   *   format. Allowed comparison operators: `>` and `<`.
+   *   * `display_name` - The display name of the ApiResource. Allowed
+   *   comparison operators: `=`.
+   *   * `target_user.enum_values.values.id` - The allowed value id of the
+   *   target users attribute associated with the ApiResource. Allowed
+   *   comparison operator is `:`.
+   *   * `target_user.enum_values.values.display_name` - The allowed value
+   *   display name of the target users attribute associated with the
+   *   ApiResource. Allowed comparison operator is `:`.
+   *   * `team.enum_values.values.id` - The allowed value id of the team
+   *   attribute associated with the ApiResource. Allowed comparison operator is
+   *   `:`.
+   *   * `team.enum_values.values.display_name` - The allowed value display name
+   *   of the team attribute associated with the ApiResource. Allowed comparison
+   *   operator is `:`.
+   *   * `business_unit.enum_values.values.id` - The allowed value id of the
+   *   business unit attribute associated with the ApiResource. Allowed
+   *   comparison operator is `:`.
+   *   * `business_unit.enum_values.values.display_name` - The allowed value
+   *   display name of the business unit attribute associated with the
+   *   ApiResource. Allowed comparison operator is `:`.
+   *   * `maturity_level.enum_values.values.id` - The allowed value id of the
+   *   maturity level attribute associated with the ApiResource. Allowed
+   *   comparison operator is `:`.
+   *   * `maturity_level.enum_values.values.display_name` - The allowed value
+   *   display name of the maturity level attribute associated with the
+   *   ApiResource. Allowed comparison operator is `:`.
+   *   * `api_style.enum_values.values.id` - The allowed value id of the
+   *   api style attribute associated with the ApiResource. Allowed
+   *   comparison operator is `:`.
+   *   * `api_style.enum_values.values.display_name` - The allowed value display
+   *   name of the api style attribute associated with the ApiResource. Allowed
+   *   comparison operator is `:`.
+   *
+   * Expressions are combined with either `AND` logic operator or `OR` logical
+   * operator but not both of them together i.e. only one of the `AND` or `OR`
+   * operator can be used throughout the filter string and both the operators
+   * cannot be used together. No other logical operators are supported. At most
+   * three filter fields are allowed in the filter string and if provided
+   * more than that then `INVALID_ARGUMENT` error is returned by the API.
+   *
+   * Here are a few examples:
+   *
+   *   * `owner.email = \"apihub@google.com\"` -  - The owner team email is
+   *   _apihub@google.com_.
+   *   * `owner.email = \"apihub@google.com\" AND create_time <
+   *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+   *   The owner team email is _apihub@google.com_ and the api was created
+   *   before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
+   *   * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id:
+   *   apihub-team-id` - The filter string specifies the APIs where the owner
+   *   team email is _apihub@google.com_ or the id of the allowed value
+   *   associated with the team attribute is _apihub-team-id_.
+   *   * `owner.email = \"apihub@google.com\" OR
+   *   team.enum_values.values.display_name: ApiHub Team` - The filter string
+   *   specifies the APIs where the owner team email is _apihub@google.com_ or
+   *   the display name of the allowed value associated with the team attribute
+   *   is `ApiHub Team`.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. The maximum number of API resources to return. The service may
+   * return fewer than this value. If unspecified, at most 50 Apis will be
+   * returned. The maximum value is 1000; values above 1000 will be coerced to
+   * 1000.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListApis` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters (except page_size) provided to
+   * `ListApis` must match the call that provided the page token.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A page token, received from a previous `ListApis` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters (except page_size) provided to
+   * `ListApis` must match the call that provided the page token.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApisResponse.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApisResponse.java new file mode 100644 index 000000000000..b27e4b32d85d --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApisResponse.java @@ -0,0 +1,1116 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [ListApis][google.cloud.apihub.v1.ApiHub.ListApis] method's response.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListApisResponse} + */ +public final class ListApisResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.ListApisResponse) + ListApisResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListApisResponse.newBuilder() to construct. + private ListApisResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListApisResponse() { + apis_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListApisResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListApisResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListApisResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListApisResponse.class, + com.google.cloud.apihub.v1.ListApisResponse.Builder.class); + } + + public static final int APIS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List apis_; + /** + * + * + *
+   * The API resources present in the API hub.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Api apis = 1; + */ + @java.lang.Override + public java.util.List getApisList() { + return apis_; + } + /** + * + * + *
+   * The API resources present in the API hub.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Api apis = 1; + */ + @java.lang.Override + public java.util.List getApisOrBuilderList() { + return apis_; + } + /** + * + * + *
+   * The API resources present in the API hub.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Api apis = 1; + */ + @java.lang.Override + public int getApisCount() { + return apis_.size(); + } + /** + * + * + *
+   * The API resources present in the API hub.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Api apis = 1; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Api getApis(int index) { + return apis_.get(index); + } + /** + * + * + *
+   * The API resources present in the API hub.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Api apis = 1; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.ApiOrBuilder getApisOrBuilder(int index) { + return apis_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * 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 < apis_.size(); i++) { + output.writeMessage(1, apis_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < apis_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, apis_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().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.apihub.v1.ListApisResponse)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.ListApisResponse other = + (com.google.cloud.apihub.v1.ListApisResponse) obj; + + if (!getApisList().equals(other.getApisList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getApisCount() > 0) { + hash = (37 * hash) + APIS_FIELD_NUMBER; + hash = (53 * hash) + getApisList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.ListApisResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListApisResponse 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.apihub.v1.ListApisResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListApisResponse 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.apihub.v1.ListApisResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListApisResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.ListApisResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListApisResponse 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.apihub.v1.ListApisResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListApisResponse 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.apihub.v1.ListApisResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListApisResponse 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.apihub.v1.ListApisResponse 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 [ListApis][google.cloud.apihub.v1.ApiHub.ListApis] method's response.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListApisResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.ListApisResponse) + com.google.cloud.apihub.v1.ListApisResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListApisResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListApisResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListApisResponse.class, + com.google.cloud.apihub.v1.ListApisResponse.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.ListApisResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (apisBuilder_ == null) { + apis_ = java.util.Collections.emptyList(); + } else { + apis_ = null; + apisBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListApisResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListApisResponse getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.ListApisResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListApisResponse build() { + com.google.cloud.apihub.v1.ListApisResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListApisResponse buildPartial() { + com.google.cloud.apihub.v1.ListApisResponse result = + new com.google.cloud.apihub.v1.ListApisResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.apihub.v1.ListApisResponse result) { + if (apisBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + apis_ = java.util.Collections.unmodifiableList(apis_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.apis_ = apis_; + } else { + result.apis_ = apisBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.apihub.v1.ListApisResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.apihub.v1.ListApisResponse) { + return mergeFrom((com.google.cloud.apihub.v1.ListApisResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.ListApisResponse other) { + if (other == com.google.cloud.apihub.v1.ListApisResponse.getDefaultInstance()) return this; + if (apisBuilder_ == null) { + if (!other.apis_.isEmpty()) { + if (apis_.isEmpty()) { + apis_ = other.apis_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureApisIsMutable(); + apis_.addAll(other.apis_); + } + onChanged(); + } + } else { + if (!other.apis_.isEmpty()) { + if (apisBuilder_.isEmpty()) { + apisBuilder_.dispose(); + apisBuilder_ = null; + apis_ = other.apis_; + bitField0_ = (bitField0_ & ~0x00000001); + apisBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getApisFieldBuilder() + : null; + } else { + apisBuilder_.addAllMessages(other.apis_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.apihub.v1.Api m = + input.readMessage(com.google.cloud.apihub.v1.Api.parser(), extensionRegistry); + if (apisBuilder_ == null) { + ensureApisIsMutable(); + apis_.add(m); + } else { + apisBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List apis_ = + java.util.Collections.emptyList(); + + private void ensureApisIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + apis_ = new java.util.ArrayList(apis_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.Api, + com.google.cloud.apihub.v1.Api.Builder, + com.google.cloud.apihub.v1.ApiOrBuilder> + apisBuilder_; + + /** + * + * + *
+     * The API resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Api apis = 1; + */ + public java.util.List getApisList() { + if (apisBuilder_ == null) { + return java.util.Collections.unmodifiableList(apis_); + } else { + return apisBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The API resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Api apis = 1; + */ + public int getApisCount() { + if (apisBuilder_ == null) { + return apis_.size(); + } else { + return apisBuilder_.getCount(); + } + } + /** + * + * + *
+     * The API resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Api apis = 1; + */ + public com.google.cloud.apihub.v1.Api getApis(int index) { + if (apisBuilder_ == null) { + return apis_.get(index); + } else { + return apisBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The API resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Api apis = 1; + */ + public Builder setApis(int index, com.google.cloud.apihub.v1.Api value) { + if (apisBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureApisIsMutable(); + apis_.set(index, value); + onChanged(); + } else { + apisBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The API resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Api apis = 1; + */ + public Builder setApis(int index, com.google.cloud.apihub.v1.Api.Builder builderForValue) { + if (apisBuilder_ == null) { + ensureApisIsMutable(); + apis_.set(index, builderForValue.build()); + onChanged(); + } else { + apisBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The API resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Api apis = 1; + */ + public Builder addApis(com.google.cloud.apihub.v1.Api value) { + if (apisBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureApisIsMutable(); + apis_.add(value); + onChanged(); + } else { + apisBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The API resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Api apis = 1; + */ + public Builder addApis(int index, com.google.cloud.apihub.v1.Api value) { + if (apisBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureApisIsMutable(); + apis_.add(index, value); + onChanged(); + } else { + apisBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The API resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Api apis = 1; + */ + public Builder addApis(com.google.cloud.apihub.v1.Api.Builder builderForValue) { + if (apisBuilder_ == null) { + ensureApisIsMutable(); + apis_.add(builderForValue.build()); + onChanged(); + } else { + apisBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The API resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Api apis = 1; + */ + public Builder addApis(int index, com.google.cloud.apihub.v1.Api.Builder builderForValue) { + if (apisBuilder_ == null) { + ensureApisIsMutable(); + apis_.add(index, builderForValue.build()); + onChanged(); + } else { + apisBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The API resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Api apis = 1; + */ + public Builder addAllApis(java.lang.Iterable values) { + if (apisBuilder_ == null) { + ensureApisIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, apis_); + onChanged(); + } else { + apisBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The API resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Api apis = 1; + */ + public Builder clearApis() { + if (apisBuilder_ == null) { + apis_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + apisBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The API resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Api apis = 1; + */ + public Builder removeApis(int index) { + if (apisBuilder_ == null) { + ensureApisIsMutable(); + apis_.remove(index); + onChanged(); + } else { + apisBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The API resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Api apis = 1; + */ + public com.google.cloud.apihub.v1.Api.Builder getApisBuilder(int index) { + return getApisFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The API resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Api apis = 1; + */ + public com.google.cloud.apihub.v1.ApiOrBuilder getApisOrBuilder(int index) { + if (apisBuilder_ == null) { + return apis_.get(index); + } else { + return apisBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The API resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Api apis = 1; + */ + public java.util.List + getApisOrBuilderList() { + if (apisBuilder_ != null) { + return apisBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(apis_); + } + } + /** + * + * + *
+     * The API resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Api apis = 1; + */ + public com.google.cloud.apihub.v1.Api.Builder addApisBuilder() { + return getApisFieldBuilder().addBuilder(com.google.cloud.apihub.v1.Api.getDefaultInstance()); + } + /** + * + * + *
+     * The API resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Api apis = 1; + */ + public com.google.cloud.apihub.v1.Api.Builder addApisBuilder(int index) { + return getApisFieldBuilder() + .addBuilder(index, com.google.cloud.apihub.v1.Api.getDefaultInstance()); + } + /** + * + * + *
+     * The API resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Api apis = 1; + */ + public java.util.List getApisBuilderList() { + return getApisFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.Api, + com.google.cloud.apihub.v1.Api.Builder, + com.google.cloud.apihub.v1.ApiOrBuilder> + getApisFieldBuilder() { + if (apisBuilder_ == null) { + apisBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.Api, + com.google.cloud.apihub.v1.Api.Builder, + com.google.cloud.apihub.v1.ApiOrBuilder>( + apis_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + apis_ = null; + } + return apisBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + 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.apihub.v1.ListApisResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.ListApisResponse) + private static final com.google.cloud.apihub.v1.ListApisResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.ListApisResponse(); + } + + public static com.google.cloud.apihub.v1.ListApisResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListApisResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.ListApisResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApisResponseOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApisResponseOrBuilder.java new file mode 100644 index 000000000000..28d0cbf28efc --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListApisResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface ListApisResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.ListApisResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The API resources present in the API hub.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Api apis = 1; + */ + java.util.List getApisList(); + /** + * + * + *
+   * The API resources present in the API hub.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Api apis = 1; + */ + com.google.cloud.apihub.v1.Api getApis(int index); + /** + * + * + *
+   * The API resources present in the API hub.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Api apis = 1; + */ + int getApisCount(); + /** + * + * + *
+   * The API resources present in the API hub.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Api apis = 1; + */ + java.util.List getApisOrBuilderList(); + /** + * + * + *
+   * The API resources present in the API hub.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Api apis = 1; + */ + com.google.cloud.apihub.v1.ApiOrBuilder getApisOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListAttributesRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListAttributesRequest.java new file mode 100644 index 000000000000..011dd9b5fc14 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListAttributesRequest.java @@ -0,0 +1,1439 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method's
+ * request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListAttributesRequest} + */ +public final class ListAttributesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.ListAttributesRequest) + ListAttributesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAttributesRequest.newBuilder() to construct. + private ListAttributesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAttributesRequest() { + parent_ = ""; + filter_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListAttributesRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListAttributesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListAttributesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListAttributesRequest.class, + com.google.cloud.apihub.v1.ListAttributesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent resource for Attribute.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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 parent resource for Attribute.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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 FILTER_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. An expression that filters the list of Attributes.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string or a
+   * boolean. The comparison operator must be one of: `<`, `>` or
+   * `=`. Filters are not case sensitive.
+   *
+   * The following fields in the `Attribute` are eligible for filtering:
+   *
+   *   * `display_name` - The display name of the Attribute. Allowed
+   *   comparison operators: `=`.
+   *   * `definition_type` - The definition type of the attribute. Allowed
+   *   comparison operators: `=`.
+   *   * `scope` - The scope of the attribute. Allowed comparison operators:
+   *   `=`.
+   *   * `data_type` - The type of the data of the attribute. Allowed
+   *   comparison operators: `=`.
+   *   * `mandatory` - Denotes whether the attribute is mandatory or not.
+   *   Allowed comparison operators: `=`.
+   *   * `create_time` - The time at which the Attribute was created. The
+   *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+   *   format. Allowed comparison operators: `>` and `<`.
+   *
+   * Expressions are combined with either `AND` logic operator or `OR` logical
+   * operator but not both of them together i.e. only one of the `AND` or `OR`
+   * operator can be used throughout the filter string and both the operators
+   * cannot be used together. No other logical operators are
+   * supported. At most three filter fields are allowed in the filter
+   * string and if provided more than that then `INVALID_ARGUMENT` error is
+   * returned by the API.
+   *
+   * Here are a few examples:
+   *
+   *   * `display_name = production` -  - The display name of the attribute is
+   *   _production_.
+   *   * `(display_name = production) AND (create_time <
+   *   \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` -
+   *   The display name of the attribute is _production_ and the attribute was
+   *   created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00
+   *   UTC_.
+   *   * `display_name = production OR scope = api` -
+   *   The attribute where the display name is _production_ or the scope is
+   *   _api_.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + 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(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An expression that filters the list of Attributes.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string or a
+   * boolean. The comparison operator must be one of: `<`, `>` or
+   * `=`. Filters are not case sensitive.
+   *
+   * The following fields in the `Attribute` are eligible for filtering:
+   *
+   *   * `display_name` - The display name of the Attribute. Allowed
+   *   comparison operators: `=`.
+   *   * `definition_type` - The definition type of the attribute. Allowed
+   *   comparison operators: `=`.
+   *   * `scope` - The scope of the attribute. Allowed comparison operators:
+   *   `=`.
+   *   * `data_type` - The type of the data of the attribute. Allowed
+   *   comparison operators: `=`.
+   *   * `mandatory` - Denotes whether the attribute is mandatory or not.
+   *   Allowed comparison operators: `=`.
+   *   * `create_time` - The time at which the Attribute was created. The
+   *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+   *   format. Allowed comparison operators: `>` and `<`.
+   *
+   * Expressions are combined with either `AND` logic operator or `OR` logical
+   * operator but not both of them together i.e. only one of the `AND` or `OR`
+   * operator can be used throughout the filter string and both the operators
+   * cannot be used together. No other logical operators are
+   * supported. At most three filter fields are allowed in the filter
+   * string and if provided more than that then `INVALID_ARGUMENT` error is
+   * returned by the API.
+   *
+   * Here are a few examples:
+   *
+   *   * `display_name = production` -  - The display name of the attribute is
+   *   _production_.
+   *   * `(display_name = production) AND (create_time <
+   *   \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` -
+   *   The display name of the attribute is _production_ and the attribute was
+   *   created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00
+   *   UTC_.
+   *   * `display_name = production OR scope = api` -
+   *   The attribute where the display name is _production_ or the scope is
+   *   _api_.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_ = 0; + /** + * + * + *
+   * Optional. The maximum number of attribute resources to return. The service
+   * may return fewer than this value. If unspecified, at most 50 attributes
+   * will be returned. The maximum value is 1000; values above 1000 will be
+   * coerced to 1000.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Optional. A page token, received from a previous `ListAttributes` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListAttributes` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 4 [(.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 page token, received from a previous `ListAttributes` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListAttributes` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 4 [(.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + size += getUnknownFields().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.apihub.v1.ListAttributesRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.ListAttributesRequest other = + (com.google.cloud.apihub.v1.ListAttributesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.ListAttributesRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListAttributesRequest 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.apihub.v1.ListAttributesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListAttributesRequest 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.apihub.v1.ListAttributesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListAttributesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.ListAttributesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListAttributesRequest 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.apihub.v1.ListAttributesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListAttributesRequest 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.apihub.v1.ListAttributesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListAttributesRequest 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.apihub.v1.ListAttributesRequest 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 [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method's
+   * request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListAttributesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.ListAttributesRequest) + com.google.cloud.apihub.v1.ListAttributesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListAttributesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListAttributesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListAttributesRequest.class, + com.google.cloud.apihub.v1.ListAttributesRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.ListAttributesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + filter_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListAttributesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListAttributesRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.ListAttributesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListAttributesRequest build() { + com.google.cloud.apihub.v1.ListAttributesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListAttributesRequest buildPartial() { + com.google.cloud.apihub.v1.ListAttributesRequest result = + new com.google.cloud.apihub.v1.ListAttributesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.ListAttributesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @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.apihub.v1.ListAttributesRequest) { + return mergeFrom((com.google.cloud.apihub.v1.ListAttributesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.ListAttributesRequest other) { + if (other == com.google.cloud.apihub.v1.ListAttributesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource for Attribute.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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 parent resource for Attribute.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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 parent resource for Attribute.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource for Attribute.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource for Attribute.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. An expression that filters the list of Attributes.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string or a
+     * boolean. The comparison operator must be one of: `<`, `>` or
+     * `=`. Filters are not case sensitive.
+     *
+     * The following fields in the `Attribute` are eligible for filtering:
+     *
+     *   * `display_name` - The display name of the Attribute. Allowed
+     *   comparison operators: `=`.
+     *   * `definition_type` - The definition type of the attribute. Allowed
+     *   comparison operators: `=`.
+     *   * `scope` - The scope of the attribute. Allowed comparison operators:
+     *   `=`.
+     *   * `data_type` - The type of the data of the attribute. Allowed
+     *   comparison operators: `=`.
+     *   * `mandatory` - Denotes whether the attribute is mandatory or not.
+     *   Allowed comparison operators: `=`.
+     *   * `create_time` - The time at which the Attribute was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are
+     * supported. At most three filter fields are allowed in the filter
+     * string and if provided more than that then `INVALID_ARGUMENT` error is
+     * returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `display_name = production` -  - The display name of the attribute is
+     *   _production_.
+     *   * `(display_name = production) AND (create_time <
+     *   \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` -
+     *   The display name of the attribute is _production_ and the attribute was
+     *   created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00
+     *   UTC_.
+     *   * `display_name = production OR scope = api` -
+     *   The attribute where the display name is _production_ or the scope is
+     *   _api_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An expression that filters the list of Attributes.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string or a
+     * boolean. The comparison operator must be one of: `<`, `>` or
+     * `=`. Filters are not case sensitive.
+     *
+     * The following fields in the `Attribute` are eligible for filtering:
+     *
+     *   * `display_name` - The display name of the Attribute. Allowed
+     *   comparison operators: `=`.
+     *   * `definition_type` - The definition type of the attribute. Allowed
+     *   comparison operators: `=`.
+     *   * `scope` - The scope of the attribute. Allowed comparison operators:
+     *   `=`.
+     *   * `data_type` - The type of the data of the attribute. Allowed
+     *   comparison operators: `=`.
+     *   * `mandatory` - Denotes whether the attribute is mandatory or not.
+     *   Allowed comparison operators: `=`.
+     *   * `create_time` - The time at which the Attribute was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are
+     * supported. At most three filter fields are allowed in the filter
+     * string and if provided more than that then `INVALID_ARGUMENT` error is
+     * returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `display_name = production` -  - The display name of the attribute is
+     *   _production_.
+     *   * `(display_name = production) AND (create_time <
+     *   \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` -
+     *   The display name of the attribute is _production_ and the attribute was
+     *   created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00
+     *   UTC_.
+     *   * `display_name = production OR scope = api` -
+     *   The attribute where the display name is _production_ or the scope is
+     *   _api_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An expression that filters the list of Attributes.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string or a
+     * boolean. The comparison operator must be one of: `<`, `>` or
+     * `=`. Filters are not case sensitive.
+     *
+     * The following fields in the `Attribute` are eligible for filtering:
+     *
+     *   * `display_name` - The display name of the Attribute. Allowed
+     *   comparison operators: `=`.
+     *   * `definition_type` - The definition type of the attribute. Allowed
+     *   comparison operators: `=`.
+     *   * `scope` - The scope of the attribute. Allowed comparison operators:
+     *   `=`.
+     *   * `data_type` - The type of the data of the attribute. Allowed
+     *   comparison operators: `=`.
+     *   * `mandatory` - Denotes whether the attribute is mandatory or not.
+     *   Allowed comparison operators: `=`.
+     *   * `create_time` - The time at which the Attribute was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are
+     * supported. At most three filter fields are allowed in the filter
+     * string and if provided more than that then `INVALID_ARGUMENT` error is
+     * returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `display_name = production` -  - The display name of the attribute is
+     *   _production_.
+     *   * `(display_name = production) AND (create_time <
+     *   \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` -
+     *   The display name of the attribute is _production_ and the attribute was
+     *   created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00
+     *   UTC_.
+     *   * `display_name = production OR scope = api` -
+     *   The attribute where the display name is _production_ or the scope is
+     *   _api_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An expression that filters the list of Attributes.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string or a
+     * boolean. The comparison operator must be one of: `<`, `>` or
+     * `=`. Filters are not case sensitive.
+     *
+     * The following fields in the `Attribute` are eligible for filtering:
+     *
+     *   * `display_name` - The display name of the Attribute. Allowed
+     *   comparison operators: `=`.
+     *   * `definition_type` - The definition type of the attribute. Allowed
+     *   comparison operators: `=`.
+     *   * `scope` - The scope of the attribute. Allowed comparison operators:
+     *   `=`.
+     *   * `data_type` - The type of the data of the attribute. Allowed
+     *   comparison operators: `=`.
+     *   * `mandatory` - Denotes whether the attribute is mandatory or not.
+     *   Allowed comparison operators: `=`.
+     *   * `create_time` - The time at which the Attribute was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are
+     * supported. At most three filter fields are allowed in the filter
+     * string and if provided more than that then `INVALID_ARGUMENT` error is
+     * returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `display_name = production` -  - The display name of the attribute is
+     *   _production_.
+     *   * `(display_name = production) AND (create_time <
+     *   \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` -
+     *   The display name of the attribute is _production_ and the attribute was
+     *   created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00
+     *   UTC_.
+     *   * `display_name = production OR scope = api` -
+     *   The attribute where the display name is _production_ or the scope is
+     *   _api_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An expression that filters the list of Attributes.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string or a
+     * boolean. The comparison operator must be one of: `<`, `>` or
+     * `=`. Filters are not case sensitive.
+     *
+     * The following fields in the `Attribute` are eligible for filtering:
+     *
+     *   * `display_name` - The display name of the Attribute. Allowed
+     *   comparison operators: `=`.
+     *   * `definition_type` - The definition type of the attribute. Allowed
+     *   comparison operators: `=`.
+     *   * `scope` - The scope of the attribute. Allowed comparison operators:
+     *   `=`.
+     *   * `data_type` - The type of the data of the attribute. Allowed
+     *   comparison operators: `=`.
+     *   * `mandatory` - Denotes whether the attribute is mandatory or not.
+     *   Allowed comparison operators: `=`.
+     *   * `create_time` - The time at which the Attribute was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are
+     * supported. At most three filter fields are allowed in the filter
+     * string and if provided more than that then `INVALID_ARGUMENT` error is
+     * returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `display_name = production` -  - The display name of the attribute is
+     *   _production_.
+     *   * `(display_name = production) AND (create_time <
+     *   \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` -
+     *   The display name of the attribute is _production_ and the attribute was
+     *   created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00
+     *   UTC_.
+     *   * `display_name = production OR scope = api` -
+     *   The attribute where the display name is _production_ or the scope is
+     *   _api_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of attribute resources to return. The service
+     * may return fewer than this value. If unspecified, at most 50 attributes
+     * will be returned. The maximum value is 1000; values above 1000 will be
+     * coerced to 1000.
+     * 
+ * + * 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 attribute resources to return. The service
+     * may return fewer than this value. If unspecified, at most 50 attributes
+     * will be returned. The maximum value is 1000; values above 1000 will be
+     * coerced to 1000.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of attribute resources to return. The service
+     * may return fewer than this value. If unspecified, at most 50 attributes
+     * will be returned. The maximum value is 1000; values above 1000 will be
+     * coerced to 1000.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000004); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A page token, received from a previous `ListAttributes` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListAttributes` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.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 page token, received from a previous `ListAttributes` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListAttributes` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.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 page token, received from a previous `ListAttributes` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListAttributes` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous `ListAttributes` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListAttributes` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous `ListAttributes` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListAttributes` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.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; + bitField0_ |= 0x00000008; + 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.apihub.v1.ListAttributesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.ListAttributesRequest) + private static final com.google.cloud.apihub.v1.ListAttributesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.ListAttributesRequest(); + } + + public static com.google.cloud.apihub.v1.ListAttributesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAttributesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.ListAttributesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListAttributesRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListAttributesRequestOrBuilder.java new file mode 100644 index 000000000000..da226b1f9ccf --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListAttributesRequestOrBuilder.java @@ -0,0 +1,215 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface ListAttributesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.ListAttributesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource for Attribute.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource for Attribute.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. An expression that filters the list of Attributes.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string or a
+   * boolean. The comparison operator must be one of: `<`, `>` or
+   * `=`. Filters are not case sensitive.
+   *
+   * The following fields in the `Attribute` are eligible for filtering:
+   *
+   *   * `display_name` - The display name of the Attribute. Allowed
+   *   comparison operators: `=`.
+   *   * `definition_type` - The definition type of the attribute. Allowed
+   *   comparison operators: `=`.
+   *   * `scope` - The scope of the attribute. Allowed comparison operators:
+   *   `=`.
+   *   * `data_type` - The type of the data of the attribute. Allowed
+   *   comparison operators: `=`.
+   *   * `mandatory` - Denotes whether the attribute is mandatory or not.
+   *   Allowed comparison operators: `=`.
+   *   * `create_time` - The time at which the Attribute was created. The
+   *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+   *   format. Allowed comparison operators: `>` and `<`.
+   *
+   * Expressions are combined with either `AND` logic operator or `OR` logical
+   * operator but not both of them together i.e. only one of the `AND` or `OR`
+   * operator can be used throughout the filter string and both the operators
+   * cannot be used together. No other logical operators are
+   * supported. At most three filter fields are allowed in the filter
+   * string and if provided more than that then `INVALID_ARGUMENT` error is
+   * returned by the API.
+   *
+   * Here are a few examples:
+   *
+   *   * `display_name = production` -  - The display name of the attribute is
+   *   _production_.
+   *   * `(display_name = production) AND (create_time <
+   *   \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` -
+   *   The display name of the attribute is _production_ and the attribute was
+   *   created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00
+   *   UTC_.
+   *   * `display_name = production OR scope = api` -
+   *   The attribute where the display name is _production_ or the scope is
+   *   _api_.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. An expression that filters the list of Attributes.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string or a
+   * boolean. The comparison operator must be one of: `<`, `>` or
+   * `=`. Filters are not case sensitive.
+   *
+   * The following fields in the `Attribute` are eligible for filtering:
+   *
+   *   * `display_name` - The display name of the Attribute. Allowed
+   *   comparison operators: `=`.
+   *   * `definition_type` - The definition type of the attribute. Allowed
+   *   comparison operators: `=`.
+   *   * `scope` - The scope of the attribute. Allowed comparison operators:
+   *   `=`.
+   *   * `data_type` - The type of the data of the attribute. Allowed
+   *   comparison operators: `=`.
+   *   * `mandatory` - Denotes whether the attribute is mandatory or not.
+   *   Allowed comparison operators: `=`.
+   *   * `create_time` - The time at which the Attribute was created. The
+   *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+   *   format. Allowed comparison operators: `>` and `<`.
+   *
+   * Expressions are combined with either `AND` logic operator or `OR` logical
+   * operator but not both of them together i.e. only one of the `AND` or `OR`
+   * operator can be used throughout the filter string and both the operators
+   * cannot be used together. No other logical operators are
+   * supported. At most three filter fields are allowed in the filter
+   * string and if provided more than that then `INVALID_ARGUMENT` error is
+   * returned by the API.
+   *
+   * Here are a few examples:
+   *
+   *   * `display_name = production` -  - The display name of the attribute is
+   *   _production_.
+   *   * `(display_name = production) AND (create_time <
+   *   \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` -
+   *   The display name of the attribute is _production_ and the attribute was
+   *   created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00
+   *   UTC_.
+   *   * `display_name = production OR scope = api` -
+   *   The attribute where the display name is _production_ or the scope is
+   *   _api_.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. The maximum number of attribute resources to return. The service
+   * may return fewer than this value. If unspecified, at most 50 attributes
+   * will be returned. The maximum value is 1000; values above 1000 will be
+   * coerced to 1000.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListAttributes` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListAttributes` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A page token, received from a previous `ListAttributes` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListAttributes` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListAttributesResponse.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListAttributesResponse.java new file mode 100644 index 000000000000..210c88329015 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListAttributesResponse.java @@ -0,0 +1,1126 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method's
+ * response.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListAttributesResponse} + */ +public final class ListAttributesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.ListAttributesResponse) + ListAttributesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAttributesResponse.newBuilder() to construct. + private ListAttributesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAttributesResponse() { + attributes_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListAttributesResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListAttributesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListAttributesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListAttributesResponse.class, + com.google.cloud.apihub.v1.ListAttributesResponse.Builder.class); + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List attributes_; + /** + * + * + *
+   * The list of all attributes.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Attribute attributes = 1; + */ + @java.lang.Override + public java.util.List getAttributesList() { + return attributes_; + } + /** + * + * + *
+   * The list of all attributes.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Attribute attributes = 1; + */ + @java.lang.Override + public java.util.List + getAttributesOrBuilderList() { + return attributes_; + } + /** + * + * + *
+   * The list of all attributes.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Attribute attributes = 1; + */ + @java.lang.Override + public int getAttributesCount() { + return attributes_.size(); + } + /** + * + * + *
+   * The list of all attributes.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Attribute attributes = 1; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Attribute getAttributes(int index) { + return attributes_.get(index); + } + /** + * + * + *
+   * The list of all attributes.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Attribute attributes = 1; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeOrBuilder getAttributesOrBuilder(int index) { + return attributes_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * 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 < attributes_.size(); i++) { + output.writeMessage(1, attributes_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < attributes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, attributes_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().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.apihub.v1.ListAttributesResponse)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.ListAttributesResponse other = + (com.google.cloud.apihub.v1.ListAttributesResponse) obj; + + if (!getAttributesList().equals(other.getAttributesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getAttributesCount() > 0) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + getAttributesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.ListAttributesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListAttributesResponse 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.apihub.v1.ListAttributesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListAttributesResponse 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.apihub.v1.ListAttributesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListAttributesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.ListAttributesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListAttributesResponse 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.apihub.v1.ListAttributesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListAttributesResponse 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.apihub.v1.ListAttributesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListAttributesResponse 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.apihub.v1.ListAttributesResponse 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 [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method's
+   * response.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListAttributesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.ListAttributesResponse) + com.google.cloud.apihub.v1.ListAttributesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListAttributesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListAttributesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListAttributesResponse.class, + com.google.cloud.apihub.v1.ListAttributesResponse.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.ListAttributesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (attributesBuilder_ == null) { + attributes_ = java.util.Collections.emptyList(); + } else { + attributes_ = null; + attributesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListAttributesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListAttributesResponse getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.ListAttributesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListAttributesResponse build() { + com.google.cloud.apihub.v1.ListAttributesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListAttributesResponse buildPartial() { + com.google.cloud.apihub.v1.ListAttributesResponse result = + new com.google.cloud.apihub.v1.ListAttributesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.apihub.v1.ListAttributesResponse result) { + if (attributesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + attributes_ = java.util.Collections.unmodifiableList(attributes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.attributes_ = attributes_; + } else { + result.attributes_ = attributesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.apihub.v1.ListAttributesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.apihub.v1.ListAttributesResponse) { + return mergeFrom((com.google.cloud.apihub.v1.ListAttributesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.ListAttributesResponse other) { + if (other == com.google.cloud.apihub.v1.ListAttributesResponse.getDefaultInstance()) + return this; + if (attributesBuilder_ == null) { + if (!other.attributes_.isEmpty()) { + if (attributes_.isEmpty()) { + attributes_ = other.attributes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAttributesIsMutable(); + attributes_.addAll(other.attributes_); + } + onChanged(); + } + } else { + if (!other.attributes_.isEmpty()) { + if (attributesBuilder_.isEmpty()) { + attributesBuilder_.dispose(); + attributesBuilder_ = null; + attributes_ = other.attributes_; + bitField0_ = (bitField0_ & ~0x00000001); + attributesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAttributesFieldBuilder() + : null; + } else { + attributesBuilder_.addAllMessages(other.attributes_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.apihub.v1.Attribute m = + input.readMessage( + com.google.cloud.apihub.v1.Attribute.parser(), extensionRegistry); + if (attributesBuilder_ == null) { + ensureAttributesIsMutable(); + attributes_.add(m); + } else { + attributesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List attributes_ = + java.util.Collections.emptyList(); + + private void ensureAttributesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + attributes_ = new java.util.ArrayList(attributes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.Attribute, + com.google.cloud.apihub.v1.Attribute.Builder, + com.google.cloud.apihub.v1.AttributeOrBuilder> + attributesBuilder_; + + /** + * + * + *
+     * The list of all attributes.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Attribute attributes = 1; + */ + public java.util.List getAttributesList() { + if (attributesBuilder_ == null) { + return java.util.Collections.unmodifiableList(attributes_); + } else { + return attributesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of all attributes.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Attribute attributes = 1; + */ + public int getAttributesCount() { + if (attributesBuilder_ == null) { + return attributes_.size(); + } else { + return attributesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of all attributes.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Attribute attributes = 1; + */ + public com.google.cloud.apihub.v1.Attribute getAttributes(int index) { + if (attributesBuilder_ == null) { + return attributes_.get(index); + } else { + return attributesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of all attributes.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Attribute attributes = 1; + */ + public Builder setAttributes(int index, com.google.cloud.apihub.v1.Attribute value) { + if (attributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttributesIsMutable(); + attributes_.set(index, value); + onChanged(); + } else { + attributesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of all attributes.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Attribute attributes = 1; + */ + public Builder setAttributes( + int index, com.google.cloud.apihub.v1.Attribute.Builder builderForValue) { + if (attributesBuilder_ == null) { + ensureAttributesIsMutable(); + attributes_.set(index, builderForValue.build()); + onChanged(); + } else { + attributesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of all attributes.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Attribute attributes = 1; + */ + public Builder addAttributes(com.google.cloud.apihub.v1.Attribute value) { + if (attributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttributesIsMutable(); + attributes_.add(value); + onChanged(); + } else { + attributesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of all attributes.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Attribute attributes = 1; + */ + public Builder addAttributes(int index, com.google.cloud.apihub.v1.Attribute value) { + if (attributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttributesIsMutable(); + attributes_.add(index, value); + onChanged(); + } else { + attributesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of all attributes.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Attribute attributes = 1; + */ + public Builder addAttributes(com.google.cloud.apihub.v1.Attribute.Builder builderForValue) { + if (attributesBuilder_ == null) { + ensureAttributesIsMutable(); + attributes_.add(builderForValue.build()); + onChanged(); + } else { + attributesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of all attributes.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Attribute attributes = 1; + */ + public Builder addAttributes( + int index, com.google.cloud.apihub.v1.Attribute.Builder builderForValue) { + if (attributesBuilder_ == null) { + ensureAttributesIsMutable(); + attributes_.add(index, builderForValue.build()); + onChanged(); + } else { + attributesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of all attributes.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Attribute attributes = 1; + */ + public Builder addAllAttributes( + java.lang.Iterable values) { + if (attributesBuilder_ == null) { + ensureAttributesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, attributes_); + onChanged(); + } else { + attributesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of all attributes.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Attribute attributes = 1; + */ + public Builder clearAttributes() { + if (attributesBuilder_ == null) { + attributes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + attributesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of all attributes.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Attribute attributes = 1; + */ + public Builder removeAttributes(int index) { + if (attributesBuilder_ == null) { + ensureAttributesIsMutable(); + attributes_.remove(index); + onChanged(); + } else { + attributesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of all attributes.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Attribute attributes = 1; + */ + public com.google.cloud.apihub.v1.Attribute.Builder getAttributesBuilder(int index) { + return getAttributesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of all attributes.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Attribute attributes = 1; + */ + public com.google.cloud.apihub.v1.AttributeOrBuilder getAttributesOrBuilder(int index) { + if (attributesBuilder_ == null) { + return attributes_.get(index); + } else { + return attributesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of all attributes.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Attribute attributes = 1; + */ + public java.util.List + getAttributesOrBuilderList() { + if (attributesBuilder_ != null) { + return attributesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(attributes_); + } + } + /** + * + * + *
+     * The list of all attributes.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Attribute attributes = 1; + */ + public com.google.cloud.apihub.v1.Attribute.Builder addAttributesBuilder() { + return getAttributesFieldBuilder() + .addBuilder(com.google.cloud.apihub.v1.Attribute.getDefaultInstance()); + } + /** + * + * + *
+     * The list of all attributes.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Attribute attributes = 1; + */ + public com.google.cloud.apihub.v1.Attribute.Builder addAttributesBuilder(int index) { + return getAttributesFieldBuilder() + .addBuilder(index, com.google.cloud.apihub.v1.Attribute.getDefaultInstance()); + } + /** + * + * + *
+     * The list of all attributes.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Attribute attributes = 1; + */ + public java.util.List getAttributesBuilderList() { + return getAttributesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.Attribute, + com.google.cloud.apihub.v1.Attribute.Builder, + com.google.cloud.apihub.v1.AttributeOrBuilder> + getAttributesFieldBuilder() { + if (attributesBuilder_ == null) { + attributesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.Attribute, + com.google.cloud.apihub.v1.Attribute.Builder, + com.google.cloud.apihub.v1.AttributeOrBuilder>( + attributes_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + attributes_ = null; + } + return attributesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + 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.apihub.v1.ListAttributesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.ListAttributesResponse) + private static final com.google.cloud.apihub.v1.ListAttributesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.ListAttributesResponse(); + } + + public static com.google.cloud.apihub.v1.ListAttributesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAttributesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.ListAttributesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListAttributesResponseOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListAttributesResponseOrBuilder.java new file mode 100644 index 000000000000..7aec842d04c7 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListAttributesResponseOrBuilder.java @@ -0,0 +1,105 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface ListAttributesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.ListAttributesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of all attributes.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Attribute attributes = 1; + */ + java.util.List getAttributesList(); + /** + * + * + *
+   * The list of all attributes.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Attribute attributes = 1; + */ + com.google.cloud.apihub.v1.Attribute getAttributes(int index); + /** + * + * + *
+   * The list of all attributes.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Attribute attributes = 1; + */ + int getAttributesCount(); + /** + * + * + *
+   * The list of all attributes.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Attribute attributes = 1; + */ + java.util.List + getAttributesOrBuilderList(); + /** + * + * + *
+   * The list of all attributes.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Attribute attributes = 1; + */ + com.google.cloud.apihub.v1.AttributeOrBuilder getAttributesOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDependenciesRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDependenciesRequest.java new file mode 100644 index 000000000000..63565759a149 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDependenciesRequest.java @@ -0,0 +1,1378 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The
+ * [ListDependencies][google.cloud.apihub.v1.ApiHubDependencies.ListDependencies]
+ * method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListDependenciesRequest} + */ +public final class ListDependenciesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.ListDependenciesRequest) + ListDependenciesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListDependenciesRequest.newBuilder() to construct. + private ListDependenciesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListDependenciesRequest() { + parent_ = ""; + filter_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListDependenciesRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListDependenciesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListDependenciesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListDependenciesRequest.class, + com.google.cloud.apihub.v1.ListDependenciesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent which owns this collection of dependency resources.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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 parent which owns this collection of dependency resources.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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 FILTER_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. An expression that filters the list of Dependencies.
+   *
+   * A filter expression consists of a field name, a comparison operator, and
+   * a value for filtering. The value must be a string. Allowed comparison
+   * operator is `=`. Filters are not case sensitive.
+   *
+   * The following fields in the `Dependency` are eligible for filtering:
+   *
+   *   * `consumer.operation_resource_name` - The operation resource name for
+   *   the consumer entity involved in a dependency. Allowed comparison
+   *   operators: `=`.
+   *   * `consumer.external_api_resource_name` - The external api resource name
+   *   for the consumer entity involved in a dependency. Allowed comparison
+   *   operators: `=`.
+   *   * `supplier.operation_resource_name` - The operation resource name for
+   *   the supplier entity involved in a dependency. Allowed comparison
+   *   operators: `=`.
+   *   * `supplier.external_api_resource_name` - The external api resource name
+   *   for the supplier entity involved in a dependency. Allowed comparison
+   *   operators: `=`.
+   *
+   * Expressions are combined with either `AND` logic operator or `OR` logical
+   * operator but not both of them together i.e. only one of the `AND` or `OR`
+   * operator can be used throughout the filter string and both the operators
+   * cannot be used together. No other logical operators are supported. At most
+   * three filter fields are allowed in the filter string and if provided
+   * more than that then `INVALID_ARGUMENT` error is returned by the API.
+   *
+   * For example, `consumer.operation_resource_name =
+   * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR
+   * supplier.operation_resource_name =
+   * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The
+   * dependencies with either consumer or supplier operation resource name as
+   * _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + 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(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An expression that filters the list of Dependencies.
+   *
+   * A filter expression consists of a field name, a comparison operator, and
+   * a value for filtering. The value must be a string. Allowed comparison
+   * operator is `=`. Filters are not case sensitive.
+   *
+   * The following fields in the `Dependency` are eligible for filtering:
+   *
+   *   * `consumer.operation_resource_name` - The operation resource name for
+   *   the consumer entity involved in a dependency. Allowed comparison
+   *   operators: `=`.
+   *   * `consumer.external_api_resource_name` - The external api resource name
+   *   for the consumer entity involved in a dependency. Allowed comparison
+   *   operators: `=`.
+   *   * `supplier.operation_resource_name` - The operation resource name for
+   *   the supplier entity involved in a dependency. Allowed comparison
+   *   operators: `=`.
+   *   * `supplier.external_api_resource_name` - The external api resource name
+   *   for the supplier entity involved in a dependency. Allowed comparison
+   *   operators: `=`.
+   *
+   * Expressions are combined with either `AND` logic operator or `OR` logical
+   * operator but not both of them together i.e. only one of the `AND` or `OR`
+   * operator can be used throughout the filter string and both the operators
+   * cannot be used together. No other logical operators are supported. At most
+   * three filter fields are allowed in the filter string and if provided
+   * more than that then `INVALID_ARGUMENT` error is returned by the API.
+   *
+   * For example, `consumer.operation_resource_name =
+   * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR
+   * supplier.operation_resource_name =
+   * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The
+   * dependencies with either consumer or supplier operation resource name as
+   * _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_ = 0; + /** + * + * + *
+   * Optional. The maximum number of dependency resources to return. The service
+   * may return fewer than this value. If unspecified, at most 50 dependencies
+   * will be returned. The maximum value is 1000; values above 1000 will be
+   * coerced to 1000.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Optional. A page token, received from a previous `ListDependencies` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListDependencies` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 4 [(.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 page token, received from a previous `ListDependencies` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListDependencies` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 4 [(.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + size += getUnknownFields().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.apihub.v1.ListDependenciesRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.ListDependenciesRequest other = + (com.google.cloud.apihub.v1.ListDependenciesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.ListDependenciesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListDependenciesRequest 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.apihub.v1.ListDependenciesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListDependenciesRequest 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.apihub.v1.ListDependenciesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListDependenciesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.ListDependenciesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListDependenciesRequest 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.apihub.v1.ListDependenciesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListDependenciesRequest 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.apihub.v1.ListDependenciesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListDependenciesRequest 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.apihub.v1.ListDependenciesRequest 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
+   * [ListDependencies][google.cloud.apihub.v1.ApiHubDependencies.ListDependencies]
+   * method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListDependenciesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.ListDependenciesRequest) + com.google.cloud.apihub.v1.ListDependenciesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListDependenciesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListDependenciesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListDependenciesRequest.class, + com.google.cloud.apihub.v1.ListDependenciesRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.ListDependenciesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + filter_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListDependenciesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListDependenciesRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.ListDependenciesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListDependenciesRequest build() { + com.google.cloud.apihub.v1.ListDependenciesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListDependenciesRequest buildPartial() { + com.google.cloud.apihub.v1.ListDependenciesRequest result = + new com.google.cloud.apihub.v1.ListDependenciesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.ListDependenciesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @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.apihub.v1.ListDependenciesRequest) { + return mergeFrom((com.google.cloud.apihub.v1.ListDependenciesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.ListDependenciesRequest other) { + if (other == com.google.cloud.apihub.v1.ListDependenciesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent which owns this collection of dependency resources.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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 parent which owns this collection of dependency resources.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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 parent which owns this collection of dependency resources.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent which owns this collection of dependency resources.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent which owns this collection of dependency resources.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. An expression that filters the list of Dependencies.
+     *
+     * A filter expression consists of a field name, a comparison operator, and
+     * a value for filtering. The value must be a string. Allowed comparison
+     * operator is `=`. Filters are not case sensitive.
+     *
+     * The following fields in the `Dependency` are eligible for filtering:
+     *
+     *   * `consumer.operation_resource_name` - The operation resource name for
+     *   the consumer entity involved in a dependency. Allowed comparison
+     *   operators: `=`.
+     *   * `consumer.external_api_resource_name` - The external api resource name
+     *   for the consumer entity involved in a dependency. Allowed comparison
+     *   operators: `=`.
+     *   * `supplier.operation_resource_name` - The operation resource name for
+     *   the supplier entity involved in a dependency. Allowed comparison
+     *   operators: `=`.
+     *   * `supplier.external_api_resource_name` - The external api resource name
+     *   for the supplier entity involved in a dependency. Allowed comparison
+     *   operators: `=`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are supported. At most
+     * three filter fields are allowed in the filter string and if provided
+     * more than that then `INVALID_ARGUMENT` error is returned by the API.
+     *
+     * For example, `consumer.operation_resource_name =
+     * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR
+     * supplier.operation_resource_name =
+     * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The
+     * dependencies with either consumer or supplier operation resource name as
+     * _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An expression that filters the list of Dependencies.
+     *
+     * A filter expression consists of a field name, a comparison operator, and
+     * a value for filtering. The value must be a string. Allowed comparison
+     * operator is `=`. Filters are not case sensitive.
+     *
+     * The following fields in the `Dependency` are eligible for filtering:
+     *
+     *   * `consumer.operation_resource_name` - The operation resource name for
+     *   the consumer entity involved in a dependency. Allowed comparison
+     *   operators: `=`.
+     *   * `consumer.external_api_resource_name` - The external api resource name
+     *   for the consumer entity involved in a dependency. Allowed comparison
+     *   operators: `=`.
+     *   * `supplier.operation_resource_name` - The operation resource name for
+     *   the supplier entity involved in a dependency. Allowed comparison
+     *   operators: `=`.
+     *   * `supplier.external_api_resource_name` - The external api resource name
+     *   for the supplier entity involved in a dependency. Allowed comparison
+     *   operators: `=`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are supported. At most
+     * three filter fields are allowed in the filter string and if provided
+     * more than that then `INVALID_ARGUMENT` error is returned by the API.
+     *
+     * For example, `consumer.operation_resource_name =
+     * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR
+     * supplier.operation_resource_name =
+     * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The
+     * dependencies with either consumer or supplier operation resource name as
+     * _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An expression that filters the list of Dependencies.
+     *
+     * A filter expression consists of a field name, a comparison operator, and
+     * a value for filtering. The value must be a string. Allowed comparison
+     * operator is `=`. Filters are not case sensitive.
+     *
+     * The following fields in the `Dependency` are eligible for filtering:
+     *
+     *   * `consumer.operation_resource_name` - The operation resource name for
+     *   the consumer entity involved in a dependency. Allowed comparison
+     *   operators: `=`.
+     *   * `consumer.external_api_resource_name` - The external api resource name
+     *   for the consumer entity involved in a dependency. Allowed comparison
+     *   operators: `=`.
+     *   * `supplier.operation_resource_name` - The operation resource name for
+     *   the supplier entity involved in a dependency. Allowed comparison
+     *   operators: `=`.
+     *   * `supplier.external_api_resource_name` - The external api resource name
+     *   for the supplier entity involved in a dependency. Allowed comparison
+     *   operators: `=`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are supported. At most
+     * three filter fields are allowed in the filter string and if provided
+     * more than that then `INVALID_ARGUMENT` error is returned by the API.
+     *
+     * For example, `consumer.operation_resource_name =
+     * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR
+     * supplier.operation_resource_name =
+     * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The
+     * dependencies with either consumer or supplier operation resource name as
+     * _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An expression that filters the list of Dependencies.
+     *
+     * A filter expression consists of a field name, a comparison operator, and
+     * a value for filtering. The value must be a string. Allowed comparison
+     * operator is `=`. Filters are not case sensitive.
+     *
+     * The following fields in the `Dependency` are eligible for filtering:
+     *
+     *   * `consumer.operation_resource_name` - The operation resource name for
+     *   the consumer entity involved in a dependency. Allowed comparison
+     *   operators: `=`.
+     *   * `consumer.external_api_resource_name` - The external api resource name
+     *   for the consumer entity involved in a dependency. Allowed comparison
+     *   operators: `=`.
+     *   * `supplier.operation_resource_name` - The operation resource name for
+     *   the supplier entity involved in a dependency. Allowed comparison
+     *   operators: `=`.
+     *   * `supplier.external_api_resource_name` - The external api resource name
+     *   for the supplier entity involved in a dependency. Allowed comparison
+     *   operators: `=`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are supported. At most
+     * three filter fields are allowed in the filter string and if provided
+     * more than that then `INVALID_ARGUMENT` error is returned by the API.
+     *
+     * For example, `consumer.operation_resource_name =
+     * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR
+     * supplier.operation_resource_name =
+     * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The
+     * dependencies with either consumer or supplier operation resource name as
+     * _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An expression that filters the list of Dependencies.
+     *
+     * A filter expression consists of a field name, a comparison operator, and
+     * a value for filtering. The value must be a string. Allowed comparison
+     * operator is `=`. Filters are not case sensitive.
+     *
+     * The following fields in the `Dependency` are eligible for filtering:
+     *
+     *   * `consumer.operation_resource_name` - The operation resource name for
+     *   the consumer entity involved in a dependency. Allowed comparison
+     *   operators: `=`.
+     *   * `consumer.external_api_resource_name` - The external api resource name
+     *   for the consumer entity involved in a dependency. Allowed comparison
+     *   operators: `=`.
+     *   * `supplier.operation_resource_name` - The operation resource name for
+     *   the supplier entity involved in a dependency. Allowed comparison
+     *   operators: `=`.
+     *   * `supplier.external_api_resource_name` - The external api resource name
+     *   for the supplier entity involved in a dependency. Allowed comparison
+     *   operators: `=`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are supported. At most
+     * three filter fields are allowed in the filter string and if provided
+     * more than that then `INVALID_ARGUMENT` error is returned by the API.
+     *
+     * For example, `consumer.operation_resource_name =
+     * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR
+     * supplier.operation_resource_name =
+     * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The
+     * dependencies with either consumer or supplier operation resource name as
+     * _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of dependency resources to return. The service
+     * may return fewer than this value. If unspecified, at most 50 dependencies
+     * will be returned. The maximum value is 1000; values above 1000 will be
+     * coerced to 1000.
+     * 
+ * + * 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 dependency resources to return. The service
+     * may return fewer than this value. If unspecified, at most 50 dependencies
+     * will be returned. The maximum value is 1000; values above 1000 will be
+     * coerced to 1000.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of dependency resources to return. The service
+     * may return fewer than this value. If unspecified, at most 50 dependencies
+     * will be returned. The maximum value is 1000; values above 1000 will be
+     * coerced to 1000.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000004); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A page token, received from a previous `ListDependencies` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListDependencies` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.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 page token, received from a previous `ListDependencies` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListDependencies` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.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 page token, received from a previous `ListDependencies` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListDependencies` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous `ListDependencies` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListDependencies` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous `ListDependencies` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListDependencies` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.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; + bitField0_ |= 0x00000008; + 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.apihub.v1.ListDependenciesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.ListDependenciesRequest) + private static final com.google.cloud.apihub.v1.ListDependenciesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.ListDependenciesRequest(); + } + + public static com.google.cloud.apihub.v1.ListDependenciesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListDependenciesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.ListDependenciesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDependenciesRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDependenciesRequestOrBuilder.java new file mode 100644 index 000000000000..d0d4bb476fef --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDependenciesRequestOrBuilder.java @@ -0,0 +1,197 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface ListDependenciesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.ListDependenciesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent which owns this collection of dependency resources.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent which owns this collection of dependency resources.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. An expression that filters the list of Dependencies.
+   *
+   * A filter expression consists of a field name, a comparison operator, and
+   * a value for filtering. The value must be a string. Allowed comparison
+   * operator is `=`. Filters are not case sensitive.
+   *
+   * The following fields in the `Dependency` are eligible for filtering:
+   *
+   *   * `consumer.operation_resource_name` - The operation resource name for
+   *   the consumer entity involved in a dependency. Allowed comparison
+   *   operators: `=`.
+   *   * `consumer.external_api_resource_name` - The external api resource name
+   *   for the consumer entity involved in a dependency. Allowed comparison
+   *   operators: `=`.
+   *   * `supplier.operation_resource_name` - The operation resource name for
+   *   the supplier entity involved in a dependency. Allowed comparison
+   *   operators: `=`.
+   *   * `supplier.external_api_resource_name` - The external api resource name
+   *   for the supplier entity involved in a dependency. Allowed comparison
+   *   operators: `=`.
+   *
+   * Expressions are combined with either `AND` logic operator or `OR` logical
+   * operator but not both of them together i.e. only one of the `AND` or `OR`
+   * operator can be used throughout the filter string and both the operators
+   * cannot be used together. No other logical operators are supported. At most
+   * three filter fields are allowed in the filter string and if provided
+   * more than that then `INVALID_ARGUMENT` error is returned by the API.
+   *
+   * For example, `consumer.operation_resource_name =
+   * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR
+   * supplier.operation_resource_name =
+   * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The
+   * dependencies with either consumer or supplier operation resource name as
+   * _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. An expression that filters the list of Dependencies.
+   *
+   * A filter expression consists of a field name, a comparison operator, and
+   * a value for filtering. The value must be a string. Allowed comparison
+   * operator is `=`. Filters are not case sensitive.
+   *
+   * The following fields in the `Dependency` are eligible for filtering:
+   *
+   *   * `consumer.operation_resource_name` - The operation resource name for
+   *   the consumer entity involved in a dependency. Allowed comparison
+   *   operators: `=`.
+   *   * `consumer.external_api_resource_name` - The external api resource name
+   *   for the consumer entity involved in a dependency. Allowed comparison
+   *   operators: `=`.
+   *   * `supplier.operation_resource_name` - The operation resource name for
+   *   the supplier entity involved in a dependency. Allowed comparison
+   *   operators: `=`.
+   *   * `supplier.external_api_resource_name` - The external api resource name
+   *   for the supplier entity involved in a dependency. Allowed comparison
+   *   operators: `=`.
+   *
+   * Expressions are combined with either `AND` logic operator or `OR` logical
+   * operator but not both of them together i.e. only one of the `AND` or `OR`
+   * operator can be used throughout the filter string and both the operators
+   * cannot be used together. No other logical operators are supported. At most
+   * three filter fields are allowed in the filter string and if provided
+   * more than that then `INVALID_ARGUMENT` error is returned by the API.
+   *
+   * For example, `consumer.operation_resource_name =
+   * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR
+   * supplier.operation_resource_name =
+   * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The
+   * dependencies with either consumer or supplier operation resource name as
+   * _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. The maximum number of dependency resources to return. The service
+   * may return fewer than this value. If unspecified, at most 50 dependencies
+   * will be returned. The maximum value is 1000; values above 1000 will be
+   * coerced to 1000.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListDependencies` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListDependencies` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A page token, received from a previous `ListDependencies` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListDependencies` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDependenciesResponse.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDependenciesResponse.java new file mode 100644 index 000000000000..3b20a4c2d845 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDependenciesResponse.java @@ -0,0 +1,1153 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The
+ * [ListDependencies][google.cloud.apihub.v1.ApiHubDependencies.ListDependencies]
+ * method's response.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListDependenciesResponse} + */ +public final class ListDependenciesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.ListDependenciesResponse) + ListDependenciesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListDependenciesResponse.newBuilder() to construct. + private ListDependenciesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListDependenciesResponse() { + dependencies_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListDependenciesResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListDependenciesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListDependenciesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListDependenciesResponse.class, + com.google.cloud.apihub.v1.ListDependenciesResponse.Builder.class); + } + + public static final int DEPENDENCIES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List dependencies_; + /** + * + * + *
+   * The dependency resources present in the API hub.
+   * Only following field will be populated in the response: name.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Dependency dependencies = 1; + */ + @java.lang.Override + public java.util.List getDependenciesList() { + return dependencies_; + } + /** + * + * + *
+   * The dependency resources present in the API hub.
+   * Only following field will be populated in the response: name.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Dependency dependencies = 1; + */ + @java.lang.Override + public java.util.List + getDependenciesOrBuilderList() { + return dependencies_; + } + /** + * + * + *
+   * The dependency resources present in the API hub.
+   * Only following field will be populated in the response: name.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Dependency dependencies = 1; + */ + @java.lang.Override + public int getDependenciesCount() { + return dependencies_.size(); + } + /** + * + * + *
+   * The dependency resources present in the API hub.
+   * Only following field will be populated in the response: name.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Dependency dependencies = 1; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Dependency getDependencies(int index) { + return dependencies_.get(index); + } + /** + * + * + *
+   * The dependency resources present in the API hub.
+   * Only following field will be populated in the response: name.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Dependency dependencies = 1; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.DependencyOrBuilder getDependenciesOrBuilder(int index) { + return dependencies_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * 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 < dependencies_.size(); i++) { + output.writeMessage(1, dependencies_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < dependencies_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, dependencies_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().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.apihub.v1.ListDependenciesResponse)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.ListDependenciesResponse other = + (com.google.cloud.apihub.v1.ListDependenciesResponse) obj; + + if (!getDependenciesList().equals(other.getDependenciesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDependenciesCount() > 0) { + hash = (37 * hash) + DEPENDENCIES_FIELD_NUMBER; + hash = (53 * hash) + getDependenciesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.ListDependenciesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListDependenciesResponse 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.apihub.v1.ListDependenciesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListDependenciesResponse 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.apihub.v1.ListDependenciesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListDependenciesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.ListDependenciesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListDependenciesResponse 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.apihub.v1.ListDependenciesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListDependenciesResponse 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.apihub.v1.ListDependenciesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListDependenciesResponse 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.apihub.v1.ListDependenciesResponse 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
+   * [ListDependencies][google.cloud.apihub.v1.ApiHubDependencies.ListDependencies]
+   * method's response.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListDependenciesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.ListDependenciesResponse) + com.google.cloud.apihub.v1.ListDependenciesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListDependenciesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListDependenciesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListDependenciesResponse.class, + com.google.cloud.apihub.v1.ListDependenciesResponse.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.ListDependenciesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (dependenciesBuilder_ == null) { + dependencies_ = java.util.Collections.emptyList(); + } else { + dependencies_ = null; + dependenciesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListDependenciesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListDependenciesResponse getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.ListDependenciesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListDependenciesResponse build() { + com.google.cloud.apihub.v1.ListDependenciesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListDependenciesResponse buildPartial() { + com.google.cloud.apihub.v1.ListDependenciesResponse result = + new com.google.cloud.apihub.v1.ListDependenciesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.apihub.v1.ListDependenciesResponse result) { + if (dependenciesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + dependencies_ = java.util.Collections.unmodifiableList(dependencies_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.dependencies_ = dependencies_; + } else { + result.dependencies_ = dependenciesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.apihub.v1.ListDependenciesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.apihub.v1.ListDependenciesResponse) { + return mergeFrom((com.google.cloud.apihub.v1.ListDependenciesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.ListDependenciesResponse other) { + if (other == com.google.cloud.apihub.v1.ListDependenciesResponse.getDefaultInstance()) + return this; + if (dependenciesBuilder_ == null) { + if (!other.dependencies_.isEmpty()) { + if (dependencies_.isEmpty()) { + dependencies_ = other.dependencies_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDependenciesIsMutable(); + dependencies_.addAll(other.dependencies_); + } + onChanged(); + } + } else { + if (!other.dependencies_.isEmpty()) { + if (dependenciesBuilder_.isEmpty()) { + dependenciesBuilder_.dispose(); + dependenciesBuilder_ = null; + dependencies_ = other.dependencies_; + bitField0_ = (bitField0_ & ~0x00000001); + dependenciesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDependenciesFieldBuilder() + : null; + } else { + dependenciesBuilder_.addAllMessages(other.dependencies_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.apihub.v1.Dependency m = + input.readMessage( + com.google.cloud.apihub.v1.Dependency.parser(), extensionRegistry); + if (dependenciesBuilder_ == null) { + ensureDependenciesIsMutable(); + dependencies_.add(m); + } else { + dependenciesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List dependencies_ = + java.util.Collections.emptyList(); + + private void ensureDependenciesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + dependencies_ = + new java.util.ArrayList(dependencies_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.Dependency, + com.google.cloud.apihub.v1.Dependency.Builder, + com.google.cloud.apihub.v1.DependencyOrBuilder> + dependenciesBuilder_; + + /** + * + * + *
+     * The dependency resources present in the API hub.
+     * Only following field will be populated in the response: name.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Dependency dependencies = 1; + */ + public java.util.List getDependenciesList() { + if (dependenciesBuilder_ == null) { + return java.util.Collections.unmodifiableList(dependencies_); + } else { + return dependenciesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The dependency resources present in the API hub.
+     * Only following field will be populated in the response: name.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Dependency dependencies = 1; + */ + public int getDependenciesCount() { + if (dependenciesBuilder_ == null) { + return dependencies_.size(); + } else { + return dependenciesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The dependency resources present in the API hub.
+     * Only following field will be populated in the response: name.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Dependency dependencies = 1; + */ + public com.google.cloud.apihub.v1.Dependency getDependencies(int index) { + if (dependenciesBuilder_ == null) { + return dependencies_.get(index); + } else { + return dependenciesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The dependency resources present in the API hub.
+     * Only following field will be populated in the response: name.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Dependency dependencies = 1; + */ + public Builder setDependencies(int index, com.google.cloud.apihub.v1.Dependency value) { + if (dependenciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDependenciesIsMutable(); + dependencies_.set(index, value); + onChanged(); + } else { + dependenciesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The dependency resources present in the API hub.
+     * Only following field will be populated in the response: name.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Dependency dependencies = 1; + */ + public Builder setDependencies( + int index, com.google.cloud.apihub.v1.Dependency.Builder builderForValue) { + if (dependenciesBuilder_ == null) { + ensureDependenciesIsMutable(); + dependencies_.set(index, builderForValue.build()); + onChanged(); + } else { + dependenciesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The dependency resources present in the API hub.
+     * Only following field will be populated in the response: name.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Dependency dependencies = 1; + */ + public Builder addDependencies(com.google.cloud.apihub.v1.Dependency value) { + if (dependenciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDependenciesIsMutable(); + dependencies_.add(value); + onChanged(); + } else { + dependenciesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The dependency resources present in the API hub.
+     * Only following field will be populated in the response: name.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Dependency dependencies = 1; + */ + public Builder addDependencies(int index, com.google.cloud.apihub.v1.Dependency value) { + if (dependenciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDependenciesIsMutable(); + dependencies_.add(index, value); + onChanged(); + } else { + dependenciesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The dependency resources present in the API hub.
+     * Only following field will be populated in the response: name.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Dependency dependencies = 1; + */ + public Builder addDependencies(com.google.cloud.apihub.v1.Dependency.Builder builderForValue) { + if (dependenciesBuilder_ == null) { + ensureDependenciesIsMutable(); + dependencies_.add(builderForValue.build()); + onChanged(); + } else { + dependenciesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The dependency resources present in the API hub.
+     * Only following field will be populated in the response: name.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Dependency dependencies = 1; + */ + public Builder addDependencies( + int index, com.google.cloud.apihub.v1.Dependency.Builder builderForValue) { + if (dependenciesBuilder_ == null) { + ensureDependenciesIsMutable(); + dependencies_.add(index, builderForValue.build()); + onChanged(); + } else { + dependenciesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The dependency resources present in the API hub.
+     * Only following field will be populated in the response: name.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Dependency dependencies = 1; + */ + public Builder addAllDependencies( + java.lang.Iterable values) { + if (dependenciesBuilder_ == null) { + ensureDependenciesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dependencies_); + onChanged(); + } else { + dependenciesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The dependency resources present in the API hub.
+     * Only following field will be populated in the response: name.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Dependency dependencies = 1; + */ + public Builder clearDependencies() { + if (dependenciesBuilder_ == null) { + dependencies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + dependenciesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The dependency resources present in the API hub.
+     * Only following field will be populated in the response: name.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Dependency dependencies = 1; + */ + public Builder removeDependencies(int index) { + if (dependenciesBuilder_ == null) { + ensureDependenciesIsMutable(); + dependencies_.remove(index); + onChanged(); + } else { + dependenciesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The dependency resources present in the API hub.
+     * Only following field will be populated in the response: name.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Dependency dependencies = 1; + */ + public com.google.cloud.apihub.v1.Dependency.Builder getDependenciesBuilder(int index) { + return getDependenciesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The dependency resources present in the API hub.
+     * Only following field will be populated in the response: name.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Dependency dependencies = 1; + */ + public com.google.cloud.apihub.v1.DependencyOrBuilder getDependenciesOrBuilder(int index) { + if (dependenciesBuilder_ == null) { + return dependencies_.get(index); + } else { + return dependenciesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The dependency resources present in the API hub.
+     * Only following field will be populated in the response: name.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Dependency dependencies = 1; + */ + public java.util.List + getDependenciesOrBuilderList() { + if (dependenciesBuilder_ != null) { + return dependenciesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(dependencies_); + } + } + /** + * + * + *
+     * The dependency resources present in the API hub.
+     * Only following field will be populated in the response: name.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Dependency dependencies = 1; + */ + public com.google.cloud.apihub.v1.Dependency.Builder addDependenciesBuilder() { + return getDependenciesFieldBuilder() + .addBuilder(com.google.cloud.apihub.v1.Dependency.getDefaultInstance()); + } + /** + * + * + *
+     * The dependency resources present in the API hub.
+     * Only following field will be populated in the response: name.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Dependency dependencies = 1; + */ + public com.google.cloud.apihub.v1.Dependency.Builder addDependenciesBuilder(int index) { + return getDependenciesFieldBuilder() + .addBuilder(index, com.google.cloud.apihub.v1.Dependency.getDefaultInstance()); + } + /** + * + * + *
+     * The dependency resources present in the API hub.
+     * Only following field will be populated in the response: name.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Dependency dependencies = 1; + */ + public java.util.List + getDependenciesBuilderList() { + return getDependenciesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.Dependency, + com.google.cloud.apihub.v1.Dependency.Builder, + com.google.cloud.apihub.v1.DependencyOrBuilder> + getDependenciesFieldBuilder() { + if (dependenciesBuilder_ == null) { + dependenciesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.Dependency, + com.google.cloud.apihub.v1.Dependency.Builder, + com.google.cloud.apihub.v1.DependencyOrBuilder>( + dependencies_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + dependencies_ = null; + } + return dependenciesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + 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.apihub.v1.ListDependenciesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.ListDependenciesResponse) + private static final com.google.cloud.apihub.v1.ListDependenciesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.ListDependenciesResponse(); + } + + public static com.google.cloud.apihub.v1.ListDependenciesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListDependenciesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.ListDependenciesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDependenciesResponseOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDependenciesResponseOrBuilder.java new file mode 100644 index 000000000000..6cd37c332602 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDependenciesResponseOrBuilder.java @@ -0,0 +1,110 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface ListDependenciesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.ListDependenciesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The dependency resources present in the API hub.
+   * Only following field will be populated in the response: name.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Dependency dependencies = 1; + */ + java.util.List getDependenciesList(); + /** + * + * + *
+   * The dependency resources present in the API hub.
+   * Only following field will be populated in the response: name.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Dependency dependencies = 1; + */ + com.google.cloud.apihub.v1.Dependency getDependencies(int index); + /** + * + * + *
+   * The dependency resources present in the API hub.
+   * Only following field will be populated in the response: name.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Dependency dependencies = 1; + */ + int getDependenciesCount(); + /** + * + * + *
+   * The dependency resources present in the API hub.
+   * Only following field will be populated in the response: name.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Dependency dependencies = 1; + */ + java.util.List + getDependenciesOrBuilderList(); + /** + * + * + *
+   * The dependency resources present in the API hub.
+   * Only following field will be populated in the response: name.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Dependency dependencies = 1; + */ + com.google.cloud.apihub.v1.DependencyOrBuilder getDependenciesOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDeploymentsRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDeploymentsRequest.java new file mode 100644 index 000000000000..e5dff62a37b6 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDeploymentsRequest.java @@ -0,0 +1,1544 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [ListDeployments][google.cloud.apihub.v1.ApiHub.ListDeployments] method's
+ * request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListDeploymentsRequest} + */ +public final class ListDeploymentsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.ListDeploymentsRequest) + ListDeploymentsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListDeploymentsRequest.newBuilder() to construct. + private ListDeploymentsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListDeploymentsRequest() { + parent_ = ""; + filter_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListDeploymentsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListDeploymentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListDeploymentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListDeploymentsRequest.class, + com.google.cloud.apihub.v1.ListDeploymentsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent, which owns this collection of deployment resources.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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 parent, which owns this collection of deployment resources.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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 FILTER_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. An expression that filters the list of Deployments.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string. The
+   * comparison operator must be one of: `<`, `>` or
+   * `=`. Filters are not case sensitive.
+   *
+   * The following fields in the `Deployments` are eligible for filtering:
+   *
+   *   * `display_name` - The display name of the Deployment. Allowed
+   *   comparison operators: `=`.
+   *   * `create_time` - The time at which the Deployment was created. The
+   *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+   *   format. Allowed comparison operators: `>` and `<`.
+   *   * `resource_uri` - A URI to the deployment resource. Allowed
+   *   comparison operators: `=`.
+   *   * `api_versions` - The API versions linked to this deployment. Allowed
+   *   comparison operators: `:`.
+   *   * `deployment_type.enum_values.values.id` - The allowed value id of the
+   *   deployment_type attribute associated with the Deployment. Allowed
+   *   comparison operators: `:`.
+   *   * `deployment_type.enum_values.values.display_name` - The allowed value
+   *   display name of the deployment_type attribute associated with the
+   *   Deployment. Allowed comparison operators: `:`.
+   *   * `slo.string_values.values` -The allowed string value of the slo
+   *   attribute associated with the deployment. Allowed comparison
+   *   operators: `:`.
+   *   * `environment.enum_values.values.id` - The allowed value id of the
+   *   environment attribute associated with the deployment. Allowed
+   *   comparison operators: `:`.
+   *   * `environment.enum_values.values.display_name` - The allowed value
+   *   display name of the environment attribute associated with the deployment.
+   *   Allowed comparison operators: `:`.
+   *
+   * Expressions are combined with either `AND` logic operator or `OR` logical
+   * operator but not both of them together i.e. only one of the `AND` or `OR`
+   * operator can be used throughout the filter string and both the operators
+   * cannot be used together. No other logical operators are supported. At most
+   * three filter fields are allowed in the filter string and if provided
+   * more than that then `INVALID_ARGUMENT` error is returned by the API.
+   *
+   * Here are a few examples:
+   *
+   *   * `environment.enum_values.values.id: staging-id` - The allowed value id
+   *   of the environment attribute associated with the Deployment is
+   *   _staging-id_.
+   *   * `environment.enum_values.values.display_name: \"Staging Deployment\"` -
+   *   The allowed value display name of the environment attribute associated
+   *   with the Deployment is `Staging Deployment`.
+   *   * `environment.enum_values.values.id: production-id AND create_time <
+   *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+   *   The allowed value id of the environment attribute associated with the
+   *   Deployment is _production-id_ and Deployment was created before
+   *   _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
+   *   * `environment.enum_values.values.id: production-id OR
+   *   slo.string_values.values: \"99.99%\"`
+   *   - The allowed value id of the environment attribute Deployment is
+   *   _production-id_ or string value of the slo attribute is _99.99%_.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + 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(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An expression that filters the list of Deployments.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string. The
+   * comparison operator must be one of: `<`, `>` or
+   * `=`. Filters are not case sensitive.
+   *
+   * The following fields in the `Deployments` are eligible for filtering:
+   *
+   *   * `display_name` - The display name of the Deployment. Allowed
+   *   comparison operators: `=`.
+   *   * `create_time` - The time at which the Deployment was created. The
+   *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+   *   format. Allowed comparison operators: `>` and `<`.
+   *   * `resource_uri` - A URI to the deployment resource. Allowed
+   *   comparison operators: `=`.
+   *   * `api_versions` - The API versions linked to this deployment. Allowed
+   *   comparison operators: `:`.
+   *   * `deployment_type.enum_values.values.id` - The allowed value id of the
+   *   deployment_type attribute associated with the Deployment. Allowed
+   *   comparison operators: `:`.
+   *   * `deployment_type.enum_values.values.display_name` - The allowed value
+   *   display name of the deployment_type attribute associated with the
+   *   Deployment. Allowed comparison operators: `:`.
+   *   * `slo.string_values.values` -The allowed string value of the slo
+   *   attribute associated with the deployment. Allowed comparison
+   *   operators: `:`.
+   *   * `environment.enum_values.values.id` - The allowed value id of the
+   *   environment attribute associated with the deployment. Allowed
+   *   comparison operators: `:`.
+   *   * `environment.enum_values.values.display_name` - The allowed value
+   *   display name of the environment attribute associated with the deployment.
+   *   Allowed comparison operators: `:`.
+   *
+   * Expressions are combined with either `AND` logic operator or `OR` logical
+   * operator but not both of them together i.e. only one of the `AND` or `OR`
+   * operator can be used throughout the filter string and both the operators
+   * cannot be used together. No other logical operators are supported. At most
+   * three filter fields are allowed in the filter string and if provided
+   * more than that then `INVALID_ARGUMENT` error is returned by the API.
+   *
+   * Here are a few examples:
+   *
+   *   * `environment.enum_values.values.id: staging-id` - The allowed value id
+   *   of the environment attribute associated with the Deployment is
+   *   _staging-id_.
+   *   * `environment.enum_values.values.display_name: \"Staging Deployment\"` -
+   *   The allowed value display name of the environment attribute associated
+   *   with the Deployment is `Staging Deployment`.
+   *   * `environment.enum_values.values.id: production-id AND create_time <
+   *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+   *   The allowed value id of the environment attribute associated with the
+   *   Deployment is _production-id_ and Deployment was created before
+   *   _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
+   *   * `environment.enum_values.values.id: production-id OR
+   *   slo.string_values.values: \"99.99%\"`
+   *   - The allowed value id of the environment attribute Deployment is
+   *   _production-id_ or string value of the slo attribute is _99.99%_.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_ = 0; + /** + * + * + *
+   * Optional. The maximum number of deployment resources to return. The service
+   * may return fewer than this value. If unspecified, at most 50 deployments
+   * will be returned. The maximum value is 1000; values above 1000 will be
+   * coerced to 1000.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Optional. A page token, received from a previous `ListDeployments` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters (except page_size) provided to
+   * `ListDeployments` must match the call that provided the page token.
+   * 
+ * + * string page_token = 4 [(.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 page token, received from a previous `ListDeployments` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters (except page_size) provided to
+   * `ListDeployments` must match the call that provided the page token.
+   * 
+ * + * string page_token = 4 [(.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + size += getUnknownFields().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.apihub.v1.ListDeploymentsRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.ListDeploymentsRequest other = + (com.google.cloud.apihub.v1.ListDeploymentsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.ListDeploymentsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListDeploymentsRequest 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.apihub.v1.ListDeploymentsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListDeploymentsRequest 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.apihub.v1.ListDeploymentsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListDeploymentsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.ListDeploymentsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListDeploymentsRequest 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.apihub.v1.ListDeploymentsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListDeploymentsRequest 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.apihub.v1.ListDeploymentsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListDeploymentsRequest 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.apihub.v1.ListDeploymentsRequest 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 [ListDeployments][google.cloud.apihub.v1.ApiHub.ListDeployments] method's
+   * request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListDeploymentsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.ListDeploymentsRequest) + com.google.cloud.apihub.v1.ListDeploymentsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListDeploymentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListDeploymentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListDeploymentsRequest.class, + com.google.cloud.apihub.v1.ListDeploymentsRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.ListDeploymentsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + filter_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListDeploymentsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListDeploymentsRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.ListDeploymentsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListDeploymentsRequest build() { + com.google.cloud.apihub.v1.ListDeploymentsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListDeploymentsRequest buildPartial() { + com.google.cloud.apihub.v1.ListDeploymentsRequest result = + new com.google.cloud.apihub.v1.ListDeploymentsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.ListDeploymentsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @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.apihub.v1.ListDeploymentsRequest) { + return mergeFrom((com.google.cloud.apihub.v1.ListDeploymentsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.ListDeploymentsRequest other) { + if (other == com.google.cloud.apihub.v1.ListDeploymentsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent, which owns this collection of deployment resources.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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 parent, which owns this collection of deployment resources.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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 parent, which owns this collection of deployment resources.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent, which owns this collection of deployment resources.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent, which owns this collection of deployment resources.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. An expression that filters the list of Deployments.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string. The
+     * comparison operator must be one of: `<`, `>` or
+     * `=`. Filters are not case sensitive.
+     *
+     * The following fields in the `Deployments` are eligible for filtering:
+     *
+     *   * `display_name` - The display name of the Deployment. Allowed
+     *   comparison operators: `=`.
+     *   * `create_time` - The time at which the Deployment was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *   * `resource_uri` - A URI to the deployment resource. Allowed
+     *   comparison operators: `=`.
+     *   * `api_versions` - The API versions linked to this deployment. Allowed
+     *   comparison operators: `:`.
+     *   * `deployment_type.enum_values.values.id` - The allowed value id of the
+     *   deployment_type attribute associated with the Deployment. Allowed
+     *   comparison operators: `:`.
+     *   * `deployment_type.enum_values.values.display_name` - The allowed value
+     *   display name of the deployment_type attribute associated with the
+     *   Deployment. Allowed comparison operators: `:`.
+     *   * `slo.string_values.values` -The allowed string value of the slo
+     *   attribute associated with the deployment. Allowed comparison
+     *   operators: `:`.
+     *   * `environment.enum_values.values.id` - The allowed value id of the
+     *   environment attribute associated with the deployment. Allowed
+     *   comparison operators: `:`.
+     *   * `environment.enum_values.values.display_name` - The allowed value
+     *   display name of the environment attribute associated with the deployment.
+     *   Allowed comparison operators: `:`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are supported. At most
+     * three filter fields are allowed in the filter string and if provided
+     * more than that then `INVALID_ARGUMENT` error is returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `environment.enum_values.values.id: staging-id` - The allowed value id
+     *   of the environment attribute associated with the Deployment is
+     *   _staging-id_.
+     *   * `environment.enum_values.values.display_name: \"Staging Deployment\"` -
+     *   The allowed value display name of the environment attribute associated
+     *   with the Deployment is `Staging Deployment`.
+     *   * `environment.enum_values.values.id: production-id AND create_time <
+     *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+     *   The allowed value id of the environment attribute associated with the
+     *   Deployment is _production-id_ and Deployment was created before
+     *   _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
+     *   * `environment.enum_values.values.id: production-id OR
+     *   slo.string_values.values: \"99.99%\"`
+     *   - The allowed value id of the environment attribute Deployment is
+     *   _production-id_ or string value of the slo attribute is _99.99%_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An expression that filters the list of Deployments.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string. The
+     * comparison operator must be one of: `<`, `>` or
+     * `=`. Filters are not case sensitive.
+     *
+     * The following fields in the `Deployments` are eligible for filtering:
+     *
+     *   * `display_name` - The display name of the Deployment. Allowed
+     *   comparison operators: `=`.
+     *   * `create_time` - The time at which the Deployment was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *   * `resource_uri` - A URI to the deployment resource. Allowed
+     *   comparison operators: `=`.
+     *   * `api_versions` - The API versions linked to this deployment. Allowed
+     *   comparison operators: `:`.
+     *   * `deployment_type.enum_values.values.id` - The allowed value id of the
+     *   deployment_type attribute associated with the Deployment. Allowed
+     *   comparison operators: `:`.
+     *   * `deployment_type.enum_values.values.display_name` - The allowed value
+     *   display name of the deployment_type attribute associated with the
+     *   Deployment. Allowed comparison operators: `:`.
+     *   * `slo.string_values.values` -The allowed string value of the slo
+     *   attribute associated with the deployment. Allowed comparison
+     *   operators: `:`.
+     *   * `environment.enum_values.values.id` - The allowed value id of the
+     *   environment attribute associated with the deployment. Allowed
+     *   comparison operators: `:`.
+     *   * `environment.enum_values.values.display_name` - The allowed value
+     *   display name of the environment attribute associated with the deployment.
+     *   Allowed comparison operators: `:`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are supported. At most
+     * three filter fields are allowed in the filter string and if provided
+     * more than that then `INVALID_ARGUMENT` error is returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `environment.enum_values.values.id: staging-id` - The allowed value id
+     *   of the environment attribute associated with the Deployment is
+     *   _staging-id_.
+     *   * `environment.enum_values.values.display_name: \"Staging Deployment\"` -
+     *   The allowed value display name of the environment attribute associated
+     *   with the Deployment is `Staging Deployment`.
+     *   * `environment.enum_values.values.id: production-id AND create_time <
+     *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+     *   The allowed value id of the environment attribute associated with the
+     *   Deployment is _production-id_ and Deployment was created before
+     *   _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
+     *   * `environment.enum_values.values.id: production-id OR
+     *   slo.string_values.values: \"99.99%\"`
+     *   - The allowed value id of the environment attribute Deployment is
+     *   _production-id_ or string value of the slo attribute is _99.99%_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An expression that filters the list of Deployments.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string. The
+     * comparison operator must be one of: `<`, `>` or
+     * `=`. Filters are not case sensitive.
+     *
+     * The following fields in the `Deployments` are eligible for filtering:
+     *
+     *   * `display_name` - The display name of the Deployment. Allowed
+     *   comparison operators: `=`.
+     *   * `create_time` - The time at which the Deployment was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *   * `resource_uri` - A URI to the deployment resource. Allowed
+     *   comparison operators: `=`.
+     *   * `api_versions` - The API versions linked to this deployment. Allowed
+     *   comparison operators: `:`.
+     *   * `deployment_type.enum_values.values.id` - The allowed value id of the
+     *   deployment_type attribute associated with the Deployment. Allowed
+     *   comparison operators: `:`.
+     *   * `deployment_type.enum_values.values.display_name` - The allowed value
+     *   display name of the deployment_type attribute associated with the
+     *   Deployment. Allowed comparison operators: `:`.
+     *   * `slo.string_values.values` -The allowed string value of the slo
+     *   attribute associated with the deployment. Allowed comparison
+     *   operators: `:`.
+     *   * `environment.enum_values.values.id` - The allowed value id of the
+     *   environment attribute associated with the deployment. Allowed
+     *   comparison operators: `:`.
+     *   * `environment.enum_values.values.display_name` - The allowed value
+     *   display name of the environment attribute associated with the deployment.
+     *   Allowed comparison operators: `:`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are supported. At most
+     * three filter fields are allowed in the filter string and if provided
+     * more than that then `INVALID_ARGUMENT` error is returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `environment.enum_values.values.id: staging-id` - The allowed value id
+     *   of the environment attribute associated with the Deployment is
+     *   _staging-id_.
+     *   * `environment.enum_values.values.display_name: \"Staging Deployment\"` -
+     *   The allowed value display name of the environment attribute associated
+     *   with the Deployment is `Staging Deployment`.
+     *   * `environment.enum_values.values.id: production-id AND create_time <
+     *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+     *   The allowed value id of the environment attribute associated with the
+     *   Deployment is _production-id_ and Deployment was created before
+     *   _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
+     *   * `environment.enum_values.values.id: production-id OR
+     *   slo.string_values.values: \"99.99%\"`
+     *   - The allowed value id of the environment attribute Deployment is
+     *   _production-id_ or string value of the slo attribute is _99.99%_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An expression that filters the list of Deployments.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string. The
+     * comparison operator must be one of: `<`, `>` or
+     * `=`. Filters are not case sensitive.
+     *
+     * The following fields in the `Deployments` are eligible for filtering:
+     *
+     *   * `display_name` - The display name of the Deployment. Allowed
+     *   comparison operators: `=`.
+     *   * `create_time` - The time at which the Deployment was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *   * `resource_uri` - A URI to the deployment resource. Allowed
+     *   comparison operators: `=`.
+     *   * `api_versions` - The API versions linked to this deployment. Allowed
+     *   comparison operators: `:`.
+     *   * `deployment_type.enum_values.values.id` - The allowed value id of the
+     *   deployment_type attribute associated with the Deployment. Allowed
+     *   comparison operators: `:`.
+     *   * `deployment_type.enum_values.values.display_name` - The allowed value
+     *   display name of the deployment_type attribute associated with the
+     *   Deployment. Allowed comparison operators: `:`.
+     *   * `slo.string_values.values` -The allowed string value of the slo
+     *   attribute associated with the deployment. Allowed comparison
+     *   operators: `:`.
+     *   * `environment.enum_values.values.id` - The allowed value id of the
+     *   environment attribute associated with the deployment. Allowed
+     *   comparison operators: `:`.
+     *   * `environment.enum_values.values.display_name` - The allowed value
+     *   display name of the environment attribute associated with the deployment.
+     *   Allowed comparison operators: `:`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are supported. At most
+     * three filter fields are allowed in the filter string and if provided
+     * more than that then `INVALID_ARGUMENT` error is returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `environment.enum_values.values.id: staging-id` - The allowed value id
+     *   of the environment attribute associated with the Deployment is
+     *   _staging-id_.
+     *   * `environment.enum_values.values.display_name: \"Staging Deployment\"` -
+     *   The allowed value display name of the environment attribute associated
+     *   with the Deployment is `Staging Deployment`.
+     *   * `environment.enum_values.values.id: production-id AND create_time <
+     *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+     *   The allowed value id of the environment attribute associated with the
+     *   Deployment is _production-id_ and Deployment was created before
+     *   _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
+     *   * `environment.enum_values.values.id: production-id OR
+     *   slo.string_values.values: \"99.99%\"`
+     *   - The allowed value id of the environment attribute Deployment is
+     *   _production-id_ or string value of the slo attribute is _99.99%_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An expression that filters the list of Deployments.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string. The
+     * comparison operator must be one of: `<`, `>` or
+     * `=`. Filters are not case sensitive.
+     *
+     * The following fields in the `Deployments` are eligible for filtering:
+     *
+     *   * `display_name` - The display name of the Deployment. Allowed
+     *   comparison operators: `=`.
+     *   * `create_time` - The time at which the Deployment was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *   * `resource_uri` - A URI to the deployment resource. Allowed
+     *   comparison operators: `=`.
+     *   * `api_versions` - The API versions linked to this deployment. Allowed
+     *   comparison operators: `:`.
+     *   * `deployment_type.enum_values.values.id` - The allowed value id of the
+     *   deployment_type attribute associated with the Deployment. Allowed
+     *   comparison operators: `:`.
+     *   * `deployment_type.enum_values.values.display_name` - The allowed value
+     *   display name of the deployment_type attribute associated with the
+     *   Deployment. Allowed comparison operators: `:`.
+     *   * `slo.string_values.values` -The allowed string value of the slo
+     *   attribute associated with the deployment. Allowed comparison
+     *   operators: `:`.
+     *   * `environment.enum_values.values.id` - The allowed value id of the
+     *   environment attribute associated with the deployment. Allowed
+     *   comparison operators: `:`.
+     *   * `environment.enum_values.values.display_name` - The allowed value
+     *   display name of the environment attribute associated with the deployment.
+     *   Allowed comparison operators: `:`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are supported. At most
+     * three filter fields are allowed in the filter string and if provided
+     * more than that then `INVALID_ARGUMENT` error is returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `environment.enum_values.values.id: staging-id` - The allowed value id
+     *   of the environment attribute associated with the Deployment is
+     *   _staging-id_.
+     *   * `environment.enum_values.values.display_name: \"Staging Deployment\"` -
+     *   The allowed value display name of the environment attribute associated
+     *   with the Deployment is `Staging Deployment`.
+     *   * `environment.enum_values.values.id: production-id AND create_time <
+     *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+     *   The allowed value id of the environment attribute associated with the
+     *   Deployment is _production-id_ and Deployment was created before
+     *   _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
+     *   * `environment.enum_values.values.id: production-id OR
+     *   slo.string_values.values: \"99.99%\"`
+     *   - The allowed value id of the environment attribute Deployment is
+     *   _production-id_ or string value of the slo attribute is _99.99%_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of deployment resources to return. The service
+     * may return fewer than this value. If unspecified, at most 50 deployments
+     * will be returned. The maximum value is 1000; values above 1000 will be
+     * coerced to 1000.
+     * 
+ * + * 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 deployment resources to return. The service
+     * may return fewer than this value. If unspecified, at most 50 deployments
+     * will be returned. The maximum value is 1000; values above 1000 will be
+     * coerced to 1000.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of deployment resources to return. The service
+     * may return fewer than this value. If unspecified, at most 50 deployments
+     * will be returned. The maximum value is 1000; values above 1000 will be
+     * coerced to 1000.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000004); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A page token, received from a previous `ListDeployments` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListDeployments` must match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.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 page token, received from a previous `ListDeployments` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListDeployments` must match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.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 page token, received from a previous `ListDeployments` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListDeployments` must match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous `ListDeployments` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListDeployments` must match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous `ListDeployments` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListDeployments` must match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.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; + bitField0_ |= 0x00000008; + 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.apihub.v1.ListDeploymentsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.ListDeploymentsRequest) + private static final com.google.cloud.apihub.v1.ListDeploymentsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.ListDeploymentsRequest(); + } + + public static com.google.cloud.apihub.v1.ListDeploymentsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListDeploymentsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.ListDeploymentsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDeploymentsRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDeploymentsRequestOrBuilder.java new file mode 100644 index 000000000000..63c77a36df58 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDeploymentsRequestOrBuilder.java @@ -0,0 +1,245 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface ListDeploymentsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.ListDeploymentsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent, which owns this collection of deployment resources.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent, which owns this collection of deployment resources.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. An expression that filters the list of Deployments.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string. The
+   * comparison operator must be one of: `<`, `>` or
+   * `=`. Filters are not case sensitive.
+   *
+   * The following fields in the `Deployments` are eligible for filtering:
+   *
+   *   * `display_name` - The display name of the Deployment. Allowed
+   *   comparison operators: `=`.
+   *   * `create_time` - The time at which the Deployment was created. The
+   *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+   *   format. Allowed comparison operators: `>` and `<`.
+   *   * `resource_uri` - A URI to the deployment resource. Allowed
+   *   comparison operators: `=`.
+   *   * `api_versions` - The API versions linked to this deployment. Allowed
+   *   comparison operators: `:`.
+   *   * `deployment_type.enum_values.values.id` - The allowed value id of the
+   *   deployment_type attribute associated with the Deployment. Allowed
+   *   comparison operators: `:`.
+   *   * `deployment_type.enum_values.values.display_name` - The allowed value
+   *   display name of the deployment_type attribute associated with the
+   *   Deployment. Allowed comparison operators: `:`.
+   *   * `slo.string_values.values` -The allowed string value of the slo
+   *   attribute associated with the deployment. Allowed comparison
+   *   operators: `:`.
+   *   * `environment.enum_values.values.id` - The allowed value id of the
+   *   environment attribute associated with the deployment. Allowed
+   *   comparison operators: `:`.
+   *   * `environment.enum_values.values.display_name` - The allowed value
+   *   display name of the environment attribute associated with the deployment.
+   *   Allowed comparison operators: `:`.
+   *
+   * Expressions are combined with either `AND` logic operator or `OR` logical
+   * operator but not both of them together i.e. only one of the `AND` or `OR`
+   * operator can be used throughout the filter string and both the operators
+   * cannot be used together. No other logical operators are supported. At most
+   * three filter fields are allowed in the filter string and if provided
+   * more than that then `INVALID_ARGUMENT` error is returned by the API.
+   *
+   * Here are a few examples:
+   *
+   *   * `environment.enum_values.values.id: staging-id` - The allowed value id
+   *   of the environment attribute associated with the Deployment is
+   *   _staging-id_.
+   *   * `environment.enum_values.values.display_name: \"Staging Deployment\"` -
+   *   The allowed value display name of the environment attribute associated
+   *   with the Deployment is `Staging Deployment`.
+   *   * `environment.enum_values.values.id: production-id AND create_time <
+   *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+   *   The allowed value id of the environment attribute associated with the
+   *   Deployment is _production-id_ and Deployment was created before
+   *   _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
+   *   * `environment.enum_values.values.id: production-id OR
+   *   slo.string_values.values: \"99.99%\"`
+   *   - The allowed value id of the environment attribute Deployment is
+   *   _production-id_ or string value of the slo attribute is _99.99%_.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. An expression that filters the list of Deployments.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string. The
+   * comparison operator must be one of: `<`, `>` or
+   * `=`. Filters are not case sensitive.
+   *
+   * The following fields in the `Deployments` are eligible for filtering:
+   *
+   *   * `display_name` - The display name of the Deployment. Allowed
+   *   comparison operators: `=`.
+   *   * `create_time` - The time at which the Deployment was created. The
+   *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+   *   format. Allowed comparison operators: `>` and `<`.
+   *   * `resource_uri` - A URI to the deployment resource. Allowed
+   *   comparison operators: `=`.
+   *   * `api_versions` - The API versions linked to this deployment. Allowed
+   *   comparison operators: `:`.
+   *   * `deployment_type.enum_values.values.id` - The allowed value id of the
+   *   deployment_type attribute associated with the Deployment. Allowed
+   *   comparison operators: `:`.
+   *   * `deployment_type.enum_values.values.display_name` - The allowed value
+   *   display name of the deployment_type attribute associated with the
+   *   Deployment. Allowed comparison operators: `:`.
+   *   * `slo.string_values.values` -The allowed string value of the slo
+   *   attribute associated with the deployment. Allowed comparison
+   *   operators: `:`.
+   *   * `environment.enum_values.values.id` - The allowed value id of the
+   *   environment attribute associated with the deployment. Allowed
+   *   comparison operators: `:`.
+   *   * `environment.enum_values.values.display_name` - The allowed value
+   *   display name of the environment attribute associated with the deployment.
+   *   Allowed comparison operators: `:`.
+   *
+   * Expressions are combined with either `AND` logic operator or `OR` logical
+   * operator but not both of them together i.e. only one of the `AND` or `OR`
+   * operator can be used throughout the filter string and both the operators
+   * cannot be used together. No other logical operators are supported. At most
+   * three filter fields are allowed in the filter string and if provided
+   * more than that then `INVALID_ARGUMENT` error is returned by the API.
+   *
+   * Here are a few examples:
+   *
+   *   * `environment.enum_values.values.id: staging-id` - The allowed value id
+   *   of the environment attribute associated with the Deployment is
+   *   _staging-id_.
+   *   * `environment.enum_values.values.display_name: \"Staging Deployment\"` -
+   *   The allowed value display name of the environment attribute associated
+   *   with the Deployment is `Staging Deployment`.
+   *   * `environment.enum_values.values.id: production-id AND create_time <
+   *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+   *   The allowed value id of the environment attribute associated with the
+   *   Deployment is _production-id_ and Deployment was created before
+   *   _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
+   *   * `environment.enum_values.values.id: production-id OR
+   *   slo.string_values.values: \"99.99%\"`
+   *   - The allowed value id of the environment attribute Deployment is
+   *   _production-id_ or string value of the slo attribute is _99.99%_.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. The maximum number of deployment resources to return. The service
+   * may return fewer than this value. If unspecified, at most 50 deployments
+   * will be returned. The maximum value is 1000; values above 1000 will be
+   * coerced to 1000.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListDeployments` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters (except page_size) provided to
+   * `ListDeployments` must match the call that provided the page token.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A page token, received from a previous `ListDeployments` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters (except page_size) provided to
+   * `ListDeployments` must match the call that provided the page token.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDeploymentsResponse.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDeploymentsResponse.java new file mode 100644 index 000000000000..fbff6f5c3953 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDeploymentsResponse.java @@ -0,0 +1,1127 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [ListDeployments][google.cloud.apihub.v1.ApiHub.ListDeployments] method's
+ * response.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListDeploymentsResponse} + */ +public final class ListDeploymentsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.ListDeploymentsResponse) + ListDeploymentsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListDeploymentsResponse.newBuilder() to construct. + private ListDeploymentsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListDeploymentsResponse() { + deployments_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListDeploymentsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListDeploymentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListDeploymentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListDeploymentsResponse.class, + com.google.cloud.apihub.v1.ListDeploymentsResponse.Builder.class); + } + + public static final int DEPLOYMENTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List deployments_; + /** + * + * + *
+   * The deployment resources present in the API hub.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Deployment deployments = 1; + */ + @java.lang.Override + public java.util.List getDeploymentsList() { + return deployments_; + } + /** + * + * + *
+   * The deployment resources present in the API hub.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Deployment deployments = 1; + */ + @java.lang.Override + public java.util.List + getDeploymentsOrBuilderList() { + return deployments_; + } + /** + * + * + *
+   * The deployment resources present in the API hub.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Deployment deployments = 1; + */ + @java.lang.Override + public int getDeploymentsCount() { + return deployments_.size(); + } + /** + * + * + *
+   * The deployment resources present in the API hub.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Deployment deployments = 1; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Deployment getDeployments(int index) { + return deployments_.get(index); + } + /** + * + * + *
+   * The deployment resources present in the API hub.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Deployment deployments = 1; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.DeploymentOrBuilder getDeploymentsOrBuilder(int index) { + return deployments_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * 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 < deployments_.size(); i++) { + output.writeMessage(1, deployments_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < deployments_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, deployments_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().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.apihub.v1.ListDeploymentsResponse)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.ListDeploymentsResponse other = + (com.google.cloud.apihub.v1.ListDeploymentsResponse) obj; + + if (!getDeploymentsList().equals(other.getDeploymentsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDeploymentsCount() > 0) { + hash = (37 * hash) + DEPLOYMENTS_FIELD_NUMBER; + hash = (53 * hash) + getDeploymentsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.ListDeploymentsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListDeploymentsResponse 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.apihub.v1.ListDeploymentsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListDeploymentsResponse 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.apihub.v1.ListDeploymentsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListDeploymentsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.ListDeploymentsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListDeploymentsResponse 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.apihub.v1.ListDeploymentsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListDeploymentsResponse 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.apihub.v1.ListDeploymentsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListDeploymentsResponse 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.apihub.v1.ListDeploymentsResponse 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 [ListDeployments][google.cloud.apihub.v1.ApiHub.ListDeployments] method's
+   * response.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListDeploymentsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.ListDeploymentsResponse) + com.google.cloud.apihub.v1.ListDeploymentsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListDeploymentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListDeploymentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListDeploymentsResponse.class, + com.google.cloud.apihub.v1.ListDeploymentsResponse.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.ListDeploymentsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (deploymentsBuilder_ == null) { + deployments_ = java.util.Collections.emptyList(); + } else { + deployments_ = null; + deploymentsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListDeploymentsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListDeploymentsResponse getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.ListDeploymentsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListDeploymentsResponse build() { + com.google.cloud.apihub.v1.ListDeploymentsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListDeploymentsResponse buildPartial() { + com.google.cloud.apihub.v1.ListDeploymentsResponse result = + new com.google.cloud.apihub.v1.ListDeploymentsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.apihub.v1.ListDeploymentsResponse result) { + if (deploymentsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + deployments_ = java.util.Collections.unmodifiableList(deployments_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.deployments_ = deployments_; + } else { + result.deployments_ = deploymentsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.apihub.v1.ListDeploymentsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.apihub.v1.ListDeploymentsResponse) { + return mergeFrom((com.google.cloud.apihub.v1.ListDeploymentsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.ListDeploymentsResponse other) { + if (other == com.google.cloud.apihub.v1.ListDeploymentsResponse.getDefaultInstance()) + return this; + if (deploymentsBuilder_ == null) { + if (!other.deployments_.isEmpty()) { + if (deployments_.isEmpty()) { + deployments_ = other.deployments_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDeploymentsIsMutable(); + deployments_.addAll(other.deployments_); + } + onChanged(); + } + } else { + if (!other.deployments_.isEmpty()) { + if (deploymentsBuilder_.isEmpty()) { + deploymentsBuilder_.dispose(); + deploymentsBuilder_ = null; + deployments_ = other.deployments_; + bitField0_ = (bitField0_ & ~0x00000001); + deploymentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDeploymentsFieldBuilder() + : null; + } else { + deploymentsBuilder_.addAllMessages(other.deployments_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.apihub.v1.Deployment m = + input.readMessage( + com.google.cloud.apihub.v1.Deployment.parser(), extensionRegistry); + if (deploymentsBuilder_ == null) { + ensureDeploymentsIsMutable(); + deployments_.add(m); + } else { + deploymentsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List deployments_ = + java.util.Collections.emptyList(); + + private void ensureDeploymentsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + deployments_ = new java.util.ArrayList(deployments_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.Deployment, + com.google.cloud.apihub.v1.Deployment.Builder, + com.google.cloud.apihub.v1.DeploymentOrBuilder> + deploymentsBuilder_; + + /** + * + * + *
+     * The deployment resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Deployment deployments = 1; + */ + public java.util.List getDeploymentsList() { + if (deploymentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(deployments_); + } else { + return deploymentsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The deployment resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Deployment deployments = 1; + */ + public int getDeploymentsCount() { + if (deploymentsBuilder_ == null) { + return deployments_.size(); + } else { + return deploymentsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The deployment resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Deployment deployments = 1; + */ + public com.google.cloud.apihub.v1.Deployment getDeployments(int index) { + if (deploymentsBuilder_ == null) { + return deployments_.get(index); + } else { + return deploymentsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The deployment resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Deployment deployments = 1; + */ + public Builder setDeployments(int index, com.google.cloud.apihub.v1.Deployment value) { + if (deploymentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeploymentsIsMutable(); + deployments_.set(index, value); + onChanged(); + } else { + deploymentsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The deployment resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Deployment deployments = 1; + */ + public Builder setDeployments( + int index, com.google.cloud.apihub.v1.Deployment.Builder builderForValue) { + if (deploymentsBuilder_ == null) { + ensureDeploymentsIsMutable(); + deployments_.set(index, builderForValue.build()); + onChanged(); + } else { + deploymentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The deployment resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Deployment deployments = 1; + */ + public Builder addDeployments(com.google.cloud.apihub.v1.Deployment value) { + if (deploymentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeploymentsIsMutable(); + deployments_.add(value); + onChanged(); + } else { + deploymentsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The deployment resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Deployment deployments = 1; + */ + public Builder addDeployments(int index, com.google.cloud.apihub.v1.Deployment value) { + if (deploymentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeploymentsIsMutable(); + deployments_.add(index, value); + onChanged(); + } else { + deploymentsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The deployment resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Deployment deployments = 1; + */ + public Builder addDeployments(com.google.cloud.apihub.v1.Deployment.Builder builderForValue) { + if (deploymentsBuilder_ == null) { + ensureDeploymentsIsMutable(); + deployments_.add(builderForValue.build()); + onChanged(); + } else { + deploymentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The deployment resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Deployment deployments = 1; + */ + public Builder addDeployments( + int index, com.google.cloud.apihub.v1.Deployment.Builder builderForValue) { + if (deploymentsBuilder_ == null) { + ensureDeploymentsIsMutable(); + deployments_.add(index, builderForValue.build()); + onChanged(); + } else { + deploymentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The deployment resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Deployment deployments = 1; + */ + public Builder addAllDeployments( + java.lang.Iterable values) { + if (deploymentsBuilder_ == null) { + ensureDeploymentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, deployments_); + onChanged(); + } else { + deploymentsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The deployment resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Deployment deployments = 1; + */ + public Builder clearDeployments() { + if (deploymentsBuilder_ == null) { + deployments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + deploymentsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The deployment resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Deployment deployments = 1; + */ + public Builder removeDeployments(int index) { + if (deploymentsBuilder_ == null) { + ensureDeploymentsIsMutable(); + deployments_.remove(index); + onChanged(); + } else { + deploymentsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The deployment resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Deployment deployments = 1; + */ + public com.google.cloud.apihub.v1.Deployment.Builder getDeploymentsBuilder(int index) { + return getDeploymentsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The deployment resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Deployment deployments = 1; + */ + public com.google.cloud.apihub.v1.DeploymentOrBuilder getDeploymentsOrBuilder(int index) { + if (deploymentsBuilder_ == null) { + return deployments_.get(index); + } else { + return deploymentsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The deployment resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Deployment deployments = 1; + */ + public java.util.List + getDeploymentsOrBuilderList() { + if (deploymentsBuilder_ != null) { + return deploymentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(deployments_); + } + } + /** + * + * + *
+     * The deployment resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Deployment deployments = 1; + */ + public com.google.cloud.apihub.v1.Deployment.Builder addDeploymentsBuilder() { + return getDeploymentsFieldBuilder() + .addBuilder(com.google.cloud.apihub.v1.Deployment.getDefaultInstance()); + } + /** + * + * + *
+     * The deployment resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Deployment deployments = 1; + */ + public com.google.cloud.apihub.v1.Deployment.Builder addDeploymentsBuilder(int index) { + return getDeploymentsFieldBuilder() + .addBuilder(index, com.google.cloud.apihub.v1.Deployment.getDefaultInstance()); + } + /** + * + * + *
+     * The deployment resources present in the API hub.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Deployment deployments = 1; + */ + public java.util.List + getDeploymentsBuilderList() { + return getDeploymentsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.Deployment, + com.google.cloud.apihub.v1.Deployment.Builder, + com.google.cloud.apihub.v1.DeploymentOrBuilder> + getDeploymentsFieldBuilder() { + if (deploymentsBuilder_ == null) { + deploymentsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.Deployment, + com.google.cloud.apihub.v1.Deployment.Builder, + com.google.cloud.apihub.v1.DeploymentOrBuilder>( + deployments_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + deployments_ = null; + } + return deploymentsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + 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.apihub.v1.ListDeploymentsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.ListDeploymentsResponse) + private static final com.google.cloud.apihub.v1.ListDeploymentsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.ListDeploymentsResponse(); + } + + public static com.google.cloud.apihub.v1.ListDeploymentsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListDeploymentsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.ListDeploymentsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDeploymentsResponseOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDeploymentsResponseOrBuilder.java new file mode 100644 index 000000000000..f619902cc3ec --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListDeploymentsResponseOrBuilder.java @@ -0,0 +1,105 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface ListDeploymentsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.ListDeploymentsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The deployment resources present in the API hub.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Deployment deployments = 1; + */ + java.util.List getDeploymentsList(); + /** + * + * + *
+   * The deployment resources present in the API hub.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Deployment deployments = 1; + */ + com.google.cloud.apihub.v1.Deployment getDeployments(int index); + /** + * + * + *
+   * The deployment resources present in the API hub.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Deployment deployments = 1; + */ + int getDeploymentsCount(); + /** + * + * + *
+   * The deployment resources present in the API hub.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Deployment deployments = 1; + */ + java.util.List + getDeploymentsOrBuilderList(); + /** + * + * + *
+   * The deployment resources present in the API hub.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Deployment deployments = 1; + */ + com.google.cloud.apihub.v1.DeploymentOrBuilder getDeploymentsOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListExternalApisRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListExternalApisRequest.java new file mode 100644 index 000000000000..4545af38100d --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListExternalApisRequest.java @@ -0,0 +1,963 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [ListExternalApis][google.cloud.apihub.v1.ApiHub.ListExternalApis]
+ * method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListExternalApisRequest} + */ +public final class ListExternalApisRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.ListExternalApisRequest) + ListExternalApisRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListExternalApisRequest.newBuilder() to construct. + private ListExternalApisRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListExternalApisRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListExternalApisRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListExternalApisRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListExternalApisRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListExternalApisRequest.class, + com.google.cloud.apihub.v1.ListExternalApisRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent, which owns this collection of External API resources.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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 parent, which owns this collection of External API resources.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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_ = 0; + /** + * + * + *
+   * Optional. The maximum number of External API resources to return. The
+   * service may return fewer than this value. If unspecified, at most 50
+   * ExternalApis will be returned. The maximum value is 1000; values above 1000
+   * will be coerced to 1000.
+   * 
+ * + * 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; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Optional. A page token, received from a previous `ListExternalApis` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters (except page_size) provided to
+   * `ListExternalApis` must match the call that provided the page token.
+   * 
+ * + * 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 page token, received from a previous `ListExternalApis` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters (except page_size) provided to
+   * `ListExternalApis` must match the call that provided the page token.
+   * 
+ * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += getUnknownFields().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.apihub.v1.ListExternalApisRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.ListExternalApisRequest other = + (com.google.cloud.apihub.v1.ListExternalApisRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.ListExternalApisRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListExternalApisRequest 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.apihub.v1.ListExternalApisRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListExternalApisRequest 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.apihub.v1.ListExternalApisRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListExternalApisRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.ListExternalApisRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListExternalApisRequest 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.apihub.v1.ListExternalApisRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListExternalApisRequest 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.apihub.v1.ListExternalApisRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListExternalApisRequest 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.apihub.v1.ListExternalApisRequest 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 [ListExternalApis][google.cloud.apihub.v1.ApiHub.ListExternalApis]
+   * method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListExternalApisRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.ListExternalApisRequest) + com.google.cloud.apihub.v1.ListExternalApisRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListExternalApisRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListExternalApisRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListExternalApisRequest.class, + com.google.cloud.apihub.v1.ListExternalApisRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.ListExternalApisRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListExternalApisRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListExternalApisRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.ListExternalApisRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListExternalApisRequest build() { + com.google.cloud.apihub.v1.ListExternalApisRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListExternalApisRequest buildPartial() { + com.google.cloud.apihub.v1.ListExternalApisRequest result = + new com.google.cloud.apihub.v1.ListExternalApisRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.ListExternalApisRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @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.apihub.v1.ListExternalApisRequest) { + return mergeFrom((com.google.cloud.apihub.v1.ListExternalApisRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.ListExternalApisRequest other) { + if (other == com.google.cloud.apihub.v1.ListExternalApisRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent, which owns this collection of External API resources.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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 parent, which owns this collection of External API resources.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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 parent, which owns this collection of External API resources.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent, which owns this collection of External API resources.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent, which owns this collection of External API resources.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of External API resources to return. The
+     * service may return fewer than this value. If unspecified, at most 50
+     * ExternalApis will be returned. The maximum value is 1000; values above 1000
+     * will be coerced to 1000.
+     * 
+ * + * 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 External API resources to return. The
+     * service may return fewer than this value. If unspecified, at most 50
+     * ExternalApis will be returned. The maximum value is 1000; values above 1000
+     * will be coerced to 1000.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of External API resources to return. The
+     * service may return fewer than this value. If unspecified, at most 50
+     * ExternalApis will be returned. The maximum value is 1000; values above 1000
+     * will be coerced to 1000.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A page token, received from a previous `ListExternalApis` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListExternalApis` must match the call that provided the page token.
+     * 
+ * + * 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 page token, received from a previous `ListExternalApis` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListExternalApis` must match the call that provided the page token.
+     * 
+ * + * 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 page token, received from a previous `ListExternalApis` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListExternalApis` must match the call that provided the page token.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous `ListExternalApis` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListExternalApis` must match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous `ListExternalApis` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListExternalApis` must match the call that provided the page token.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + 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.apihub.v1.ListExternalApisRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.ListExternalApisRequest) + private static final com.google.cloud.apihub.v1.ListExternalApisRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.ListExternalApisRequest(); + } + + public static com.google.cloud.apihub.v1.ListExternalApisRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListExternalApisRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.ListExternalApisRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListExternalApisRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListExternalApisRequestOrBuilder.java new file mode 100644 index 000000000000..f6205cbfae39 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListExternalApisRequestOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface ListExternalApisRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.ListExternalApisRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent, which owns this collection of External API resources.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent, which owns this collection of External API resources.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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 External API resources to return. The
+   * service may return fewer than this value. If unspecified, at most 50
+   * ExternalApis will be returned. The maximum value is 1000; values above 1000
+   * will be coerced to 1000.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListExternalApis` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters (except page_size) provided to
+   * `ListExternalApis` must match the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A page token, received from a previous `ListExternalApis` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters (except page_size) provided to
+   * `ListExternalApis` must match the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListExternalApisResponse.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListExternalApisResponse.java new file mode 100644 index 000000000000..fb0ba12c9776 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListExternalApisResponse.java @@ -0,0 +1,1174 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [ListExternalApis][google.cloud.apihub.v1.ApiHub.ListExternalApis]
+ * method's response.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListExternalApisResponse} + */ +public final class ListExternalApisResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.ListExternalApisResponse) + ListExternalApisResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListExternalApisResponse.newBuilder() to construct. + private ListExternalApisResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListExternalApisResponse() { + externalApis_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListExternalApisResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListExternalApisResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListExternalApisResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListExternalApisResponse.class, + com.google.cloud.apihub.v1.ListExternalApisResponse.Builder.class); + } + + public static final int EXTERNAL_APIS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List externalApis_; + /** + * + * + *
+   * The External API resources present in the API hub.
+   * Only following fields will be populated in the response: name,
+   * display_name, documentation.external_uri.
+   * 
+ * + * repeated .google.cloud.apihub.v1.ExternalApi external_apis = 1; + */ + @java.lang.Override + public java.util.List getExternalApisList() { + return externalApis_; + } + /** + * + * + *
+   * The External API resources present in the API hub.
+   * Only following fields will be populated in the response: name,
+   * display_name, documentation.external_uri.
+   * 
+ * + * repeated .google.cloud.apihub.v1.ExternalApi external_apis = 1; + */ + @java.lang.Override + public java.util.List + getExternalApisOrBuilderList() { + return externalApis_; + } + /** + * + * + *
+   * The External API resources present in the API hub.
+   * Only following fields will be populated in the response: name,
+   * display_name, documentation.external_uri.
+   * 
+ * + * repeated .google.cloud.apihub.v1.ExternalApi external_apis = 1; + */ + @java.lang.Override + public int getExternalApisCount() { + return externalApis_.size(); + } + /** + * + * + *
+   * The External API resources present in the API hub.
+   * Only following fields will be populated in the response: name,
+   * display_name, documentation.external_uri.
+   * 
+ * + * repeated .google.cloud.apihub.v1.ExternalApi external_apis = 1; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.ExternalApi getExternalApis(int index) { + return externalApis_.get(index); + } + /** + * + * + *
+   * The External API resources present in the API hub.
+   * Only following fields will be populated in the response: name,
+   * display_name, documentation.external_uri.
+   * 
+ * + * repeated .google.cloud.apihub.v1.ExternalApi external_apis = 1; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.ExternalApiOrBuilder getExternalApisOrBuilder(int index) { + return externalApis_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * 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 < externalApis_.size(); i++) { + output.writeMessage(1, externalApis_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < externalApis_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, externalApis_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().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.apihub.v1.ListExternalApisResponse)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.ListExternalApisResponse other = + (com.google.cloud.apihub.v1.ListExternalApisResponse) obj; + + if (!getExternalApisList().equals(other.getExternalApisList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getExternalApisCount() > 0) { + hash = (37 * hash) + EXTERNAL_APIS_FIELD_NUMBER; + hash = (53 * hash) + getExternalApisList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.ListExternalApisResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListExternalApisResponse 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.apihub.v1.ListExternalApisResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListExternalApisResponse 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.apihub.v1.ListExternalApisResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListExternalApisResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.ListExternalApisResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListExternalApisResponse 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.apihub.v1.ListExternalApisResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListExternalApisResponse 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.apihub.v1.ListExternalApisResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListExternalApisResponse 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.apihub.v1.ListExternalApisResponse 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 [ListExternalApis][google.cloud.apihub.v1.ApiHub.ListExternalApis]
+   * method's response.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListExternalApisResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.ListExternalApisResponse) + com.google.cloud.apihub.v1.ListExternalApisResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListExternalApisResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListExternalApisResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListExternalApisResponse.class, + com.google.cloud.apihub.v1.ListExternalApisResponse.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.ListExternalApisResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (externalApisBuilder_ == null) { + externalApis_ = java.util.Collections.emptyList(); + } else { + externalApis_ = null; + externalApisBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListExternalApisResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListExternalApisResponse getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.ListExternalApisResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListExternalApisResponse build() { + com.google.cloud.apihub.v1.ListExternalApisResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListExternalApisResponse buildPartial() { + com.google.cloud.apihub.v1.ListExternalApisResponse result = + new com.google.cloud.apihub.v1.ListExternalApisResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.apihub.v1.ListExternalApisResponse result) { + if (externalApisBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + externalApis_ = java.util.Collections.unmodifiableList(externalApis_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.externalApis_ = externalApis_; + } else { + result.externalApis_ = externalApisBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.apihub.v1.ListExternalApisResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.apihub.v1.ListExternalApisResponse) { + return mergeFrom((com.google.cloud.apihub.v1.ListExternalApisResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.ListExternalApisResponse other) { + if (other == com.google.cloud.apihub.v1.ListExternalApisResponse.getDefaultInstance()) + return this; + if (externalApisBuilder_ == null) { + if (!other.externalApis_.isEmpty()) { + if (externalApis_.isEmpty()) { + externalApis_ = other.externalApis_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureExternalApisIsMutable(); + externalApis_.addAll(other.externalApis_); + } + onChanged(); + } + } else { + if (!other.externalApis_.isEmpty()) { + if (externalApisBuilder_.isEmpty()) { + externalApisBuilder_.dispose(); + externalApisBuilder_ = null; + externalApis_ = other.externalApis_; + bitField0_ = (bitField0_ & ~0x00000001); + externalApisBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getExternalApisFieldBuilder() + : null; + } else { + externalApisBuilder_.addAllMessages(other.externalApis_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.apihub.v1.ExternalApi m = + input.readMessage( + com.google.cloud.apihub.v1.ExternalApi.parser(), extensionRegistry); + if (externalApisBuilder_ == null) { + ensureExternalApisIsMutable(); + externalApis_.add(m); + } else { + externalApisBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List externalApis_ = + java.util.Collections.emptyList(); + + private void ensureExternalApisIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + externalApis_ = + new java.util.ArrayList(externalApis_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.ExternalApi, + com.google.cloud.apihub.v1.ExternalApi.Builder, + com.google.cloud.apihub.v1.ExternalApiOrBuilder> + externalApisBuilder_; + + /** + * + * + *
+     * The External API resources present in the API hub.
+     * Only following fields will be populated in the response: name,
+     * display_name, documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ExternalApi external_apis = 1; + */ + public java.util.List getExternalApisList() { + if (externalApisBuilder_ == null) { + return java.util.Collections.unmodifiableList(externalApis_); + } else { + return externalApisBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The External API resources present in the API hub.
+     * Only following fields will be populated in the response: name,
+     * display_name, documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ExternalApi external_apis = 1; + */ + public int getExternalApisCount() { + if (externalApisBuilder_ == null) { + return externalApis_.size(); + } else { + return externalApisBuilder_.getCount(); + } + } + /** + * + * + *
+     * The External API resources present in the API hub.
+     * Only following fields will be populated in the response: name,
+     * display_name, documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ExternalApi external_apis = 1; + */ + public com.google.cloud.apihub.v1.ExternalApi getExternalApis(int index) { + if (externalApisBuilder_ == null) { + return externalApis_.get(index); + } else { + return externalApisBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The External API resources present in the API hub.
+     * Only following fields will be populated in the response: name,
+     * display_name, documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ExternalApi external_apis = 1; + */ + public Builder setExternalApis(int index, com.google.cloud.apihub.v1.ExternalApi value) { + if (externalApisBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExternalApisIsMutable(); + externalApis_.set(index, value); + onChanged(); + } else { + externalApisBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The External API resources present in the API hub.
+     * Only following fields will be populated in the response: name,
+     * display_name, documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ExternalApi external_apis = 1; + */ + public Builder setExternalApis( + int index, com.google.cloud.apihub.v1.ExternalApi.Builder builderForValue) { + if (externalApisBuilder_ == null) { + ensureExternalApisIsMutable(); + externalApis_.set(index, builderForValue.build()); + onChanged(); + } else { + externalApisBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The External API resources present in the API hub.
+     * Only following fields will be populated in the response: name,
+     * display_name, documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ExternalApi external_apis = 1; + */ + public Builder addExternalApis(com.google.cloud.apihub.v1.ExternalApi value) { + if (externalApisBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExternalApisIsMutable(); + externalApis_.add(value); + onChanged(); + } else { + externalApisBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The External API resources present in the API hub.
+     * Only following fields will be populated in the response: name,
+     * display_name, documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ExternalApi external_apis = 1; + */ + public Builder addExternalApis(int index, com.google.cloud.apihub.v1.ExternalApi value) { + if (externalApisBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExternalApisIsMutable(); + externalApis_.add(index, value); + onChanged(); + } else { + externalApisBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The External API resources present in the API hub.
+     * Only following fields will be populated in the response: name,
+     * display_name, documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ExternalApi external_apis = 1; + */ + public Builder addExternalApis(com.google.cloud.apihub.v1.ExternalApi.Builder builderForValue) { + if (externalApisBuilder_ == null) { + ensureExternalApisIsMutable(); + externalApis_.add(builderForValue.build()); + onChanged(); + } else { + externalApisBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The External API resources present in the API hub.
+     * Only following fields will be populated in the response: name,
+     * display_name, documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ExternalApi external_apis = 1; + */ + public Builder addExternalApis( + int index, com.google.cloud.apihub.v1.ExternalApi.Builder builderForValue) { + if (externalApisBuilder_ == null) { + ensureExternalApisIsMutable(); + externalApis_.add(index, builderForValue.build()); + onChanged(); + } else { + externalApisBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The External API resources present in the API hub.
+     * Only following fields will be populated in the response: name,
+     * display_name, documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ExternalApi external_apis = 1; + */ + public Builder addAllExternalApis( + java.lang.Iterable values) { + if (externalApisBuilder_ == null) { + ensureExternalApisIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, externalApis_); + onChanged(); + } else { + externalApisBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The External API resources present in the API hub.
+     * Only following fields will be populated in the response: name,
+     * display_name, documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ExternalApi external_apis = 1; + */ + public Builder clearExternalApis() { + if (externalApisBuilder_ == null) { + externalApis_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + externalApisBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The External API resources present in the API hub.
+     * Only following fields will be populated in the response: name,
+     * display_name, documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ExternalApi external_apis = 1; + */ + public Builder removeExternalApis(int index) { + if (externalApisBuilder_ == null) { + ensureExternalApisIsMutable(); + externalApis_.remove(index); + onChanged(); + } else { + externalApisBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The External API resources present in the API hub.
+     * Only following fields will be populated in the response: name,
+     * display_name, documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ExternalApi external_apis = 1; + */ + public com.google.cloud.apihub.v1.ExternalApi.Builder getExternalApisBuilder(int index) { + return getExternalApisFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The External API resources present in the API hub.
+     * Only following fields will be populated in the response: name,
+     * display_name, documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ExternalApi external_apis = 1; + */ + public com.google.cloud.apihub.v1.ExternalApiOrBuilder getExternalApisOrBuilder(int index) { + if (externalApisBuilder_ == null) { + return externalApis_.get(index); + } else { + return externalApisBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The External API resources present in the API hub.
+     * Only following fields will be populated in the response: name,
+     * display_name, documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ExternalApi external_apis = 1; + */ + public java.util.List + getExternalApisOrBuilderList() { + if (externalApisBuilder_ != null) { + return externalApisBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(externalApis_); + } + } + /** + * + * + *
+     * The External API resources present in the API hub.
+     * Only following fields will be populated in the response: name,
+     * display_name, documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ExternalApi external_apis = 1; + */ + public com.google.cloud.apihub.v1.ExternalApi.Builder addExternalApisBuilder() { + return getExternalApisFieldBuilder() + .addBuilder(com.google.cloud.apihub.v1.ExternalApi.getDefaultInstance()); + } + /** + * + * + *
+     * The External API resources present in the API hub.
+     * Only following fields will be populated in the response: name,
+     * display_name, documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ExternalApi external_apis = 1; + */ + public com.google.cloud.apihub.v1.ExternalApi.Builder addExternalApisBuilder(int index) { + return getExternalApisFieldBuilder() + .addBuilder(index, com.google.cloud.apihub.v1.ExternalApi.getDefaultInstance()); + } + /** + * + * + *
+     * The External API resources present in the API hub.
+     * Only following fields will be populated in the response: name,
+     * display_name, documentation.external_uri.
+     * 
+ * + * repeated .google.cloud.apihub.v1.ExternalApi external_apis = 1; + */ + public java.util.List + getExternalApisBuilderList() { + return getExternalApisFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.ExternalApi, + com.google.cloud.apihub.v1.ExternalApi.Builder, + com.google.cloud.apihub.v1.ExternalApiOrBuilder> + getExternalApisFieldBuilder() { + if (externalApisBuilder_ == null) { + externalApisBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.ExternalApi, + com.google.cloud.apihub.v1.ExternalApi.Builder, + com.google.cloud.apihub.v1.ExternalApiOrBuilder>( + externalApis_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + externalApis_ = null; + } + return externalApisBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + 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.apihub.v1.ListExternalApisResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.ListExternalApisResponse) + private static final com.google.cloud.apihub.v1.ListExternalApisResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.ListExternalApisResponse(); + } + + public static com.google.cloud.apihub.v1.ListExternalApisResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListExternalApisResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.ListExternalApisResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListExternalApisResponseOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListExternalApisResponseOrBuilder.java new file mode 100644 index 000000000000..58f0ee3a6bdc --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListExternalApisResponseOrBuilder.java @@ -0,0 +1,115 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface ListExternalApisResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.ListExternalApisResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The External API resources present in the API hub.
+   * Only following fields will be populated in the response: name,
+   * display_name, documentation.external_uri.
+   * 
+ * + * repeated .google.cloud.apihub.v1.ExternalApi external_apis = 1; + */ + java.util.List getExternalApisList(); + /** + * + * + *
+   * The External API resources present in the API hub.
+   * Only following fields will be populated in the response: name,
+   * display_name, documentation.external_uri.
+   * 
+ * + * repeated .google.cloud.apihub.v1.ExternalApi external_apis = 1; + */ + com.google.cloud.apihub.v1.ExternalApi getExternalApis(int index); + /** + * + * + *
+   * The External API resources present in the API hub.
+   * Only following fields will be populated in the response: name,
+   * display_name, documentation.external_uri.
+   * 
+ * + * repeated .google.cloud.apihub.v1.ExternalApi external_apis = 1; + */ + int getExternalApisCount(); + /** + * + * + *
+   * The External API resources present in the API hub.
+   * Only following fields will be populated in the response: name,
+   * display_name, documentation.external_uri.
+   * 
+ * + * repeated .google.cloud.apihub.v1.ExternalApi external_apis = 1; + */ + java.util.List + getExternalApisOrBuilderList(); + /** + * + * + *
+   * The External API resources present in the API hub.
+   * Only following fields will be populated in the response: name,
+   * display_name, documentation.external_uri.
+   * 
+ * + * repeated .google.cloud.apihub.v1.ExternalApi external_apis = 1; + */ + com.google.cloud.apihub.v1.ExternalApiOrBuilder getExternalApisOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListHostProjectRegistrationsRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListHostProjectRegistrationsRequest.java new file mode 100644 index 000000000000..fe45cf14c20b --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListHostProjectRegistrationsRequest.java @@ -0,0 +1,1457 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/host_project_registration_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The
+ * [ListHostProjectRegistrations][google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations]
+ * method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListHostProjectRegistrationsRequest} + */ +public final class ListHostProjectRegistrationsRequest + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.ListHostProjectRegistrationsRequest) + ListHostProjectRegistrationsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListHostProjectRegistrationsRequest.newBuilder() to construct. + private ListHostProjectRegistrationsRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListHostProjectRegistrationsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListHostProjectRegistrationsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.HostProjectRegistrationServiceProto + .internal_static_google_cloud_apihub_v1_ListHostProjectRegistrationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.HostProjectRegistrationServiceProto + .internal_static_google_cloud_apihub_v1_ListHostProjectRegistrationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest.class, + com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent, which owns this collection of host projects.
+   * Format: `projects/*/locations/*`
+   * 
+ * + * + * 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 parent, which owns this collection of host projects.
+   * Format: `projects/*/locations/*`
+   * 
+ * + * + * 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_ = 0; + /** + * + * + *
+   * Optional. The maximum number of host project registrations to return. The
+   * service may return fewer than this value. If unspecified, at most 50 host
+   * project registrations will be returned. The maximum value is 1000; values
+   * above 1000 will be coerced to 1000.
+   * 
+ * + * 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; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Optional. A page token, received from a previous
+   * `ListHostProjectRegistrations` call. Provide this to retrieve the
+   * subsequent page.
+   *
+   * When paginating, all other parameters (except page_size) provided to
+   * `ListHostProjectRegistrations` must match the call that provided the page
+   * token.
+   * 
+ * + * 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 page token, received from a previous
+   * `ListHostProjectRegistrations` call. Provide this to retrieve the
+   * subsequent page.
+   *
+   * When paginating, all other parameters (except page_size) provided to
+   * `ListHostProjectRegistrations` must match the call that provided the page
+   * token.
+   * 
+ * + * 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 FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. An expression that filters the list of HostProjectRegistrations.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string. All
+   * standard operators as documented at https://google.aip.dev/160 are
+   * supported.
+   *
+   * The following fields in the `HostProjectRegistration` are eligible for
+   * filtering:
+   *
+   *   * `name` - The name of the HostProjectRegistration.
+   *   * `create_time` - The time at which the HostProjectRegistration was
+   *   created. The value should be in the
+   *   (RFC3339)[https://tools.ietf.org/html/rfc3339] format.
+   *   * `gcp_project` - The Google cloud project associated with the
+   *   HostProjectRegistration.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + 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(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An expression that filters the list of HostProjectRegistrations.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string. All
+   * standard operators as documented at https://google.aip.dev/160 are
+   * supported.
+   *
+   * The following fields in the `HostProjectRegistration` are eligible for
+   * filtering:
+   *
+   *   * `name` - The name of the HostProjectRegistration.
+   *   * `create_time` - The time at which the HostProjectRegistration was
+   *   created. The value should be in the
+   *   (RFC3339)[https://tools.ietf.org/html/rfc3339] format.
+   *   * `gcp_project` - The Google cloud project associated with the
+   *   HostProjectRegistration.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + /** + * + * + *
+   * Optional. Hint for how to order the results.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + 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(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Hint for how to order the results.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + size += getUnknownFields().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.apihub.v1.ListHostProjectRegistrationsRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest other = + (com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest 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.apihub.v1.ListHostProjectRegistrationsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest 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.apihub.v1.ListHostProjectRegistrationsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest 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.apihub.v1.ListHostProjectRegistrationsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest 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.apihub.v1.ListHostProjectRegistrationsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest 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.apihub.v1.ListHostProjectRegistrationsRequest 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
+   * [ListHostProjectRegistrations][google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations]
+   * method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListHostProjectRegistrationsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.ListHostProjectRegistrationsRequest) + com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.HostProjectRegistrationServiceProto + .internal_static_google_cloud_apihub_v1_ListHostProjectRegistrationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.HostProjectRegistrationServiceProto + .internal_static_google_cloud_apihub_v1_ListHostProjectRegistrationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest.class, + com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.HostProjectRegistrationServiceProto + .internal_static_google_cloud_apihub_v1_ListHostProjectRegistrationsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest build() { + com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest buildPartial() { + com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest result = + new com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @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.apihub.v1.ListHostProjectRegistrationsRequest) { + return mergeFrom((com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest other) { + if (other + == com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent, which owns this collection of host projects.
+     * Format: `projects/*/locations/*`
+     * 
+ * + * + * 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 parent, which owns this collection of host projects.
+     * Format: `projects/*/locations/*`
+     * 
+ * + * + * 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 parent, which owns this collection of host projects.
+     * Format: `projects/*/locations/*`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent, which owns this collection of host projects.
+     * Format: `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent, which owns this collection of host projects.
+     * Format: `projects/*/locations/*`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of host project registrations to return. The
+     * service may return fewer than this value. If unspecified, at most 50 host
+     * project registrations will be returned. The maximum value is 1000; values
+     * above 1000 will be coerced to 1000.
+     * 
+ * + * 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 host project registrations to return. The
+     * service may return fewer than this value. If unspecified, at most 50 host
+     * project registrations will be returned. The maximum value is 1000; values
+     * above 1000 will be coerced to 1000.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of host project registrations to return. The
+     * service may return fewer than this value. If unspecified, at most 50 host
+     * project registrations will be returned. The maximum value is 1000; values
+     * above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A page token, received from a previous
+     * `ListHostProjectRegistrations` call. Provide this to retrieve the
+     * subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListHostProjectRegistrations` must match the call that provided the page
+     * token.
+     * 
+ * + * 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 page token, received from a previous
+     * `ListHostProjectRegistrations` call. Provide this to retrieve the
+     * subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListHostProjectRegistrations` must match the call that provided the page
+     * token.
+     * 
+ * + * 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 page token, received from a previous
+     * `ListHostProjectRegistrations` call. Provide this to retrieve the
+     * subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListHostProjectRegistrations` must match the call that provided the page
+     * token.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous
+     * `ListHostProjectRegistrations` call. Provide this to retrieve the
+     * subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListHostProjectRegistrations` must match the call that provided the page
+     * token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous
+     * `ListHostProjectRegistrations` call. Provide this to retrieve the
+     * subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListHostProjectRegistrations` must match the call that provided the page
+     * token.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. An expression that filters the list of HostProjectRegistrations.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string. All
+     * standard operators as documented at https://google.aip.dev/160 are
+     * supported.
+     *
+     * The following fields in the `HostProjectRegistration` are eligible for
+     * filtering:
+     *
+     *   * `name` - The name of the HostProjectRegistration.
+     *   * `create_time` - The time at which the HostProjectRegistration was
+     *   created. The value should be in the
+     *   (RFC3339)[https://tools.ietf.org/html/rfc3339] format.
+     *   * `gcp_project` - The Google cloud project associated with the
+     *   HostProjectRegistration.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An expression that filters the list of HostProjectRegistrations.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string. All
+     * standard operators as documented at https://google.aip.dev/160 are
+     * supported.
+     *
+     * The following fields in the `HostProjectRegistration` are eligible for
+     * filtering:
+     *
+     *   * `name` - The name of the HostProjectRegistration.
+     *   * `create_time` - The time at which the HostProjectRegistration was
+     *   created. The value should be in the
+     *   (RFC3339)[https://tools.ietf.org/html/rfc3339] format.
+     *   * `gcp_project` - The Google cloud project associated with the
+     *   HostProjectRegistration.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An expression that filters the list of HostProjectRegistrations.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string. All
+     * standard operators as documented at https://google.aip.dev/160 are
+     * supported.
+     *
+     * The following fields in the `HostProjectRegistration` are eligible for
+     * filtering:
+     *
+     *   * `name` - The name of the HostProjectRegistration.
+     *   * `create_time` - The time at which the HostProjectRegistration was
+     *   created. The value should be in the
+     *   (RFC3339)[https://tools.ietf.org/html/rfc3339] format.
+     *   * `gcp_project` - The Google cloud project associated with the
+     *   HostProjectRegistration.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An expression that filters the list of HostProjectRegistrations.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string. All
+     * standard operators as documented at https://google.aip.dev/160 are
+     * supported.
+     *
+     * The following fields in the `HostProjectRegistration` are eligible for
+     * filtering:
+     *
+     *   * `name` - The name of the HostProjectRegistration.
+     *   * `create_time` - The time at which the HostProjectRegistration was
+     *   created. The value should be in the
+     *   (RFC3339)[https://tools.ietf.org/html/rfc3339] format.
+     *   * `gcp_project` - The Google cloud project associated with the
+     *   HostProjectRegistration.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An expression that filters the list of HostProjectRegistrations.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string. All
+     * standard operators as documented at https://google.aip.dev/160 are
+     * supported.
+     *
+     * The following fields in the `HostProjectRegistration` are eligible for
+     * filtering:
+     *
+     *   * `name` - The name of the HostProjectRegistration.
+     *   * `create_time` - The time at which the HostProjectRegistration was
+     *   created. The value should be in the
+     *   (RFC3339)[https://tools.ietf.org/html/rfc3339] format.
+     *   * `gcp_project` - The Google cloud project associated with the
+     *   HostProjectRegistration.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Optional. Hint for how to order the results.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Hint for how to order the results.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Hint for how to order the results.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Hint for how to order the results.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Hint for how to order the results.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + orderBy_ = value; + bitField0_ |= 0x00000010; + 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.apihub.v1.ListHostProjectRegistrationsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.ListHostProjectRegistrationsRequest) + private static final com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest(); + } + + public static com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListHostProjectRegistrationsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.ListHostProjectRegistrationsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListHostProjectRegistrationsRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListHostProjectRegistrationsRequestOrBuilder.java new file mode 100644 index 000000000000..ef6a71e2c8dc --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListHostProjectRegistrationsRequestOrBuilder.java @@ -0,0 +1,190 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/host_project_registration_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface ListHostProjectRegistrationsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.ListHostProjectRegistrationsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent, which owns this collection of host projects.
+   * Format: `projects/*/locations/*`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent, which owns this collection of host projects.
+   * Format: `projects/*/locations/*`
+   * 
+ * + * + * 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 host project registrations to return. The
+   * service may return fewer than this value. If unspecified, at most 50 host
+   * project registrations will be returned. The maximum value is 1000; values
+   * above 1000 will be coerced to 1000.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A page token, received from a previous
+   * `ListHostProjectRegistrations` call. Provide this to retrieve the
+   * subsequent page.
+   *
+   * When paginating, all other parameters (except page_size) provided to
+   * `ListHostProjectRegistrations` must match the call that provided the page
+   * token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A page token, received from a previous
+   * `ListHostProjectRegistrations` call. Provide this to retrieve the
+   * subsequent page.
+   *
+   * When paginating, all other parameters (except page_size) provided to
+   * `ListHostProjectRegistrations` must match the call that provided the page
+   * token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. An expression that filters the list of HostProjectRegistrations.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string. All
+   * standard operators as documented at https://google.aip.dev/160 are
+   * supported.
+   *
+   * The following fields in the `HostProjectRegistration` are eligible for
+   * filtering:
+   *
+   *   * `name` - The name of the HostProjectRegistration.
+   *   * `create_time` - The time at which the HostProjectRegistration was
+   *   created. The value should be in the
+   *   (RFC3339)[https://tools.ietf.org/html/rfc3339] format.
+   *   * `gcp_project` - The Google cloud project associated with the
+   *   HostProjectRegistration.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. An expression that filters the list of HostProjectRegistrations.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string. All
+   * standard operators as documented at https://google.aip.dev/160 are
+   * supported.
+   *
+   * The following fields in the `HostProjectRegistration` are eligible for
+   * filtering:
+   *
+   *   * `name` - The name of the HostProjectRegistration.
+   *   * `create_time` - The time at which the HostProjectRegistration was
+   *   created. The value should be in the
+   *   (RFC3339)[https://tools.ietf.org/html/rfc3339] format.
+   *   * `gcp_project` - The Google cloud project associated with the
+   *   HostProjectRegistration.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Hint for how to order the results.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Hint for how to order the results.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListHostProjectRegistrationsResponse.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListHostProjectRegistrationsResponse.java new file mode 100644 index 000000000000..1058ccad9158 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListHostProjectRegistrationsResponse.java @@ -0,0 +1,1204 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/host_project_registration_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The
+ * [ListHostProjectRegistrations][google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations]
+ * method's response.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListHostProjectRegistrationsResponse} + */ +public final class ListHostProjectRegistrationsResponse + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.ListHostProjectRegistrationsResponse) + ListHostProjectRegistrationsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListHostProjectRegistrationsResponse.newBuilder() to construct. + private ListHostProjectRegistrationsResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListHostProjectRegistrationsResponse() { + hostProjectRegistrations_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListHostProjectRegistrationsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.HostProjectRegistrationServiceProto + .internal_static_google_cloud_apihub_v1_ListHostProjectRegistrationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.HostProjectRegistrationServiceProto + .internal_static_google_cloud_apihub_v1_ListHostProjectRegistrationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse.class, + com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse.Builder.class); + } + + public static final int HOST_PROJECT_REGISTRATIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + hostProjectRegistrations_; + /** + * + * + *
+   * The list of host project registrations.
+   * 
+ * + * repeated .google.cloud.apihub.v1.HostProjectRegistration host_project_registrations = 1; + * + */ + @java.lang.Override + public java.util.List + getHostProjectRegistrationsList() { + return hostProjectRegistrations_; + } + /** + * + * + *
+   * The list of host project registrations.
+   * 
+ * + * repeated .google.cloud.apihub.v1.HostProjectRegistration host_project_registrations = 1; + * + */ + @java.lang.Override + public java.util.List + getHostProjectRegistrationsOrBuilderList() { + return hostProjectRegistrations_; + } + /** + * + * + *
+   * The list of host project registrations.
+   * 
+ * + * repeated .google.cloud.apihub.v1.HostProjectRegistration host_project_registrations = 1; + * + */ + @java.lang.Override + public int getHostProjectRegistrationsCount() { + return hostProjectRegistrations_.size(); + } + /** + * + * + *
+   * The list of host project registrations.
+   * 
+ * + * repeated .google.cloud.apihub.v1.HostProjectRegistration host_project_registrations = 1; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.HostProjectRegistration getHostProjectRegistrations(int index) { + return hostProjectRegistrations_.get(index); + } + /** + * + * + *
+   * The list of host project registrations.
+   * 
+ * + * repeated .google.cloud.apihub.v1.HostProjectRegistration host_project_registrations = 1; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.HostProjectRegistrationOrBuilder + getHostProjectRegistrationsOrBuilder(int index) { + return hostProjectRegistrations_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * 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 < hostProjectRegistrations_.size(); i++) { + output.writeMessage(1, hostProjectRegistrations_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < hostProjectRegistrations_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, hostProjectRegistrations_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().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.apihub.v1.ListHostProjectRegistrationsResponse)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse other = + (com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse) obj; + + if (!getHostProjectRegistrationsList().equals(other.getHostProjectRegistrationsList())) + return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getHostProjectRegistrationsCount() > 0) { + hash = (37 * hash) + HOST_PROJECT_REGISTRATIONS_FIELD_NUMBER; + hash = (53 * hash) + getHostProjectRegistrationsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse 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.apihub.v1.ListHostProjectRegistrationsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse 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.apihub.v1.ListHostProjectRegistrationsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse 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.apihub.v1.ListHostProjectRegistrationsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse 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.apihub.v1.ListHostProjectRegistrationsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse 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.apihub.v1.ListHostProjectRegistrationsResponse 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
+   * [ListHostProjectRegistrations][google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations]
+   * method's response.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListHostProjectRegistrationsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.ListHostProjectRegistrationsResponse) + com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.HostProjectRegistrationServiceProto + .internal_static_google_cloud_apihub_v1_ListHostProjectRegistrationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.HostProjectRegistrationServiceProto + .internal_static_google_cloud_apihub_v1_ListHostProjectRegistrationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse.class, + com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (hostProjectRegistrationsBuilder_ == null) { + hostProjectRegistrations_ = java.util.Collections.emptyList(); + } else { + hostProjectRegistrations_ = null; + hostProjectRegistrationsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.HostProjectRegistrationServiceProto + .internal_static_google_cloud_apihub_v1_ListHostProjectRegistrationsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse build() { + com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse buildPartial() { + com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse result = + new com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse result) { + if (hostProjectRegistrationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + hostProjectRegistrations_ = + java.util.Collections.unmodifiableList(hostProjectRegistrations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.hostProjectRegistrations_ = hostProjectRegistrations_; + } else { + result.hostProjectRegistrations_ = hostProjectRegistrationsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.apihub.v1.ListHostProjectRegistrationsResponse) { + return mergeFrom((com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse other) { + if (other + == com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse.getDefaultInstance()) + return this; + if (hostProjectRegistrationsBuilder_ == null) { + if (!other.hostProjectRegistrations_.isEmpty()) { + if (hostProjectRegistrations_.isEmpty()) { + hostProjectRegistrations_ = other.hostProjectRegistrations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureHostProjectRegistrationsIsMutable(); + hostProjectRegistrations_.addAll(other.hostProjectRegistrations_); + } + onChanged(); + } + } else { + if (!other.hostProjectRegistrations_.isEmpty()) { + if (hostProjectRegistrationsBuilder_.isEmpty()) { + hostProjectRegistrationsBuilder_.dispose(); + hostProjectRegistrationsBuilder_ = null; + hostProjectRegistrations_ = other.hostProjectRegistrations_; + bitField0_ = (bitField0_ & ~0x00000001); + hostProjectRegistrationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getHostProjectRegistrationsFieldBuilder() + : null; + } else { + hostProjectRegistrationsBuilder_.addAllMessages(other.hostProjectRegistrations_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.apihub.v1.HostProjectRegistration m = + input.readMessage( + com.google.cloud.apihub.v1.HostProjectRegistration.parser(), + extensionRegistry); + if (hostProjectRegistrationsBuilder_ == null) { + ensureHostProjectRegistrationsIsMutable(); + hostProjectRegistrations_.add(m); + } else { + hostProjectRegistrationsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List + hostProjectRegistrations_ = java.util.Collections.emptyList(); + + private void ensureHostProjectRegistrationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + hostProjectRegistrations_ = + new java.util.ArrayList( + hostProjectRegistrations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.HostProjectRegistration, + com.google.cloud.apihub.v1.HostProjectRegistration.Builder, + com.google.cloud.apihub.v1.HostProjectRegistrationOrBuilder> + hostProjectRegistrationsBuilder_; + + /** + * + * + *
+     * The list of host project registrations.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.HostProjectRegistration host_project_registrations = 1; + * + */ + public java.util.List + getHostProjectRegistrationsList() { + if (hostProjectRegistrationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(hostProjectRegistrations_); + } else { + return hostProjectRegistrationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of host project registrations.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.HostProjectRegistration host_project_registrations = 1; + * + */ + public int getHostProjectRegistrationsCount() { + if (hostProjectRegistrationsBuilder_ == null) { + return hostProjectRegistrations_.size(); + } else { + return hostProjectRegistrationsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of host project registrations.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.HostProjectRegistration host_project_registrations = 1; + * + */ + public com.google.cloud.apihub.v1.HostProjectRegistration getHostProjectRegistrations( + int index) { + if (hostProjectRegistrationsBuilder_ == null) { + return hostProjectRegistrations_.get(index); + } else { + return hostProjectRegistrationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of host project registrations.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.HostProjectRegistration host_project_registrations = 1; + * + */ + public Builder setHostProjectRegistrations( + int index, com.google.cloud.apihub.v1.HostProjectRegistration value) { + if (hostProjectRegistrationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHostProjectRegistrationsIsMutable(); + hostProjectRegistrations_.set(index, value); + onChanged(); + } else { + hostProjectRegistrationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of host project registrations.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.HostProjectRegistration host_project_registrations = 1; + * + */ + public Builder setHostProjectRegistrations( + int index, com.google.cloud.apihub.v1.HostProjectRegistration.Builder builderForValue) { + if (hostProjectRegistrationsBuilder_ == null) { + ensureHostProjectRegistrationsIsMutable(); + hostProjectRegistrations_.set(index, builderForValue.build()); + onChanged(); + } else { + hostProjectRegistrationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of host project registrations.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.HostProjectRegistration host_project_registrations = 1; + * + */ + public Builder addHostProjectRegistrations( + com.google.cloud.apihub.v1.HostProjectRegistration value) { + if (hostProjectRegistrationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHostProjectRegistrationsIsMutable(); + hostProjectRegistrations_.add(value); + onChanged(); + } else { + hostProjectRegistrationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of host project registrations.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.HostProjectRegistration host_project_registrations = 1; + * + */ + public Builder addHostProjectRegistrations( + int index, com.google.cloud.apihub.v1.HostProjectRegistration value) { + if (hostProjectRegistrationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHostProjectRegistrationsIsMutable(); + hostProjectRegistrations_.add(index, value); + onChanged(); + } else { + hostProjectRegistrationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of host project registrations.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.HostProjectRegistration host_project_registrations = 1; + * + */ + public Builder addHostProjectRegistrations( + com.google.cloud.apihub.v1.HostProjectRegistration.Builder builderForValue) { + if (hostProjectRegistrationsBuilder_ == null) { + ensureHostProjectRegistrationsIsMutable(); + hostProjectRegistrations_.add(builderForValue.build()); + onChanged(); + } else { + hostProjectRegistrationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of host project registrations.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.HostProjectRegistration host_project_registrations = 1; + * + */ + public Builder addHostProjectRegistrations( + int index, com.google.cloud.apihub.v1.HostProjectRegistration.Builder builderForValue) { + if (hostProjectRegistrationsBuilder_ == null) { + ensureHostProjectRegistrationsIsMutable(); + hostProjectRegistrations_.add(index, builderForValue.build()); + onChanged(); + } else { + hostProjectRegistrationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of host project registrations.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.HostProjectRegistration host_project_registrations = 1; + * + */ + public Builder addAllHostProjectRegistrations( + java.lang.Iterable values) { + if (hostProjectRegistrationsBuilder_ == null) { + ensureHostProjectRegistrationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, hostProjectRegistrations_); + onChanged(); + } else { + hostProjectRegistrationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of host project registrations.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.HostProjectRegistration host_project_registrations = 1; + * + */ + public Builder clearHostProjectRegistrations() { + if (hostProjectRegistrationsBuilder_ == null) { + hostProjectRegistrations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + hostProjectRegistrationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of host project registrations.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.HostProjectRegistration host_project_registrations = 1; + * + */ + public Builder removeHostProjectRegistrations(int index) { + if (hostProjectRegistrationsBuilder_ == null) { + ensureHostProjectRegistrationsIsMutable(); + hostProjectRegistrations_.remove(index); + onChanged(); + } else { + hostProjectRegistrationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of host project registrations.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.HostProjectRegistration host_project_registrations = 1; + * + */ + public com.google.cloud.apihub.v1.HostProjectRegistration.Builder + getHostProjectRegistrationsBuilder(int index) { + return getHostProjectRegistrationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of host project registrations.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.HostProjectRegistration host_project_registrations = 1; + * + */ + public com.google.cloud.apihub.v1.HostProjectRegistrationOrBuilder + getHostProjectRegistrationsOrBuilder(int index) { + if (hostProjectRegistrationsBuilder_ == null) { + return hostProjectRegistrations_.get(index); + } else { + return hostProjectRegistrationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of host project registrations.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.HostProjectRegistration host_project_registrations = 1; + * + */ + public java.util.List + getHostProjectRegistrationsOrBuilderList() { + if (hostProjectRegistrationsBuilder_ != null) { + return hostProjectRegistrationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(hostProjectRegistrations_); + } + } + /** + * + * + *
+     * The list of host project registrations.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.HostProjectRegistration host_project_registrations = 1; + * + */ + public com.google.cloud.apihub.v1.HostProjectRegistration.Builder + addHostProjectRegistrationsBuilder() { + return getHostProjectRegistrationsFieldBuilder() + .addBuilder(com.google.cloud.apihub.v1.HostProjectRegistration.getDefaultInstance()); + } + /** + * + * + *
+     * The list of host project registrations.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.HostProjectRegistration host_project_registrations = 1; + * + */ + public com.google.cloud.apihub.v1.HostProjectRegistration.Builder + addHostProjectRegistrationsBuilder(int index) { + return getHostProjectRegistrationsFieldBuilder() + .addBuilder( + index, com.google.cloud.apihub.v1.HostProjectRegistration.getDefaultInstance()); + } + /** + * + * + *
+     * The list of host project registrations.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.HostProjectRegistration host_project_registrations = 1; + * + */ + public java.util.List + getHostProjectRegistrationsBuilderList() { + return getHostProjectRegistrationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.HostProjectRegistration, + com.google.cloud.apihub.v1.HostProjectRegistration.Builder, + com.google.cloud.apihub.v1.HostProjectRegistrationOrBuilder> + getHostProjectRegistrationsFieldBuilder() { + if (hostProjectRegistrationsBuilder_ == null) { + hostProjectRegistrationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.HostProjectRegistration, + com.google.cloud.apihub.v1.HostProjectRegistration.Builder, + com.google.cloud.apihub.v1.HostProjectRegistrationOrBuilder>( + hostProjectRegistrations_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + hostProjectRegistrations_ = null; + } + return hostProjectRegistrationsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + 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.apihub.v1.ListHostProjectRegistrationsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.ListHostProjectRegistrationsResponse) + private static final com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse(); + } + + public static com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListHostProjectRegistrationsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.ListHostProjectRegistrationsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListHostProjectRegistrationsResponseOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListHostProjectRegistrationsResponseOrBuilder.java new file mode 100644 index 000000000000..9d8be35be82d --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListHostProjectRegistrationsResponseOrBuilder.java @@ -0,0 +1,112 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/host_project_registration_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface ListHostProjectRegistrationsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.ListHostProjectRegistrationsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of host project registrations.
+   * 
+ * + * repeated .google.cloud.apihub.v1.HostProjectRegistration host_project_registrations = 1; + * + */ + java.util.List + getHostProjectRegistrationsList(); + /** + * + * + *
+   * The list of host project registrations.
+   * 
+ * + * repeated .google.cloud.apihub.v1.HostProjectRegistration host_project_registrations = 1; + * + */ + com.google.cloud.apihub.v1.HostProjectRegistration getHostProjectRegistrations(int index); + /** + * + * + *
+   * The list of host project registrations.
+   * 
+ * + * repeated .google.cloud.apihub.v1.HostProjectRegistration host_project_registrations = 1; + * + */ + int getHostProjectRegistrationsCount(); + /** + * + * + *
+   * The list of host project registrations.
+   * 
+ * + * repeated .google.cloud.apihub.v1.HostProjectRegistration host_project_registrations = 1; + * + */ + java.util.List + getHostProjectRegistrationsOrBuilderList(); + /** + * + * + *
+   * The list of host project registrations.
+   * 
+ * + * repeated .google.cloud.apihub.v1.HostProjectRegistration host_project_registrations = 1; + * + */ + com.google.cloud.apihub.v1.HostProjectRegistrationOrBuilder getHostProjectRegistrationsOrBuilder( + int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListRuntimeProjectAttachmentsRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListRuntimeProjectAttachmentsRequest.java new file mode 100644 index 000000000000..c4b2b7630934 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListRuntimeProjectAttachmentsRequest.java @@ -0,0 +1,1458 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/runtime_project_attachment_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The
+ * [ListRuntimeProjectAttachments][google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments]
+ * method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest} + */ +public final class ListRuntimeProjectAttachmentsRequest + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest) + ListRuntimeProjectAttachmentsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListRuntimeProjectAttachmentsRequest.newBuilder() to construct. + private ListRuntimeProjectAttachmentsRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListRuntimeProjectAttachmentsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListRuntimeProjectAttachmentsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_ListRuntimeProjectAttachmentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_ListRuntimeProjectAttachmentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest.class, + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent, which owns this collection of runtime project
+   * attachments. Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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 parent, which owns this collection of runtime project
+   * attachments. Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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_ = 0; + /** + * + * + *
+   * Optional. The maximum number of runtime project attachments to return. The
+   * service may return fewer than this value. If unspecified, at most 50
+   * runtime project attachments will be returned. The maximum value is 1000;
+   * values above 1000 will be coerced to 1000.
+   * 
+ * + * 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; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Optional. A page token, received from a previous
+   * `ListRuntimeProjectAttachments` call. Provide this to retrieve the
+   * subsequent page.
+   *
+   * When paginating, all other parameters (except page_size) provided to
+   * `ListRuntimeProjectAttachments` must match the call that provided the page
+   * token.
+   * 
+ * + * 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 page token, received from a previous
+   * `ListRuntimeProjectAttachments` call. Provide this to retrieve the
+   * subsequent page.
+   *
+   * When paginating, all other parameters (except page_size) provided to
+   * `ListRuntimeProjectAttachments` must match the call that provided the page
+   * token.
+   * 
+ * + * 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 FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. An expression that filters the list of RuntimeProjectAttachments.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string. All
+   * standard operators as documented at https://google.aip.dev/160 are
+   * supported.
+   *
+   * The following fields in the `RuntimeProjectAttachment` are eligible for
+   * filtering:
+   *
+   *   * `name` - The name of the RuntimeProjectAttachment.
+   *   * `create_time` - The time at which the RuntimeProjectAttachment was
+   *   created. The value should be in the
+   *   (RFC3339)[https://tools.ietf.org/html/rfc3339] format.
+   *   * `runtime_project` - The Google cloud project associated with the
+   *   RuntimeProjectAttachment.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + 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(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An expression that filters the list of RuntimeProjectAttachments.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string. All
+   * standard operators as documented at https://google.aip.dev/160 are
+   * supported.
+   *
+   * The following fields in the `RuntimeProjectAttachment` are eligible for
+   * filtering:
+   *
+   *   * `name` - The name of the RuntimeProjectAttachment.
+   *   * `create_time` - The time at which the RuntimeProjectAttachment was
+   *   created. The value should be in the
+   *   (RFC3339)[https://tools.ietf.org/html/rfc3339] format.
+   *   * `runtime_project` - The Google cloud project associated with the
+   *   RuntimeProjectAttachment.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + /** + * + * + *
+   * Optional. Hint for how to order the results.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + 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(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Hint for how to order the results.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + size += getUnknownFields().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.apihub.v1.ListRuntimeProjectAttachmentsRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest other = + (com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest 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.apihub.v1.ListRuntimeProjectAttachmentsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest 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.apihub.v1.ListRuntimeProjectAttachmentsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest 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.apihub.v1.ListRuntimeProjectAttachmentsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest 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.apihub.v1.ListRuntimeProjectAttachmentsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest 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.apihub.v1.ListRuntimeProjectAttachmentsRequest 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
+   * [ListRuntimeProjectAttachments][google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments]
+   * method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest) + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_ListRuntimeProjectAttachmentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_ListRuntimeProjectAttachmentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest.class, + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_ListRuntimeProjectAttachmentsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest build() { + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest buildPartial() { + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest result = + new com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @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.apihub.v1.ListRuntimeProjectAttachmentsRequest) { + return mergeFrom((com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest other) { + if (other + == com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent, which owns this collection of runtime project
+     * attachments. Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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 parent, which owns this collection of runtime project
+     * attachments. Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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 parent, which owns this collection of runtime project
+     * attachments. Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent, which owns this collection of runtime project
+     * attachments. Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent, which owns this collection of runtime project
+     * attachments. Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of runtime project attachments to return. The
+     * service may return fewer than this value. If unspecified, at most 50
+     * runtime project attachments will be returned. The maximum value is 1000;
+     * values above 1000 will be coerced to 1000.
+     * 
+ * + * 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 runtime project attachments to return. The
+     * service may return fewer than this value. If unspecified, at most 50
+     * runtime project attachments will be returned. The maximum value is 1000;
+     * values above 1000 will be coerced to 1000.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of runtime project attachments to return. The
+     * service may return fewer than this value. If unspecified, at most 50
+     * runtime project attachments will be returned. The maximum value is 1000;
+     * values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A page token, received from a previous
+     * `ListRuntimeProjectAttachments` call. Provide this to retrieve the
+     * subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListRuntimeProjectAttachments` must match the call that provided the page
+     * token.
+     * 
+ * + * 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 page token, received from a previous
+     * `ListRuntimeProjectAttachments` call. Provide this to retrieve the
+     * subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListRuntimeProjectAttachments` must match the call that provided the page
+     * token.
+     * 
+ * + * 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 page token, received from a previous
+     * `ListRuntimeProjectAttachments` call. Provide this to retrieve the
+     * subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListRuntimeProjectAttachments` must match the call that provided the page
+     * token.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous
+     * `ListRuntimeProjectAttachments` call. Provide this to retrieve the
+     * subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListRuntimeProjectAttachments` must match the call that provided the page
+     * token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous
+     * `ListRuntimeProjectAttachments` call. Provide this to retrieve the
+     * subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListRuntimeProjectAttachments` must match the call that provided the page
+     * token.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. An expression that filters the list of RuntimeProjectAttachments.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string. All
+     * standard operators as documented at https://google.aip.dev/160 are
+     * supported.
+     *
+     * The following fields in the `RuntimeProjectAttachment` are eligible for
+     * filtering:
+     *
+     *   * `name` - The name of the RuntimeProjectAttachment.
+     *   * `create_time` - The time at which the RuntimeProjectAttachment was
+     *   created. The value should be in the
+     *   (RFC3339)[https://tools.ietf.org/html/rfc3339] format.
+     *   * `runtime_project` - The Google cloud project associated with the
+     *   RuntimeProjectAttachment.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An expression that filters the list of RuntimeProjectAttachments.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string. All
+     * standard operators as documented at https://google.aip.dev/160 are
+     * supported.
+     *
+     * The following fields in the `RuntimeProjectAttachment` are eligible for
+     * filtering:
+     *
+     *   * `name` - The name of the RuntimeProjectAttachment.
+     *   * `create_time` - The time at which the RuntimeProjectAttachment was
+     *   created. The value should be in the
+     *   (RFC3339)[https://tools.ietf.org/html/rfc3339] format.
+     *   * `runtime_project` - The Google cloud project associated with the
+     *   RuntimeProjectAttachment.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An expression that filters the list of RuntimeProjectAttachments.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string. All
+     * standard operators as documented at https://google.aip.dev/160 are
+     * supported.
+     *
+     * The following fields in the `RuntimeProjectAttachment` are eligible for
+     * filtering:
+     *
+     *   * `name` - The name of the RuntimeProjectAttachment.
+     *   * `create_time` - The time at which the RuntimeProjectAttachment was
+     *   created. The value should be in the
+     *   (RFC3339)[https://tools.ietf.org/html/rfc3339] format.
+     *   * `runtime_project` - The Google cloud project associated with the
+     *   RuntimeProjectAttachment.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An expression that filters the list of RuntimeProjectAttachments.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string. All
+     * standard operators as documented at https://google.aip.dev/160 are
+     * supported.
+     *
+     * The following fields in the `RuntimeProjectAttachment` are eligible for
+     * filtering:
+     *
+     *   * `name` - The name of the RuntimeProjectAttachment.
+     *   * `create_time` - The time at which the RuntimeProjectAttachment was
+     *   created. The value should be in the
+     *   (RFC3339)[https://tools.ietf.org/html/rfc3339] format.
+     *   * `runtime_project` - The Google cloud project associated with the
+     *   RuntimeProjectAttachment.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An expression that filters the list of RuntimeProjectAttachments.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string. All
+     * standard operators as documented at https://google.aip.dev/160 are
+     * supported.
+     *
+     * The following fields in the `RuntimeProjectAttachment` are eligible for
+     * filtering:
+     *
+     *   * `name` - The name of the RuntimeProjectAttachment.
+     *   * `create_time` - The time at which the RuntimeProjectAttachment was
+     *   created. The value should be in the
+     *   (RFC3339)[https://tools.ietf.org/html/rfc3339] format.
+     *   * `runtime_project` - The Google cloud project associated with the
+     *   RuntimeProjectAttachment.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Optional. Hint for how to order the results.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Hint for how to order the results.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Hint for how to order the results.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Hint for how to order the results.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Hint for how to order the results.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + orderBy_ = value; + bitField0_ |= 0x00000010; + 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.apihub.v1.ListRuntimeProjectAttachmentsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest) + private static final com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest(); + } + + public static com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListRuntimeProjectAttachmentsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.ListRuntimeProjectAttachmentsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListRuntimeProjectAttachmentsRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListRuntimeProjectAttachmentsRequestOrBuilder.java new file mode 100644 index 000000000000..bbf3d74f098f --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListRuntimeProjectAttachmentsRequestOrBuilder.java @@ -0,0 +1,190 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/runtime_project_attachment_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface ListRuntimeProjectAttachmentsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent, which owns this collection of runtime project
+   * attachments. Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent, which owns this collection of runtime project
+   * attachments. Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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 runtime project attachments to return. The
+   * service may return fewer than this value. If unspecified, at most 50
+   * runtime project attachments will be returned. The maximum value is 1000;
+   * values above 1000 will be coerced to 1000.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A page token, received from a previous
+   * `ListRuntimeProjectAttachments` call. Provide this to retrieve the
+   * subsequent page.
+   *
+   * When paginating, all other parameters (except page_size) provided to
+   * `ListRuntimeProjectAttachments` must match the call that provided the page
+   * token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A page token, received from a previous
+   * `ListRuntimeProjectAttachments` call. Provide this to retrieve the
+   * subsequent page.
+   *
+   * When paginating, all other parameters (except page_size) provided to
+   * `ListRuntimeProjectAttachments` must match the call that provided the page
+   * token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. An expression that filters the list of RuntimeProjectAttachments.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string. All
+   * standard operators as documented at https://google.aip.dev/160 are
+   * supported.
+   *
+   * The following fields in the `RuntimeProjectAttachment` are eligible for
+   * filtering:
+   *
+   *   * `name` - The name of the RuntimeProjectAttachment.
+   *   * `create_time` - The time at which the RuntimeProjectAttachment was
+   *   created. The value should be in the
+   *   (RFC3339)[https://tools.ietf.org/html/rfc3339] format.
+   *   * `runtime_project` - The Google cloud project associated with the
+   *   RuntimeProjectAttachment.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. An expression that filters the list of RuntimeProjectAttachments.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string. All
+   * standard operators as documented at https://google.aip.dev/160 are
+   * supported.
+   *
+   * The following fields in the `RuntimeProjectAttachment` are eligible for
+   * filtering:
+   *
+   *   * `name` - The name of the RuntimeProjectAttachment.
+   *   * `create_time` - The time at which the RuntimeProjectAttachment was
+   *   created. The value should be in the
+   *   (RFC3339)[https://tools.ietf.org/html/rfc3339] format.
+   *   * `runtime_project` - The Google cloud project associated with the
+   *   RuntimeProjectAttachment.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Hint for how to order the results.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Hint for how to order the results.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListRuntimeProjectAttachmentsResponse.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListRuntimeProjectAttachmentsResponse.java new file mode 100644 index 000000000000..03e80a3dc849 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListRuntimeProjectAttachmentsResponse.java @@ -0,0 +1,1210 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/runtime_project_attachment_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The
+ * [ListRuntimeProjectAttachments][google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments]
+ * method's response.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse} + */ +public final class ListRuntimeProjectAttachmentsResponse + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse) + ListRuntimeProjectAttachmentsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListRuntimeProjectAttachmentsResponse.newBuilder() to construct. + private ListRuntimeProjectAttachmentsResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListRuntimeProjectAttachmentsResponse() { + runtimeProjectAttachments_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListRuntimeProjectAttachmentsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_ListRuntimeProjectAttachmentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_ListRuntimeProjectAttachmentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse.class, + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse.Builder.class); + } + + public static final int RUNTIME_PROJECT_ATTACHMENTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + runtimeProjectAttachments_; + /** + * + * + *
+   * List of runtime project attachments.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachments = 1; + * + */ + @java.lang.Override + public java.util.List + getRuntimeProjectAttachmentsList() { + return runtimeProjectAttachments_; + } + /** + * + * + *
+   * List of runtime project attachments.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachments = 1; + * + */ + @java.lang.Override + public java.util.List + getRuntimeProjectAttachmentsOrBuilderList() { + return runtimeProjectAttachments_; + } + /** + * + * + *
+   * List of runtime project attachments.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachments = 1; + * + */ + @java.lang.Override + public int getRuntimeProjectAttachmentsCount() { + return runtimeProjectAttachments_.size(); + } + /** + * + * + *
+   * List of runtime project attachments.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachments = 1; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.RuntimeProjectAttachment getRuntimeProjectAttachments( + int index) { + return runtimeProjectAttachments_.get(index); + } + /** + * + * + *
+   * List of runtime project attachments.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachments = 1; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.RuntimeProjectAttachmentOrBuilder + getRuntimeProjectAttachmentsOrBuilder(int index) { + return runtimeProjectAttachments_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * 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 < runtimeProjectAttachments_.size(); i++) { + output.writeMessage(1, runtimeProjectAttachments_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < runtimeProjectAttachments_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, runtimeProjectAttachments_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().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.apihub.v1.ListRuntimeProjectAttachmentsResponse)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse other = + (com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse) obj; + + if (!getRuntimeProjectAttachmentsList().equals(other.getRuntimeProjectAttachmentsList())) + return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getRuntimeProjectAttachmentsCount() > 0) { + hash = (37 * hash) + RUNTIME_PROJECT_ATTACHMENTS_FIELD_NUMBER; + hash = (53 * hash) + getRuntimeProjectAttachmentsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse 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.apihub.v1.ListRuntimeProjectAttachmentsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse 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.apihub.v1.ListRuntimeProjectAttachmentsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse 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.apihub.v1.ListRuntimeProjectAttachmentsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse 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.apihub.v1.ListRuntimeProjectAttachmentsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse 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.apihub.v1.ListRuntimeProjectAttachmentsResponse 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
+   * [ListRuntimeProjectAttachments][google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments]
+   * method's response.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse) + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_ListRuntimeProjectAttachmentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_ListRuntimeProjectAttachmentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse.class, + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (runtimeProjectAttachmentsBuilder_ == null) { + runtimeProjectAttachments_ = java.util.Collections.emptyList(); + } else { + runtimeProjectAttachments_ = null; + runtimeProjectAttachmentsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_ListRuntimeProjectAttachmentsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse build() { + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse buildPartial() { + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse result = + new com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse result) { + if (runtimeProjectAttachmentsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + runtimeProjectAttachments_ = + java.util.Collections.unmodifiableList(runtimeProjectAttachments_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.runtimeProjectAttachments_ = runtimeProjectAttachments_; + } else { + result.runtimeProjectAttachments_ = runtimeProjectAttachmentsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.apihub.v1.ListRuntimeProjectAttachmentsResponse) { + return mergeFrom((com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse other) { + if (other + == com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse.getDefaultInstance()) + return this; + if (runtimeProjectAttachmentsBuilder_ == null) { + if (!other.runtimeProjectAttachments_.isEmpty()) { + if (runtimeProjectAttachments_.isEmpty()) { + runtimeProjectAttachments_ = other.runtimeProjectAttachments_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRuntimeProjectAttachmentsIsMutable(); + runtimeProjectAttachments_.addAll(other.runtimeProjectAttachments_); + } + onChanged(); + } + } else { + if (!other.runtimeProjectAttachments_.isEmpty()) { + if (runtimeProjectAttachmentsBuilder_.isEmpty()) { + runtimeProjectAttachmentsBuilder_.dispose(); + runtimeProjectAttachmentsBuilder_ = null; + runtimeProjectAttachments_ = other.runtimeProjectAttachments_; + bitField0_ = (bitField0_ & ~0x00000001); + runtimeProjectAttachmentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRuntimeProjectAttachmentsFieldBuilder() + : null; + } else { + runtimeProjectAttachmentsBuilder_.addAllMessages(other.runtimeProjectAttachments_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.apihub.v1.RuntimeProjectAttachment m = + input.readMessage( + com.google.cloud.apihub.v1.RuntimeProjectAttachment.parser(), + extensionRegistry); + if (runtimeProjectAttachmentsBuilder_ == null) { + ensureRuntimeProjectAttachmentsIsMutable(); + runtimeProjectAttachments_.add(m); + } else { + runtimeProjectAttachmentsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List + runtimeProjectAttachments_ = java.util.Collections.emptyList(); + + private void ensureRuntimeProjectAttachmentsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + runtimeProjectAttachments_ = + new java.util.ArrayList( + runtimeProjectAttachments_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.RuntimeProjectAttachment, + com.google.cloud.apihub.v1.RuntimeProjectAttachment.Builder, + com.google.cloud.apihub.v1.RuntimeProjectAttachmentOrBuilder> + runtimeProjectAttachmentsBuilder_; + + /** + * + * + *
+     * List of runtime project attachments.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachments = 1; + * + */ + public java.util.List + getRuntimeProjectAttachmentsList() { + if (runtimeProjectAttachmentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(runtimeProjectAttachments_); + } else { + return runtimeProjectAttachmentsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of runtime project attachments.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachments = 1; + * + */ + public int getRuntimeProjectAttachmentsCount() { + if (runtimeProjectAttachmentsBuilder_ == null) { + return runtimeProjectAttachments_.size(); + } else { + return runtimeProjectAttachmentsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of runtime project attachments.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachments = 1; + * + */ + public com.google.cloud.apihub.v1.RuntimeProjectAttachment getRuntimeProjectAttachments( + int index) { + if (runtimeProjectAttachmentsBuilder_ == null) { + return runtimeProjectAttachments_.get(index); + } else { + return runtimeProjectAttachmentsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of runtime project attachments.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachments = 1; + * + */ + public Builder setRuntimeProjectAttachments( + int index, com.google.cloud.apihub.v1.RuntimeProjectAttachment value) { + if (runtimeProjectAttachmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRuntimeProjectAttachmentsIsMutable(); + runtimeProjectAttachments_.set(index, value); + onChanged(); + } else { + runtimeProjectAttachmentsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of runtime project attachments.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachments = 1; + * + */ + public Builder setRuntimeProjectAttachments( + int index, com.google.cloud.apihub.v1.RuntimeProjectAttachment.Builder builderForValue) { + if (runtimeProjectAttachmentsBuilder_ == null) { + ensureRuntimeProjectAttachmentsIsMutable(); + runtimeProjectAttachments_.set(index, builderForValue.build()); + onChanged(); + } else { + runtimeProjectAttachmentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of runtime project attachments.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachments = 1; + * + */ + public Builder addRuntimeProjectAttachments( + com.google.cloud.apihub.v1.RuntimeProjectAttachment value) { + if (runtimeProjectAttachmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRuntimeProjectAttachmentsIsMutable(); + runtimeProjectAttachments_.add(value); + onChanged(); + } else { + runtimeProjectAttachmentsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of runtime project attachments.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachments = 1; + * + */ + public Builder addRuntimeProjectAttachments( + int index, com.google.cloud.apihub.v1.RuntimeProjectAttachment value) { + if (runtimeProjectAttachmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRuntimeProjectAttachmentsIsMutable(); + runtimeProjectAttachments_.add(index, value); + onChanged(); + } else { + runtimeProjectAttachmentsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of runtime project attachments.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachments = 1; + * + */ + public Builder addRuntimeProjectAttachments( + com.google.cloud.apihub.v1.RuntimeProjectAttachment.Builder builderForValue) { + if (runtimeProjectAttachmentsBuilder_ == null) { + ensureRuntimeProjectAttachmentsIsMutable(); + runtimeProjectAttachments_.add(builderForValue.build()); + onChanged(); + } else { + runtimeProjectAttachmentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of runtime project attachments.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachments = 1; + * + */ + public Builder addRuntimeProjectAttachments( + int index, com.google.cloud.apihub.v1.RuntimeProjectAttachment.Builder builderForValue) { + if (runtimeProjectAttachmentsBuilder_ == null) { + ensureRuntimeProjectAttachmentsIsMutable(); + runtimeProjectAttachments_.add(index, builderForValue.build()); + onChanged(); + } else { + runtimeProjectAttachmentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of runtime project attachments.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachments = 1; + * + */ + public Builder addAllRuntimeProjectAttachments( + java.lang.Iterable values) { + if (runtimeProjectAttachmentsBuilder_ == null) { + ensureRuntimeProjectAttachmentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, runtimeProjectAttachments_); + onChanged(); + } else { + runtimeProjectAttachmentsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of runtime project attachments.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachments = 1; + * + */ + public Builder clearRuntimeProjectAttachments() { + if (runtimeProjectAttachmentsBuilder_ == null) { + runtimeProjectAttachments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + runtimeProjectAttachmentsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of runtime project attachments.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachments = 1; + * + */ + public Builder removeRuntimeProjectAttachments(int index) { + if (runtimeProjectAttachmentsBuilder_ == null) { + ensureRuntimeProjectAttachmentsIsMutable(); + runtimeProjectAttachments_.remove(index); + onChanged(); + } else { + runtimeProjectAttachmentsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of runtime project attachments.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachments = 1; + * + */ + public com.google.cloud.apihub.v1.RuntimeProjectAttachment.Builder + getRuntimeProjectAttachmentsBuilder(int index) { + return getRuntimeProjectAttachmentsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of runtime project attachments.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachments = 1; + * + */ + public com.google.cloud.apihub.v1.RuntimeProjectAttachmentOrBuilder + getRuntimeProjectAttachmentsOrBuilder(int index) { + if (runtimeProjectAttachmentsBuilder_ == null) { + return runtimeProjectAttachments_.get(index); + } else { + return runtimeProjectAttachmentsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of runtime project attachments.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachments = 1; + * + */ + public java.util.List + getRuntimeProjectAttachmentsOrBuilderList() { + if (runtimeProjectAttachmentsBuilder_ != null) { + return runtimeProjectAttachmentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(runtimeProjectAttachments_); + } + } + /** + * + * + *
+     * List of runtime project attachments.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachments = 1; + * + */ + public com.google.cloud.apihub.v1.RuntimeProjectAttachment.Builder + addRuntimeProjectAttachmentsBuilder() { + return getRuntimeProjectAttachmentsFieldBuilder() + .addBuilder(com.google.cloud.apihub.v1.RuntimeProjectAttachment.getDefaultInstance()); + } + /** + * + * + *
+     * List of runtime project attachments.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachments = 1; + * + */ + public com.google.cloud.apihub.v1.RuntimeProjectAttachment.Builder + addRuntimeProjectAttachmentsBuilder(int index) { + return getRuntimeProjectAttachmentsFieldBuilder() + .addBuilder( + index, com.google.cloud.apihub.v1.RuntimeProjectAttachment.getDefaultInstance()); + } + /** + * + * + *
+     * List of runtime project attachments.
+     * 
+ * + * + * repeated .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachments = 1; + * + */ + public java.util.List + getRuntimeProjectAttachmentsBuilderList() { + return getRuntimeProjectAttachmentsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.RuntimeProjectAttachment, + com.google.cloud.apihub.v1.RuntimeProjectAttachment.Builder, + com.google.cloud.apihub.v1.RuntimeProjectAttachmentOrBuilder> + getRuntimeProjectAttachmentsFieldBuilder() { + if (runtimeProjectAttachmentsBuilder_ == null) { + runtimeProjectAttachmentsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.RuntimeProjectAttachment, + com.google.cloud.apihub.v1.RuntimeProjectAttachment.Builder, + com.google.cloud.apihub.v1.RuntimeProjectAttachmentOrBuilder>( + runtimeProjectAttachments_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + runtimeProjectAttachments_ = null; + } + return runtimeProjectAttachmentsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + 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.apihub.v1.ListRuntimeProjectAttachmentsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse) + private static final com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse(); + } + + public static com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListRuntimeProjectAttachmentsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.ListRuntimeProjectAttachmentsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListRuntimeProjectAttachmentsResponseOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListRuntimeProjectAttachmentsResponseOrBuilder.java new file mode 100644 index 000000000000..752b6cf05768 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListRuntimeProjectAttachmentsResponseOrBuilder.java @@ -0,0 +1,117 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/runtime_project_attachment_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface ListRuntimeProjectAttachmentsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of runtime project attachments.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachments = 1; + * + */ + java.util.List + getRuntimeProjectAttachmentsList(); + /** + * + * + *
+   * List of runtime project attachments.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachments = 1; + * + */ + com.google.cloud.apihub.v1.RuntimeProjectAttachment getRuntimeProjectAttachments(int index); + /** + * + * + *
+   * List of runtime project attachments.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachments = 1; + * + */ + int getRuntimeProjectAttachmentsCount(); + /** + * + * + *
+   * List of runtime project attachments.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachments = 1; + * + */ + java.util.List + getRuntimeProjectAttachmentsOrBuilderList(); + /** + * + * + *
+   * List of runtime project attachments.
+   * 
+ * + * + * repeated .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachments = 1; + * + */ + com.google.cloud.apihub.v1.RuntimeProjectAttachmentOrBuilder + getRuntimeProjectAttachmentsOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListSpecsRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListSpecsRequest.java new file mode 100644 index 000000000000..b53de203bdb1 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListSpecsRequest.java @@ -0,0 +1,1499 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [ListSpecs][ListSpecs] method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListSpecsRequest} + */ +public final class ListSpecsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.ListSpecsRequest) + ListSpecsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSpecsRequest.newBuilder() to construct. + private ListSpecsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSpecsRequest() { + parent_ = ""; + filter_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSpecsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListSpecsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListSpecsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListSpecsRequest.class, + com.google.cloud.apihub.v1.ListSpecsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent, which owns this collection of specs.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * 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 parent, which owns this collection of specs.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * 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 FILTER_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. An expression that filters the list of Specs.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string. The
+   * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not
+   * case sensitive.
+   *
+   * The following fields in the `Spec` are eligible for filtering:
+   *
+   *   * `display_name` - The display name of the Spec. Allowed comparison
+   *   operators: `=`.
+   *   * `create_time` - The time at which the Spec was created. The
+   *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+   *   format. Allowed comparison operators: `>` and `<`.
+   *   * `spec_type.enum_values.values.id` - The allowed value id of the
+   *   spec_type attribute associated with the Spec. Allowed comparison
+   *   operators: `:`.
+   *   * `spec_type.enum_values.values.display_name` - The allowed value display
+   *   name of the spec_type attribute associated with the Spec. Allowed
+   *   comparison operators: `:`.
+   *   * `lint_response.json_values.values` - The json value of the
+   *   lint_response attribute associated with the Spec. Allowed comparison
+   *   operators: `:`.
+   *   * `mime_type` - The MIME type of the Spec. Allowed comparison
+   *   operators: `=`.
+   *
+   * Expressions are combined with either `AND` logic operator or `OR` logical
+   * operator but not both of them together i.e. only one of the `AND` or `OR`
+   * operator can be used throughout the filter string and both the operators
+   * cannot be used together. No other logical operators are
+   * supported. At most three filter fields are allowed in the filter
+   * string and if provided more than that then `INVALID_ARGUMENT` error is
+   * returned by the API.
+   *
+   * Here are a few examples:
+   *
+   *   * `spec_type.enum_values.values.id: rest-id` -  The filter
+   *   string specifies that the id of the allowed value associated with the
+   *   spec_type attribute is _rest-id_.
+   *   * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` -
+   *   The filter string specifies that the display name of the allowed value
+   *   associated with the spec_type attribute is `Rest Display Name`.
+   *   * `spec_type.enum_values.values.id: grpc-id AND create_time <
+   *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+   *   The id of the allowed value associated with the spec_type attribute is
+   *   _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and
+   *   after _2021-08-10 12:00:00 UTC_.
+   *   * `spec_type.enum_values.values.id: rest-id OR
+   *   spec_type.enum_values.values.id: grpc-id`
+   *   - The id of the allowed value associated with the spec_type attribute is
+   *   _rest-id_ or _grpc-id_.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + 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(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An expression that filters the list of Specs.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string. The
+   * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not
+   * case sensitive.
+   *
+   * The following fields in the `Spec` are eligible for filtering:
+   *
+   *   * `display_name` - The display name of the Spec. Allowed comparison
+   *   operators: `=`.
+   *   * `create_time` - The time at which the Spec was created. The
+   *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+   *   format. Allowed comparison operators: `>` and `<`.
+   *   * `spec_type.enum_values.values.id` - The allowed value id of the
+   *   spec_type attribute associated with the Spec. Allowed comparison
+   *   operators: `:`.
+   *   * `spec_type.enum_values.values.display_name` - The allowed value display
+   *   name of the spec_type attribute associated with the Spec. Allowed
+   *   comparison operators: `:`.
+   *   * `lint_response.json_values.values` - The json value of the
+   *   lint_response attribute associated with the Spec. Allowed comparison
+   *   operators: `:`.
+   *   * `mime_type` - The MIME type of the Spec. Allowed comparison
+   *   operators: `=`.
+   *
+   * Expressions are combined with either `AND` logic operator or `OR` logical
+   * operator but not both of them together i.e. only one of the `AND` or `OR`
+   * operator can be used throughout the filter string and both the operators
+   * cannot be used together. No other logical operators are
+   * supported. At most three filter fields are allowed in the filter
+   * string and if provided more than that then `INVALID_ARGUMENT` error is
+   * returned by the API.
+   *
+   * Here are a few examples:
+   *
+   *   * `spec_type.enum_values.values.id: rest-id` -  The filter
+   *   string specifies that the id of the allowed value associated with the
+   *   spec_type attribute is _rest-id_.
+   *   * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` -
+   *   The filter string specifies that the display name of the allowed value
+   *   associated with the spec_type attribute is `Rest Display Name`.
+   *   * `spec_type.enum_values.values.id: grpc-id AND create_time <
+   *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+   *   The id of the allowed value associated with the spec_type attribute is
+   *   _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and
+   *   after _2021-08-10 12:00:00 UTC_.
+   *   * `spec_type.enum_values.values.id: rest-id OR
+   *   spec_type.enum_values.values.id: grpc-id`
+   *   - The id of the allowed value associated with the spec_type attribute is
+   *   _rest-id_ or _grpc-id_.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_ = 0; + /** + * + * + *
+   * Optional. The maximum number of specs to return. The service may return
+   * fewer than this value. If unspecified, at most 50 specs will be
+   * returned. The maximum value is 1000; values above 1000 will be coerced to
+   * 1000.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Optional. A page token, received from a previous `ListSpecs` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListSpecs` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 4 [(.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 page token, received from a previous `ListSpecs` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListSpecs` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 4 [(.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + size += getUnknownFields().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.apihub.v1.ListSpecsRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.ListSpecsRequest other = + (com.google.cloud.apihub.v1.ListSpecsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.ListSpecsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListSpecsRequest 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.apihub.v1.ListSpecsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListSpecsRequest 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.apihub.v1.ListSpecsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListSpecsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.ListSpecsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListSpecsRequest 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.apihub.v1.ListSpecsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListSpecsRequest 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.apihub.v1.ListSpecsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListSpecsRequest 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.apihub.v1.ListSpecsRequest 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 [ListSpecs][ListSpecs] method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListSpecsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.ListSpecsRequest) + com.google.cloud.apihub.v1.ListSpecsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListSpecsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListSpecsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListSpecsRequest.class, + com.google.cloud.apihub.v1.ListSpecsRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.ListSpecsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + filter_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListSpecsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListSpecsRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.ListSpecsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListSpecsRequest build() { + com.google.cloud.apihub.v1.ListSpecsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListSpecsRequest buildPartial() { + com.google.cloud.apihub.v1.ListSpecsRequest result = + new com.google.cloud.apihub.v1.ListSpecsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.ListSpecsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @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.apihub.v1.ListSpecsRequest) { + return mergeFrom((com.google.cloud.apihub.v1.ListSpecsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.ListSpecsRequest other) { + if (other == com.google.cloud.apihub.v1.ListSpecsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent, which owns this collection of specs.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * 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 parent, which owns this collection of specs.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * 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 parent, which owns this collection of specs.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent, which owns this collection of specs.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent, which owns this collection of specs.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. An expression that filters the list of Specs.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string. The
+     * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not
+     * case sensitive.
+     *
+     * The following fields in the `Spec` are eligible for filtering:
+     *
+     *   * `display_name` - The display name of the Spec. Allowed comparison
+     *   operators: `=`.
+     *   * `create_time` - The time at which the Spec was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *   * `spec_type.enum_values.values.id` - The allowed value id of the
+     *   spec_type attribute associated with the Spec. Allowed comparison
+     *   operators: `:`.
+     *   * `spec_type.enum_values.values.display_name` - The allowed value display
+     *   name of the spec_type attribute associated with the Spec. Allowed
+     *   comparison operators: `:`.
+     *   * `lint_response.json_values.values` - The json value of the
+     *   lint_response attribute associated with the Spec. Allowed comparison
+     *   operators: `:`.
+     *   * `mime_type` - The MIME type of the Spec. Allowed comparison
+     *   operators: `=`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are
+     * supported. At most three filter fields are allowed in the filter
+     * string and if provided more than that then `INVALID_ARGUMENT` error is
+     * returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `spec_type.enum_values.values.id: rest-id` -  The filter
+     *   string specifies that the id of the allowed value associated with the
+     *   spec_type attribute is _rest-id_.
+     *   * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` -
+     *   The filter string specifies that the display name of the allowed value
+     *   associated with the spec_type attribute is `Rest Display Name`.
+     *   * `spec_type.enum_values.values.id: grpc-id AND create_time <
+     *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+     *   The id of the allowed value associated with the spec_type attribute is
+     *   _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and
+     *   after _2021-08-10 12:00:00 UTC_.
+     *   * `spec_type.enum_values.values.id: rest-id OR
+     *   spec_type.enum_values.values.id: grpc-id`
+     *   - The id of the allowed value associated with the spec_type attribute is
+     *   _rest-id_ or _grpc-id_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An expression that filters the list of Specs.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string. The
+     * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not
+     * case sensitive.
+     *
+     * The following fields in the `Spec` are eligible for filtering:
+     *
+     *   * `display_name` - The display name of the Spec. Allowed comparison
+     *   operators: `=`.
+     *   * `create_time` - The time at which the Spec was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *   * `spec_type.enum_values.values.id` - The allowed value id of the
+     *   spec_type attribute associated with the Spec. Allowed comparison
+     *   operators: `:`.
+     *   * `spec_type.enum_values.values.display_name` - The allowed value display
+     *   name of the spec_type attribute associated with the Spec. Allowed
+     *   comparison operators: `:`.
+     *   * `lint_response.json_values.values` - The json value of the
+     *   lint_response attribute associated with the Spec. Allowed comparison
+     *   operators: `:`.
+     *   * `mime_type` - The MIME type of the Spec. Allowed comparison
+     *   operators: `=`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are
+     * supported. At most three filter fields are allowed in the filter
+     * string and if provided more than that then `INVALID_ARGUMENT` error is
+     * returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `spec_type.enum_values.values.id: rest-id` -  The filter
+     *   string specifies that the id of the allowed value associated with the
+     *   spec_type attribute is _rest-id_.
+     *   * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` -
+     *   The filter string specifies that the display name of the allowed value
+     *   associated with the spec_type attribute is `Rest Display Name`.
+     *   * `spec_type.enum_values.values.id: grpc-id AND create_time <
+     *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+     *   The id of the allowed value associated with the spec_type attribute is
+     *   _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and
+     *   after _2021-08-10 12:00:00 UTC_.
+     *   * `spec_type.enum_values.values.id: rest-id OR
+     *   spec_type.enum_values.values.id: grpc-id`
+     *   - The id of the allowed value associated with the spec_type attribute is
+     *   _rest-id_ or _grpc-id_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An expression that filters the list of Specs.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string. The
+     * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not
+     * case sensitive.
+     *
+     * The following fields in the `Spec` are eligible for filtering:
+     *
+     *   * `display_name` - The display name of the Spec. Allowed comparison
+     *   operators: `=`.
+     *   * `create_time` - The time at which the Spec was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *   * `spec_type.enum_values.values.id` - The allowed value id of the
+     *   spec_type attribute associated with the Spec. Allowed comparison
+     *   operators: `:`.
+     *   * `spec_type.enum_values.values.display_name` - The allowed value display
+     *   name of the spec_type attribute associated with the Spec. Allowed
+     *   comparison operators: `:`.
+     *   * `lint_response.json_values.values` - The json value of the
+     *   lint_response attribute associated with the Spec. Allowed comparison
+     *   operators: `:`.
+     *   * `mime_type` - The MIME type of the Spec. Allowed comparison
+     *   operators: `=`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are
+     * supported. At most three filter fields are allowed in the filter
+     * string and if provided more than that then `INVALID_ARGUMENT` error is
+     * returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `spec_type.enum_values.values.id: rest-id` -  The filter
+     *   string specifies that the id of the allowed value associated with the
+     *   spec_type attribute is _rest-id_.
+     *   * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` -
+     *   The filter string specifies that the display name of the allowed value
+     *   associated with the spec_type attribute is `Rest Display Name`.
+     *   * `spec_type.enum_values.values.id: grpc-id AND create_time <
+     *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+     *   The id of the allowed value associated with the spec_type attribute is
+     *   _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and
+     *   after _2021-08-10 12:00:00 UTC_.
+     *   * `spec_type.enum_values.values.id: rest-id OR
+     *   spec_type.enum_values.values.id: grpc-id`
+     *   - The id of the allowed value associated with the spec_type attribute is
+     *   _rest-id_ or _grpc-id_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An expression that filters the list of Specs.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string. The
+     * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not
+     * case sensitive.
+     *
+     * The following fields in the `Spec` are eligible for filtering:
+     *
+     *   * `display_name` - The display name of the Spec. Allowed comparison
+     *   operators: `=`.
+     *   * `create_time` - The time at which the Spec was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *   * `spec_type.enum_values.values.id` - The allowed value id of the
+     *   spec_type attribute associated with the Spec. Allowed comparison
+     *   operators: `:`.
+     *   * `spec_type.enum_values.values.display_name` - The allowed value display
+     *   name of the spec_type attribute associated with the Spec. Allowed
+     *   comparison operators: `:`.
+     *   * `lint_response.json_values.values` - The json value of the
+     *   lint_response attribute associated with the Spec. Allowed comparison
+     *   operators: `:`.
+     *   * `mime_type` - The MIME type of the Spec. Allowed comparison
+     *   operators: `=`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are
+     * supported. At most three filter fields are allowed in the filter
+     * string and if provided more than that then `INVALID_ARGUMENT` error is
+     * returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `spec_type.enum_values.values.id: rest-id` -  The filter
+     *   string specifies that the id of the allowed value associated with the
+     *   spec_type attribute is _rest-id_.
+     *   * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` -
+     *   The filter string specifies that the display name of the allowed value
+     *   associated with the spec_type attribute is `Rest Display Name`.
+     *   * `spec_type.enum_values.values.id: grpc-id AND create_time <
+     *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+     *   The id of the allowed value associated with the spec_type attribute is
+     *   _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and
+     *   after _2021-08-10 12:00:00 UTC_.
+     *   * `spec_type.enum_values.values.id: rest-id OR
+     *   spec_type.enum_values.values.id: grpc-id`
+     *   - The id of the allowed value associated with the spec_type attribute is
+     *   _rest-id_ or _grpc-id_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An expression that filters the list of Specs.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string. The
+     * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not
+     * case sensitive.
+     *
+     * The following fields in the `Spec` are eligible for filtering:
+     *
+     *   * `display_name` - The display name of the Spec. Allowed comparison
+     *   operators: `=`.
+     *   * `create_time` - The time at which the Spec was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *   * `spec_type.enum_values.values.id` - The allowed value id of the
+     *   spec_type attribute associated with the Spec. Allowed comparison
+     *   operators: `:`.
+     *   * `spec_type.enum_values.values.display_name` - The allowed value display
+     *   name of the spec_type attribute associated with the Spec. Allowed
+     *   comparison operators: `:`.
+     *   * `lint_response.json_values.values` - The json value of the
+     *   lint_response attribute associated with the Spec. Allowed comparison
+     *   operators: `:`.
+     *   * `mime_type` - The MIME type of the Spec. Allowed comparison
+     *   operators: `=`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are
+     * supported. At most three filter fields are allowed in the filter
+     * string and if provided more than that then `INVALID_ARGUMENT` error is
+     * returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `spec_type.enum_values.values.id: rest-id` -  The filter
+     *   string specifies that the id of the allowed value associated with the
+     *   spec_type attribute is _rest-id_.
+     *   * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` -
+     *   The filter string specifies that the display name of the allowed value
+     *   associated with the spec_type attribute is `Rest Display Name`.
+     *   * `spec_type.enum_values.values.id: grpc-id AND create_time <
+     *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+     *   The id of the allowed value associated with the spec_type attribute is
+     *   _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and
+     *   after _2021-08-10 12:00:00 UTC_.
+     *   * `spec_type.enum_values.values.id: rest-id OR
+     *   spec_type.enum_values.values.id: grpc-id`
+     *   - The id of the allowed value associated with the spec_type attribute is
+     *   _rest-id_ or _grpc-id_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of specs to return. The service may return
+     * fewer than this value. If unspecified, at most 50 specs will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * 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 specs to return. The service may return
+     * fewer than this value. If unspecified, at most 50 specs will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of specs to return. The service may return
+     * fewer than this value. If unspecified, at most 50 specs will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000004); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A page token, received from a previous `ListSpecs` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListSpecs` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.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 page token, received from a previous `ListSpecs` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListSpecs` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.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 page token, received from a previous `ListSpecs` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListSpecs` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous `ListSpecs` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListSpecs` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous `ListSpecs` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListSpecs` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.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; + bitField0_ |= 0x00000008; + 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.apihub.v1.ListSpecsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.ListSpecsRequest) + private static final com.google.cloud.apihub.v1.ListSpecsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.ListSpecsRequest(); + } + + public static com.google.cloud.apihub.v1.ListSpecsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSpecsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.ListSpecsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListSpecsRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListSpecsRequestOrBuilder.java new file mode 100644 index 000000000000..cb6cfadb0f13 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListSpecsRequestOrBuilder.java @@ -0,0 +1,233 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface ListSpecsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.ListSpecsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent, which owns this collection of specs.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent, which owns this collection of specs.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. An expression that filters the list of Specs.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string. The
+   * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not
+   * case sensitive.
+   *
+   * The following fields in the `Spec` are eligible for filtering:
+   *
+   *   * `display_name` - The display name of the Spec. Allowed comparison
+   *   operators: `=`.
+   *   * `create_time` - The time at which the Spec was created. The
+   *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+   *   format. Allowed comparison operators: `>` and `<`.
+   *   * `spec_type.enum_values.values.id` - The allowed value id of the
+   *   spec_type attribute associated with the Spec. Allowed comparison
+   *   operators: `:`.
+   *   * `spec_type.enum_values.values.display_name` - The allowed value display
+   *   name of the spec_type attribute associated with the Spec. Allowed
+   *   comparison operators: `:`.
+   *   * `lint_response.json_values.values` - The json value of the
+   *   lint_response attribute associated with the Spec. Allowed comparison
+   *   operators: `:`.
+   *   * `mime_type` - The MIME type of the Spec. Allowed comparison
+   *   operators: `=`.
+   *
+   * Expressions are combined with either `AND` logic operator or `OR` logical
+   * operator but not both of them together i.e. only one of the `AND` or `OR`
+   * operator can be used throughout the filter string and both the operators
+   * cannot be used together. No other logical operators are
+   * supported. At most three filter fields are allowed in the filter
+   * string and if provided more than that then `INVALID_ARGUMENT` error is
+   * returned by the API.
+   *
+   * Here are a few examples:
+   *
+   *   * `spec_type.enum_values.values.id: rest-id` -  The filter
+   *   string specifies that the id of the allowed value associated with the
+   *   spec_type attribute is _rest-id_.
+   *   * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` -
+   *   The filter string specifies that the display name of the allowed value
+   *   associated with the spec_type attribute is `Rest Display Name`.
+   *   * `spec_type.enum_values.values.id: grpc-id AND create_time <
+   *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+   *   The id of the allowed value associated with the spec_type attribute is
+   *   _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and
+   *   after _2021-08-10 12:00:00 UTC_.
+   *   * `spec_type.enum_values.values.id: rest-id OR
+   *   spec_type.enum_values.values.id: grpc-id`
+   *   - The id of the allowed value associated with the spec_type attribute is
+   *   _rest-id_ or _grpc-id_.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. An expression that filters the list of Specs.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string. The
+   * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not
+   * case sensitive.
+   *
+   * The following fields in the `Spec` are eligible for filtering:
+   *
+   *   * `display_name` - The display name of the Spec. Allowed comparison
+   *   operators: `=`.
+   *   * `create_time` - The time at which the Spec was created. The
+   *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+   *   format. Allowed comparison operators: `>` and `<`.
+   *   * `spec_type.enum_values.values.id` - The allowed value id of the
+   *   spec_type attribute associated with the Spec. Allowed comparison
+   *   operators: `:`.
+   *   * `spec_type.enum_values.values.display_name` - The allowed value display
+   *   name of the spec_type attribute associated with the Spec. Allowed
+   *   comparison operators: `:`.
+   *   * `lint_response.json_values.values` - The json value of the
+   *   lint_response attribute associated with the Spec. Allowed comparison
+   *   operators: `:`.
+   *   * `mime_type` - The MIME type of the Spec. Allowed comparison
+   *   operators: `=`.
+   *
+   * Expressions are combined with either `AND` logic operator or `OR` logical
+   * operator but not both of them together i.e. only one of the `AND` or `OR`
+   * operator can be used throughout the filter string and both the operators
+   * cannot be used together. No other logical operators are
+   * supported. At most three filter fields are allowed in the filter
+   * string and if provided more than that then `INVALID_ARGUMENT` error is
+   * returned by the API.
+   *
+   * Here are a few examples:
+   *
+   *   * `spec_type.enum_values.values.id: rest-id` -  The filter
+   *   string specifies that the id of the allowed value associated with the
+   *   spec_type attribute is _rest-id_.
+   *   * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` -
+   *   The filter string specifies that the display name of the allowed value
+   *   associated with the spec_type attribute is `Rest Display Name`.
+   *   * `spec_type.enum_values.values.id: grpc-id AND create_time <
+   *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+   *   The id of the allowed value associated with the spec_type attribute is
+   *   _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and
+   *   after _2021-08-10 12:00:00 UTC_.
+   *   * `spec_type.enum_values.values.id: rest-id OR
+   *   spec_type.enum_values.values.id: grpc-id`
+   *   - The id of the allowed value associated with the spec_type attribute is
+   *   _rest-id_ or _grpc-id_.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. The maximum number of specs to return. The service may return
+   * fewer than this value. If unspecified, at most 50 specs will be
+   * returned. The maximum value is 1000; values above 1000 will be coerced to
+   * 1000.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListSpecs` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListSpecs` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A page token, received from a previous `ListSpecs` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListSpecs` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListSpecsResponse.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListSpecsResponse.java new file mode 100644 index 000000000000..7f3d09955cbd --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListSpecsResponse.java @@ -0,0 +1,1119 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [ListSpecs][google.cloud.apihub.v1.ApiHub.ListSpecs] method's response.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListSpecsResponse} + */ +public final class ListSpecsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.ListSpecsResponse) + ListSpecsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSpecsResponse.newBuilder() to construct. + private ListSpecsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSpecsResponse() { + specs_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSpecsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListSpecsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListSpecsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListSpecsResponse.class, + com.google.cloud.apihub.v1.ListSpecsResponse.Builder.class); + } + + public static final int SPECS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List specs_; + /** + * + * + *
+   * The specs corresponding to an API.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Spec specs = 1; + */ + @java.lang.Override + public java.util.List getSpecsList() { + return specs_; + } + /** + * + * + *
+   * The specs corresponding to an API.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Spec specs = 1; + */ + @java.lang.Override + public java.util.List + getSpecsOrBuilderList() { + return specs_; + } + /** + * + * + *
+   * The specs corresponding to an API.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Spec specs = 1; + */ + @java.lang.Override + public int getSpecsCount() { + return specs_.size(); + } + /** + * + * + *
+   * The specs corresponding to an API.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Spec specs = 1; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Spec getSpecs(int index) { + return specs_.get(index); + } + /** + * + * + *
+   * The specs corresponding to an API.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Spec specs = 1; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.SpecOrBuilder getSpecsOrBuilder(int index) { + return specs_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * 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 < specs_.size(); i++) { + output.writeMessage(1, specs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < specs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, specs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().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.apihub.v1.ListSpecsResponse)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.ListSpecsResponse other = + (com.google.cloud.apihub.v1.ListSpecsResponse) obj; + + if (!getSpecsList().equals(other.getSpecsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSpecsCount() > 0) { + hash = (37 * hash) + SPECS_FIELD_NUMBER; + hash = (53 * hash) + getSpecsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.ListSpecsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListSpecsResponse 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.apihub.v1.ListSpecsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListSpecsResponse 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.apihub.v1.ListSpecsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListSpecsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.ListSpecsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListSpecsResponse 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.apihub.v1.ListSpecsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListSpecsResponse 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.apihub.v1.ListSpecsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListSpecsResponse 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.apihub.v1.ListSpecsResponse 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 [ListSpecs][google.cloud.apihub.v1.ApiHub.ListSpecs] method's response.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListSpecsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.ListSpecsResponse) + com.google.cloud.apihub.v1.ListSpecsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListSpecsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListSpecsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListSpecsResponse.class, + com.google.cloud.apihub.v1.ListSpecsResponse.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.ListSpecsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (specsBuilder_ == null) { + specs_ = java.util.Collections.emptyList(); + } else { + specs_ = null; + specsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListSpecsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListSpecsResponse getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.ListSpecsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListSpecsResponse build() { + com.google.cloud.apihub.v1.ListSpecsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListSpecsResponse buildPartial() { + com.google.cloud.apihub.v1.ListSpecsResponse result = + new com.google.cloud.apihub.v1.ListSpecsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.apihub.v1.ListSpecsResponse result) { + if (specsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + specs_ = java.util.Collections.unmodifiableList(specs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.specs_ = specs_; + } else { + result.specs_ = specsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.apihub.v1.ListSpecsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.apihub.v1.ListSpecsResponse) { + return mergeFrom((com.google.cloud.apihub.v1.ListSpecsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.ListSpecsResponse other) { + if (other == com.google.cloud.apihub.v1.ListSpecsResponse.getDefaultInstance()) return this; + if (specsBuilder_ == null) { + if (!other.specs_.isEmpty()) { + if (specs_.isEmpty()) { + specs_ = other.specs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSpecsIsMutable(); + specs_.addAll(other.specs_); + } + onChanged(); + } + } else { + if (!other.specs_.isEmpty()) { + if (specsBuilder_.isEmpty()) { + specsBuilder_.dispose(); + specsBuilder_ = null; + specs_ = other.specs_; + bitField0_ = (bitField0_ & ~0x00000001); + specsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSpecsFieldBuilder() + : null; + } else { + specsBuilder_.addAllMessages(other.specs_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.apihub.v1.Spec m = + input.readMessage(com.google.cloud.apihub.v1.Spec.parser(), extensionRegistry); + if (specsBuilder_ == null) { + ensureSpecsIsMutable(); + specs_.add(m); + } else { + specsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List specs_ = + java.util.Collections.emptyList(); + + private void ensureSpecsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + specs_ = new java.util.ArrayList(specs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.Spec, + com.google.cloud.apihub.v1.Spec.Builder, + com.google.cloud.apihub.v1.SpecOrBuilder> + specsBuilder_; + + /** + * + * + *
+     * The specs corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Spec specs = 1; + */ + public java.util.List getSpecsList() { + if (specsBuilder_ == null) { + return java.util.Collections.unmodifiableList(specs_); + } else { + return specsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The specs corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Spec specs = 1; + */ + public int getSpecsCount() { + if (specsBuilder_ == null) { + return specs_.size(); + } else { + return specsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The specs corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Spec specs = 1; + */ + public com.google.cloud.apihub.v1.Spec getSpecs(int index) { + if (specsBuilder_ == null) { + return specs_.get(index); + } else { + return specsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The specs corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Spec specs = 1; + */ + public Builder setSpecs(int index, com.google.cloud.apihub.v1.Spec value) { + if (specsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpecsIsMutable(); + specs_.set(index, value); + onChanged(); + } else { + specsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The specs corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Spec specs = 1; + */ + public Builder setSpecs(int index, com.google.cloud.apihub.v1.Spec.Builder builderForValue) { + if (specsBuilder_ == null) { + ensureSpecsIsMutable(); + specs_.set(index, builderForValue.build()); + onChanged(); + } else { + specsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The specs corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Spec specs = 1; + */ + public Builder addSpecs(com.google.cloud.apihub.v1.Spec value) { + if (specsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpecsIsMutable(); + specs_.add(value); + onChanged(); + } else { + specsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The specs corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Spec specs = 1; + */ + public Builder addSpecs(int index, com.google.cloud.apihub.v1.Spec value) { + if (specsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpecsIsMutable(); + specs_.add(index, value); + onChanged(); + } else { + specsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The specs corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Spec specs = 1; + */ + public Builder addSpecs(com.google.cloud.apihub.v1.Spec.Builder builderForValue) { + if (specsBuilder_ == null) { + ensureSpecsIsMutable(); + specs_.add(builderForValue.build()); + onChanged(); + } else { + specsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The specs corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Spec specs = 1; + */ + public Builder addSpecs(int index, com.google.cloud.apihub.v1.Spec.Builder builderForValue) { + if (specsBuilder_ == null) { + ensureSpecsIsMutable(); + specs_.add(index, builderForValue.build()); + onChanged(); + } else { + specsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The specs corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Spec specs = 1; + */ + public Builder addAllSpecs( + java.lang.Iterable values) { + if (specsBuilder_ == null) { + ensureSpecsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, specs_); + onChanged(); + } else { + specsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The specs corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Spec specs = 1; + */ + public Builder clearSpecs() { + if (specsBuilder_ == null) { + specs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + specsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The specs corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Spec specs = 1; + */ + public Builder removeSpecs(int index) { + if (specsBuilder_ == null) { + ensureSpecsIsMutable(); + specs_.remove(index); + onChanged(); + } else { + specsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The specs corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Spec specs = 1; + */ + public com.google.cloud.apihub.v1.Spec.Builder getSpecsBuilder(int index) { + return getSpecsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The specs corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Spec specs = 1; + */ + public com.google.cloud.apihub.v1.SpecOrBuilder getSpecsOrBuilder(int index) { + if (specsBuilder_ == null) { + return specs_.get(index); + } else { + return specsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The specs corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Spec specs = 1; + */ + public java.util.List + getSpecsOrBuilderList() { + if (specsBuilder_ != null) { + return specsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(specs_); + } + } + /** + * + * + *
+     * The specs corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Spec specs = 1; + */ + public com.google.cloud.apihub.v1.Spec.Builder addSpecsBuilder() { + return getSpecsFieldBuilder() + .addBuilder(com.google.cloud.apihub.v1.Spec.getDefaultInstance()); + } + /** + * + * + *
+     * The specs corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Spec specs = 1; + */ + public com.google.cloud.apihub.v1.Spec.Builder addSpecsBuilder(int index) { + return getSpecsFieldBuilder() + .addBuilder(index, com.google.cloud.apihub.v1.Spec.getDefaultInstance()); + } + /** + * + * + *
+     * The specs corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Spec specs = 1; + */ + public java.util.List getSpecsBuilderList() { + return getSpecsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.Spec, + com.google.cloud.apihub.v1.Spec.Builder, + com.google.cloud.apihub.v1.SpecOrBuilder> + getSpecsFieldBuilder() { + if (specsBuilder_ == null) { + specsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.Spec, + com.google.cloud.apihub.v1.Spec.Builder, + com.google.cloud.apihub.v1.SpecOrBuilder>( + specs_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + specs_ = null; + } + return specsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + 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.apihub.v1.ListSpecsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.ListSpecsResponse) + private static final com.google.cloud.apihub.v1.ListSpecsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.ListSpecsResponse(); + } + + public static com.google.cloud.apihub.v1.ListSpecsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSpecsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.ListSpecsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListSpecsResponseOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListSpecsResponseOrBuilder.java new file mode 100644 index 000000000000..1a17a5002a4b --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListSpecsResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface ListSpecsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.ListSpecsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The specs corresponding to an API.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Spec specs = 1; + */ + java.util.List getSpecsList(); + /** + * + * + *
+   * The specs corresponding to an API.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Spec specs = 1; + */ + com.google.cloud.apihub.v1.Spec getSpecs(int index); + /** + * + * + *
+   * The specs corresponding to an API.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Spec specs = 1; + */ + int getSpecsCount(); + /** + * + * + *
+   * The specs corresponding to an API.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Spec specs = 1; + */ + java.util.List getSpecsOrBuilderList(); + /** + * + * + *
+   * The specs corresponding to an API.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Spec specs = 1; + */ + com.google.cloud.apihub.v1.SpecOrBuilder getSpecsOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListVersionsRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListVersionsRequest.java new file mode 100644 index 000000000000..0def08713f6b --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListVersionsRequest.java @@ -0,0 +1,1550 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [ListVersions][google.cloud.apihub.v1.ApiHub.ListVersions] method's
+ * request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListVersionsRequest} + */ +public final class ListVersionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.ListVersionsRequest) + ListVersionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListVersionsRequest.newBuilder() to construct. + private ListVersionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListVersionsRequest() { + parent_ = ""; + filter_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListVersionsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListVersionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListVersionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListVersionsRequest.class, + com.google.cloud.apihub.v1.ListVersionsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent which owns this collection of API versions i.e., the
+   * API resource Format: `projects/{project}/locations/{location}/apis/{api}`
+   * 
+ * + * + * 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 parent which owns this collection of API versions i.e., the
+   * API resource Format: `projects/{project}/locations/{location}/apis/{api}`
+   * 
+ * + * + * 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 FILTER_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. An expression that filters the list of Versions.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string, a
+   * number, or a boolean. The comparison operator must be one of: `<`, `>` or
+   * `=`. Filters are not case sensitive.
+   *
+   * The following fields in the `Version` are eligible for filtering:
+   *
+   *   * `display_name` - The display name of the Version. Allowed
+   *   comparison operators: `=`.
+   *   * `create_time` - The time at which the Version was created. The
+   *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+   *   format. Allowed comparison operators: `>` and `<`.
+   *   * `lifecycle.enum_values.values.id` - The allowed value id of the
+   *   lifecycle attribute associated with the Version. Allowed comparison
+   *   operators: `:`.
+   *   * `lifecycle.enum_values.values.display_name` - The allowed value display
+   *   name of the lifecycle attribute associated with the Version. Allowed
+   *   comparison operators: `:`.
+   *   * `compliance.enum_values.values.id` -  The allowed value id of the
+   *   compliances attribute associated with the Version. Allowed comparison
+   *   operators: `:`.
+   *   * `compliance.enum_values.values.display_name` -  The allowed value
+   *   display name of the compliances attribute associated with the Version.
+   *   Allowed comparison operators: `:`.
+   *   * `accreditation.enum_values.values.id` - The allowed value id of the
+   *   accreditations attribute associated with the Version. Allowed
+   *   comparison operators: `:`.
+   *   * `accreditation.enum_values.values.display_name` - The allowed value
+   *   display name of the accreditations attribute associated with the Version.
+   *   Allowed comparison operators: `:`.
+   *
+   * Expressions are combined with either `AND` logic operator or `OR` logical
+   * operator but not both of them together i.e. only one of the `AND` or `OR`
+   * operator can be used throughout the filter string and both the operators
+   * cannot be used together. No other logical operators are
+   * supported. At most three filter fields are allowed in the filter
+   * string and if provided more than that then `INVALID_ARGUMENT` error is
+   * returned by the API.
+   *
+   * Here are a few examples:
+   *
+   *   * `lifecycle.enum_values.values.id: preview-id` - The filter string
+   *   specifies that the id of the allowed value associated with the lifecycle
+   *   attribute of the Version is _preview-id_.
+   *   * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` -
+   *   The filter string specifies that the display name of the allowed value
+   *   associated with the lifecycle attribute of the Version is `Preview
+   *   Display Name`.
+   *   * `lifecycle.enum_values.values.id: preview-id AND create_time <
+   *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+   *   The id of the allowed value associated with the lifecycle attribute of
+   *   the Version is _preview-id_ and it was created before _2021-08-15
+   *   14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
+   *   * `compliance.enum_values.values.id: gdpr-id OR
+   *   compliance.enum_values.values.id: pci-dss-id`
+   *   - The id of the allowed value associated with the compliance attribute is
+   *   _gdpr-id_ or _pci-dss-id_.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + 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(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An expression that filters the list of Versions.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string, a
+   * number, or a boolean. The comparison operator must be one of: `<`, `>` or
+   * `=`. Filters are not case sensitive.
+   *
+   * The following fields in the `Version` are eligible for filtering:
+   *
+   *   * `display_name` - The display name of the Version. Allowed
+   *   comparison operators: `=`.
+   *   * `create_time` - The time at which the Version was created. The
+   *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+   *   format. Allowed comparison operators: `>` and `<`.
+   *   * `lifecycle.enum_values.values.id` - The allowed value id of the
+   *   lifecycle attribute associated with the Version. Allowed comparison
+   *   operators: `:`.
+   *   * `lifecycle.enum_values.values.display_name` - The allowed value display
+   *   name of the lifecycle attribute associated with the Version. Allowed
+   *   comparison operators: `:`.
+   *   * `compliance.enum_values.values.id` -  The allowed value id of the
+   *   compliances attribute associated with the Version. Allowed comparison
+   *   operators: `:`.
+   *   * `compliance.enum_values.values.display_name` -  The allowed value
+   *   display name of the compliances attribute associated with the Version.
+   *   Allowed comparison operators: `:`.
+   *   * `accreditation.enum_values.values.id` - The allowed value id of the
+   *   accreditations attribute associated with the Version. Allowed
+   *   comparison operators: `:`.
+   *   * `accreditation.enum_values.values.display_name` - The allowed value
+   *   display name of the accreditations attribute associated with the Version.
+   *   Allowed comparison operators: `:`.
+   *
+   * Expressions are combined with either `AND` logic operator or `OR` logical
+   * operator but not both of them together i.e. only one of the `AND` or `OR`
+   * operator can be used throughout the filter string and both the operators
+   * cannot be used together. No other logical operators are
+   * supported. At most three filter fields are allowed in the filter
+   * string and if provided more than that then `INVALID_ARGUMENT` error is
+   * returned by the API.
+   *
+   * Here are a few examples:
+   *
+   *   * `lifecycle.enum_values.values.id: preview-id` - The filter string
+   *   specifies that the id of the allowed value associated with the lifecycle
+   *   attribute of the Version is _preview-id_.
+   *   * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` -
+   *   The filter string specifies that the display name of the allowed value
+   *   associated with the lifecycle attribute of the Version is `Preview
+   *   Display Name`.
+   *   * `lifecycle.enum_values.values.id: preview-id AND create_time <
+   *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+   *   The id of the allowed value associated with the lifecycle attribute of
+   *   the Version is _preview-id_ and it was created before _2021-08-15
+   *   14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
+   *   * `compliance.enum_values.values.id: gdpr-id OR
+   *   compliance.enum_values.values.id: pci-dss-id`
+   *   - The id of the allowed value associated with the compliance attribute is
+   *   _gdpr-id_ or _pci-dss-id_.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_ = 0; + /** + * + * + *
+   * Optional. The maximum number of versions to return. The service may return
+   * fewer than this value. If unspecified, at most 50 versions will be
+   * returned. The maximum value is 1000; values above 1000 will be coerced to
+   * 1000.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Optional. A page token, received from a previous `ListVersions` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters (except page_size) provided to
+   * `ListVersions` must match the call that provided the page token.
+   * 
+ * + * string page_token = 4 [(.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 page token, received from a previous `ListVersions` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters (except page_size) provided to
+   * `ListVersions` must match the call that provided the page token.
+   * 
+ * + * string page_token = 4 [(.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + size += getUnknownFields().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.apihub.v1.ListVersionsRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.ListVersionsRequest other = + (com.google.cloud.apihub.v1.ListVersionsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.ListVersionsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListVersionsRequest 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.apihub.v1.ListVersionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListVersionsRequest 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.apihub.v1.ListVersionsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListVersionsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.ListVersionsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListVersionsRequest 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.apihub.v1.ListVersionsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListVersionsRequest 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.apihub.v1.ListVersionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListVersionsRequest 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.apihub.v1.ListVersionsRequest 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 [ListVersions][google.cloud.apihub.v1.ApiHub.ListVersions] method's
+   * request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListVersionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.ListVersionsRequest) + com.google.cloud.apihub.v1.ListVersionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListVersionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListVersionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListVersionsRequest.class, + com.google.cloud.apihub.v1.ListVersionsRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.ListVersionsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + filter_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListVersionsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListVersionsRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.ListVersionsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListVersionsRequest build() { + com.google.cloud.apihub.v1.ListVersionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListVersionsRequest buildPartial() { + com.google.cloud.apihub.v1.ListVersionsRequest result = + new com.google.cloud.apihub.v1.ListVersionsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.ListVersionsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @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.apihub.v1.ListVersionsRequest) { + return mergeFrom((com.google.cloud.apihub.v1.ListVersionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.ListVersionsRequest other) { + if (other == com.google.cloud.apihub.v1.ListVersionsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent which owns this collection of API versions i.e., the
+     * API resource Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * + * 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 parent which owns this collection of API versions i.e., the
+     * API resource Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * + * 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 parent which owns this collection of API versions i.e., the
+     * API resource Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent which owns this collection of API versions i.e., the
+     * API resource Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent which owns this collection of API versions i.e., the
+     * API resource Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. An expression that filters the list of Versions.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string, a
+     * number, or a boolean. The comparison operator must be one of: `<`, `>` or
+     * `=`. Filters are not case sensitive.
+     *
+     * The following fields in the `Version` are eligible for filtering:
+     *
+     *   * `display_name` - The display name of the Version. Allowed
+     *   comparison operators: `=`.
+     *   * `create_time` - The time at which the Version was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *   * `lifecycle.enum_values.values.id` - The allowed value id of the
+     *   lifecycle attribute associated with the Version. Allowed comparison
+     *   operators: `:`.
+     *   * `lifecycle.enum_values.values.display_name` - The allowed value display
+     *   name of the lifecycle attribute associated with the Version. Allowed
+     *   comparison operators: `:`.
+     *   * `compliance.enum_values.values.id` -  The allowed value id of the
+     *   compliances attribute associated with the Version. Allowed comparison
+     *   operators: `:`.
+     *   * `compliance.enum_values.values.display_name` -  The allowed value
+     *   display name of the compliances attribute associated with the Version.
+     *   Allowed comparison operators: `:`.
+     *   * `accreditation.enum_values.values.id` - The allowed value id of the
+     *   accreditations attribute associated with the Version. Allowed
+     *   comparison operators: `:`.
+     *   * `accreditation.enum_values.values.display_name` - The allowed value
+     *   display name of the accreditations attribute associated with the Version.
+     *   Allowed comparison operators: `:`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are
+     * supported. At most three filter fields are allowed in the filter
+     * string and if provided more than that then `INVALID_ARGUMENT` error is
+     * returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `lifecycle.enum_values.values.id: preview-id` - The filter string
+     *   specifies that the id of the allowed value associated with the lifecycle
+     *   attribute of the Version is _preview-id_.
+     *   * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` -
+     *   The filter string specifies that the display name of the allowed value
+     *   associated with the lifecycle attribute of the Version is `Preview
+     *   Display Name`.
+     *   * `lifecycle.enum_values.values.id: preview-id AND create_time <
+     *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+     *   The id of the allowed value associated with the lifecycle attribute of
+     *   the Version is _preview-id_ and it was created before _2021-08-15
+     *   14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
+     *   * `compliance.enum_values.values.id: gdpr-id OR
+     *   compliance.enum_values.values.id: pci-dss-id`
+     *   - The id of the allowed value associated with the compliance attribute is
+     *   _gdpr-id_ or _pci-dss-id_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An expression that filters the list of Versions.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string, a
+     * number, or a boolean. The comparison operator must be one of: `<`, `>` or
+     * `=`. Filters are not case sensitive.
+     *
+     * The following fields in the `Version` are eligible for filtering:
+     *
+     *   * `display_name` - The display name of the Version. Allowed
+     *   comparison operators: `=`.
+     *   * `create_time` - The time at which the Version was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *   * `lifecycle.enum_values.values.id` - The allowed value id of the
+     *   lifecycle attribute associated with the Version. Allowed comparison
+     *   operators: `:`.
+     *   * `lifecycle.enum_values.values.display_name` - The allowed value display
+     *   name of the lifecycle attribute associated with the Version. Allowed
+     *   comparison operators: `:`.
+     *   * `compliance.enum_values.values.id` -  The allowed value id of the
+     *   compliances attribute associated with the Version. Allowed comparison
+     *   operators: `:`.
+     *   * `compliance.enum_values.values.display_name` -  The allowed value
+     *   display name of the compliances attribute associated with the Version.
+     *   Allowed comparison operators: `:`.
+     *   * `accreditation.enum_values.values.id` - The allowed value id of the
+     *   accreditations attribute associated with the Version. Allowed
+     *   comparison operators: `:`.
+     *   * `accreditation.enum_values.values.display_name` - The allowed value
+     *   display name of the accreditations attribute associated with the Version.
+     *   Allowed comparison operators: `:`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are
+     * supported. At most three filter fields are allowed in the filter
+     * string and if provided more than that then `INVALID_ARGUMENT` error is
+     * returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `lifecycle.enum_values.values.id: preview-id` - The filter string
+     *   specifies that the id of the allowed value associated with the lifecycle
+     *   attribute of the Version is _preview-id_.
+     *   * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` -
+     *   The filter string specifies that the display name of the allowed value
+     *   associated with the lifecycle attribute of the Version is `Preview
+     *   Display Name`.
+     *   * `lifecycle.enum_values.values.id: preview-id AND create_time <
+     *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+     *   The id of the allowed value associated with the lifecycle attribute of
+     *   the Version is _preview-id_ and it was created before _2021-08-15
+     *   14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
+     *   * `compliance.enum_values.values.id: gdpr-id OR
+     *   compliance.enum_values.values.id: pci-dss-id`
+     *   - The id of the allowed value associated with the compliance attribute is
+     *   _gdpr-id_ or _pci-dss-id_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An expression that filters the list of Versions.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string, a
+     * number, or a boolean. The comparison operator must be one of: `<`, `>` or
+     * `=`. Filters are not case sensitive.
+     *
+     * The following fields in the `Version` are eligible for filtering:
+     *
+     *   * `display_name` - The display name of the Version. Allowed
+     *   comparison operators: `=`.
+     *   * `create_time` - The time at which the Version was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *   * `lifecycle.enum_values.values.id` - The allowed value id of the
+     *   lifecycle attribute associated with the Version. Allowed comparison
+     *   operators: `:`.
+     *   * `lifecycle.enum_values.values.display_name` - The allowed value display
+     *   name of the lifecycle attribute associated with the Version. Allowed
+     *   comparison operators: `:`.
+     *   * `compliance.enum_values.values.id` -  The allowed value id of the
+     *   compliances attribute associated with the Version. Allowed comparison
+     *   operators: `:`.
+     *   * `compliance.enum_values.values.display_name` -  The allowed value
+     *   display name of the compliances attribute associated with the Version.
+     *   Allowed comparison operators: `:`.
+     *   * `accreditation.enum_values.values.id` - The allowed value id of the
+     *   accreditations attribute associated with the Version. Allowed
+     *   comparison operators: `:`.
+     *   * `accreditation.enum_values.values.display_name` - The allowed value
+     *   display name of the accreditations attribute associated with the Version.
+     *   Allowed comparison operators: `:`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are
+     * supported. At most three filter fields are allowed in the filter
+     * string and if provided more than that then `INVALID_ARGUMENT` error is
+     * returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `lifecycle.enum_values.values.id: preview-id` - The filter string
+     *   specifies that the id of the allowed value associated with the lifecycle
+     *   attribute of the Version is _preview-id_.
+     *   * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` -
+     *   The filter string specifies that the display name of the allowed value
+     *   associated with the lifecycle attribute of the Version is `Preview
+     *   Display Name`.
+     *   * `lifecycle.enum_values.values.id: preview-id AND create_time <
+     *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+     *   The id of the allowed value associated with the lifecycle attribute of
+     *   the Version is _preview-id_ and it was created before _2021-08-15
+     *   14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
+     *   * `compliance.enum_values.values.id: gdpr-id OR
+     *   compliance.enum_values.values.id: pci-dss-id`
+     *   - The id of the allowed value associated with the compliance attribute is
+     *   _gdpr-id_ or _pci-dss-id_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An expression that filters the list of Versions.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string, a
+     * number, or a boolean. The comparison operator must be one of: `<`, `>` or
+     * `=`. Filters are not case sensitive.
+     *
+     * The following fields in the `Version` are eligible for filtering:
+     *
+     *   * `display_name` - The display name of the Version. Allowed
+     *   comparison operators: `=`.
+     *   * `create_time` - The time at which the Version was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *   * `lifecycle.enum_values.values.id` - The allowed value id of the
+     *   lifecycle attribute associated with the Version. Allowed comparison
+     *   operators: `:`.
+     *   * `lifecycle.enum_values.values.display_name` - The allowed value display
+     *   name of the lifecycle attribute associated with the Version. Allowed
+     *   comparison operators: `:`.
+     *   * `compliance.enum_values.values.id` -  The allowed value id of the
+     *   compliances attribute associated with the Version. Allowed comparison
+     *   operators: `:`.
+     *   * `compliance.enum_values.values.display_name` -  The allowed value
+     *   display name of the compliances attribute associated with the Version.
+     *   Allowed comparison operators: `:`.
+     *   * `accreditation.enum_values.values.id` - The allowed value id of the
+     *   accreditations attribute associated with the Version. Allowed
+     *   comparison operators: `:`.
+     *   * `accreditation.enum_values.values.display_name` - The allowed value
+     *   display name of the accreditations attribute associated with the Version.
+     *   Allowed comparison operators: `:`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are
+     * supported. At most three filter fields are allowed in the filter
+     * string and if provided more than that then `INVALID_ARGUMENT` error is
+     * returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `lifecycle.enum_values.values.id: preview-id` - The filter string
+     *   specifies that the id of the allowed value associated with the lifecycle
+     *   attribute of the Version is _preview-id_.
+     *   * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` -
+     *   The filter string specifies that the display name of the allowed value
+     *   associated with the lifecycle attribute of the Version is `Preview
+     *   Display Name`.
+     *   * `lifecycle.enum_values.values.id: preview-id AND create_time <
+     *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+     *   The id of the allowed value associated with the lifecycle attribute of
+     *   the Version is _preview-id_ and it was created before _2021-08-15
+     *   14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
+     *   * `compliance.enum_values.values.id: gdpr-id OR
+     *   compliance.enum_values.values.id: pci-dss-id`
+     *   - The id of the allowed value associated with the compliance attribute is
+     *   _gdpr-id_ or _pci-dss-id_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An expression that filters the list of Versions.
+     *
+     * A filter expression consists of a field name, a comparison
+     * operator, and a value for filtering. The value must be a string, a
+     * number, or a boolean. The comparison operator must be one of: `<`, `>` or
+     * `=`. Filters are not case sensitive.
+     *
+     * The following fields in the `Version` are eligible for filtering:
+     *
+     *   * `display_name` - The display name of the Version. Allowed
+     *   comparison operators: `=`.
+     *   * `create_time` - The time at which the Version was created. The
+     *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+     *   format. Allowed comparison operators: `>` and `<`.
+     *   * `lifecycle.enum_values.values.id` - The allowed value id of the
+     *   lifecycle attribute associated with the Version. Allowed comparison
+     *   operators: `:`.
+     *   * `lifecycle.enum_values.values.display_name` - The allowed value display
+     *   name of the lifecycle attribute associated with the Version. Allowed
+     *   comparison operators: `:`.
+     *   * `compliance.enum_values.values.id` -  The allowed value id of the
+     *   compliances attribute associated with the Version. Allowed comparison
+     *   operators: `:`.
+     *   * `compliance.enum_values.values.display_name` -  The allowed value
+     *   display name of the compliances attribute associated with the Version.
+     *   Allowed comparison operators: `:`.
+     *   * `accreditation.enum_values.values.id` - The allowed value id of the
+     *   accreditations attribute associated with the Version. Allowed
+     *   comparison operators: `:`.
+     *   * `accreditation.enum_values.values.display_name` - The allowed value
+     *   display name of the accreditations attribute associated with the Version.
+     *   Allowed comparison operators: `:`.
+     *
+     * Expressions are combined with either `AND` logic operator or `OR` logical
+     * operator but not both of them together i.e. only one of the `AND` or `OR`
+     * operator can be used throughout the filter string and both the operators
+     * cannot be used together. No other logical operators are
+     * supported. At most three filter fields are allowed in the filter
+     * string and if provided more than that then `INVALID_ARGUMENT` error is
+     * returned by the API.
+     *
+     * Here are a few examples:
+     *
+     *   * `lifecycle.enum_values.values.id: preview-id` - The filter string
+     *   specifies that the id of the allowed value associated with the lifecycle
+     *   attribute of the Version is _preview-id_.
+     *   * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` -
+     *   The filter string specifies that the display name of the allowed value
+     *   associated with the lifecycle attribute of the Version is `Preview
+     *   Display Name`.
+     *   * `lifecycle.enum_values.values.id: preview-id AND create_time <
+     *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+     *   The id of the allowed value associated with the lifecycle attribute of
+     *   the Version is _preview-id_ and it was created before _2021-08-15
+     *   14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
+     *   * `compliance.enum_values.values.id: gdpr-id OR
+     *   compliance.enum_values.values.id: pci-dss-id`
+     *   - The id of the allowed value associated with the compliance attribute is
+     *   _gdpr-id_ or _pci-dss-id_.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of versions to return. The service may return
+     * fewer than this value. If unspecified, at most 50 versions will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * 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 versions to return. The service may return
+     * fewer than this value. If unspecified, at most 50 versions will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of versions to return. The service may return
+     * fewer than this value. If unspecified, at most 50 versions will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000004); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A page token, received from a previous `ListVersions` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListVersions` must match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.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 page token, received from a previous `ListVersions` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListVersions` must match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.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 page token, received from a previous `ListVersions` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListVersions` must match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous `ListVersions` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListVersions` must match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous `ListVersions` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters (except page_size) provided to
+     * `ListVersions` must match the call that provided the page token.
+     * 
+ * + * string page_token = 4 [(.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; + bitField0_ |= 0x00000008; + 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.apihub.v1.ListVersionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.ListVersionsRequest) + private static final com.google.cloud.apihub.v1.ListVersionsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.ListVersionsRequest(); + } + + public static com.google.cloud.apihub.v1.ListVersionsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListVersionsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.ListVersionsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListVersionsRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListVersionsRequestOrBuilder.java new file mode 100644 index 000000000000..8e6130ec9e3d --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListVersionsRequestOrBuilder.java @@ -0,0 +1,247 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface ListVersionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.ListVersionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent which owns this collection of API versions i.e., the
+   * API resource Format: `projects/{project}/locations/{location}/apis/{api}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent which owns this collection of API versions i.e., the
+   * API resource Format: `projects/{project}/locations/{location}/apis/{api}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. An expression that filters the list of Versions.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string, a
+   * number, or a boolean. The comparison operator must be one of: `<`, `>` or
+   * `=`. Filters are not case sensitive.
+   *
+   * The following fields in the `Version` are eligible for filtering:
+   *
+   *   * `display_name` - The display name of the Version. Allowed
+   *   comparison operators: `=`.
+   *   * `create_time` - The time at which the Version was created. The
+   *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+   *   format. Allowed comparison operators: `>` and `<`.
+   *   * `lifecycle.enum_values.values.id` - The allowed value id of the
+   *   lifecycle attribute associated with the Version. Allowed comparison
+   *   operators: `:`.
+   *   * `lifecycle.enum_values.values.display_name` - The allowed value display
+   *   name of the lifecycle attribute associated with the Version. Allowed
+   *   comparison operators: `:`.
+   *   * `compliance.enum_values.values.id` -  The allowed value id of the
+   *   compliances attribute associated with the Version. Allowed comparison
+   *   operators: `:`.
+   *   * `compliance.enum_values.values.display_name` -  The allowed value
+   *   display name of the compliances attribute associated with the Version.
+   *   Allowed comparison operators: `:`.
+   *   * `accreditation.enum_values.values.id` - The allowed value id of the
+   *   accreditations attribute associated with the Version. Allowed
+   *   comparison operators: `:`.
+   *   * `accreditation.enum_values.values.display_name` - The allowed value
+   *   display name of the accreditations attribute associated with the Version.
+   *   Allowed comparison operators: `:`.
+   *
+   * Expressions are combined with either `AND` logic operator or `OR` logical
+   * operator but not both of them together i.e. only one of the `AND` or `OR`
+   * operator can be used throughout the filter string and both the operators
+   * cannot be used together. No other logical operators are
+   * supported. At most three filter fields are allowed in the filter
+   * string and if provided more than that then `INVALID_ARGUMENT` error is
+   * returned by the API.
+   *
+   * Here are a few examples:
+   *
+   *   * `lifecycle.enum_values.values.id: preview-id` - The filter string
+   *   specifies that the id of the allowed value associated with the lifecycle
+   *   attribute of the Version is _preview-id_.
+   *   * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` -
+   *   The filter string specifies that the display name of the allowed value
+   *   associated with the lifecycle attribute of the Version is `Preview
+   *   Display Name`.
+   *   * `lifecycle.enum_values.values.id: preview-id AND create_time <
+   *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+   *   The id of the allowed value associated with the lifecycle attribute of
+   *   the Version is _preview-id_ and it was created before _2021-08-15
+   *   14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
+   *   * `compliance.enum_values.values.id: gdpr-id OR
+   *   compliance.enum_values.values.id: pci-dss-id`
+   *   - The id of the allowed value associated with the compliance attribute is
+   *   _gdpr-id_ or _pci-dss-id_.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. An expression that filters the list of Versions.
+   *
+   * A filter expression consists of a field name, a comparison
+   * operator, and a value for filtering. The value must be a string, a
+   * number, or a boolean. The comparison operator must be one of: `<`, `>` or
+   * `=`. Filters are not case sensitive.
+   *
+   * The following fields in the `Version` are eligible for filtering:
+   *
+   *   * `display_name` - The display name of the Version. Allowed
+   *   comparison operators: `=`.
+   *   * `create_time` - The time at which the Version was created. The
+   *   value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
+   *   format. Allowed comparison operators: `>` and `<`.
+   *   * `lifecycle.enum_values.values.id` - The allowed value id of the
+   *   lifecycle attribute associated with the Version. Allowed comparison
+   *   operators: `:`.
+   *   * `lifecycle.enum_values.values.display_name` - The allowed value display
+   *   name of the lifecycle attribute associated with the Version. Allowed
+   *   comparison operators: `:`.
+   *   * `compliance.enum_values.values.id` -  The allowed value id of the
+   *   compliances attribute associated with the Version. Allowed comparison
+   *   operators: `:`.
+   *   * `compliance.enum_values.values.display_name` -  The allowed value
+   *   display name of the compliances attribute associated with the Version.
+   *   Allowed comparison operators: `:`.
+   *   * `accreditation.enum_values.values.id` - The allowed value id of the
+   *   accreditations attribute associated with the Version. Allowed
+   *   comparison operators: `:`.
+   *   * `accreditation.enum_values.values.display_name` - The allowed value
+   *   display name of the accreditations attribute associated with the Version.
+   *   Allowed comparison operators: `:`.
+   *
+   * Expressions are combined with either `AND` logic operator or `OR` logical
+   * operator but not both of them together i.e. only one of the `AND` or `OR`
+   * operator can be used throughout the filter string and both the operators
+   * cannot be used together. No other logical operators are
+   * supported. At most three filter fields are allowed in the filter
+   * string and if provided more than that then `INVALID_ARGUMENT` error is
+   * returned by the API.
+   *
+   * Here are a few examples:
+   *
+   *   * `lifecycle.enum_values.values.id: preview-id` - The filter string
+   *   specifies that the id of the allowed value associated with the lifecycle
+   *   attribute of the Version is _preview-id_.
+   *   * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` -
+   *   The filter string specifies that the display name of the allowed value
+   *   associated with the lifecycle attribute of the Version is `Preview
+   *   Display Name`.
+   *   * `lifecycle.enum_values.values.id: preview-id AND create_time <
+   *   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
+   *   The id of the allowed value associated with the lifecycle attribute of
+   *   the Version is _preview-id_ and it was created before _2021-08-15
+   *   14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
+   *   * `compliance.enum_values.values.id: gdpr-id OR
+   *   compliance.enum_values.values.id: pci-dss-id`
+   *   - The id of the allowed value associated with the compliance attribute is
+   *   _gdpr-id_ or _pci-dss-id_.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. The maximum number of versions to return. The service may return
+   * fewer than this value. If unspecified, at most 50 versions will be
+   * returned. The maximum value is 1000; values above 1000 will be coerced to
+   * 1000.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListVersions` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters (except page_size) provided to
+   * `ListVersions` must match the call that provided the page token.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A page token, received from a previous `ListVersions` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters (except page_size) provided to
+   * `ListVersions` must match the call that provided the page token.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListVersionsResponse.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListVersionsResponse.java new file mode 100644 index 000000000000..ec6a90aa1746 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListVersionsResponse.java @@ -0,0 +1,1126 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [ListVersions][google.cloud.apihub.v1.ApiHub.ListVersions] method's
+ * response.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListVersionsResponse} + */ +public final class ListVersionsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.ListVersionsResponse) + ListVersionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListVersionsResponse.newBuilder() to construct. + private ListVersionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListVersionsResponse() { + versions_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListVersionsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListVersionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListVersionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListVersionsResponse.class, + com.google.cloud.apihub.v1.ListVersionsResponse.Builder.class); + } + + public static final int VERSIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List versions_; + /** + * + * + *
+   * The versions corresponding to an API.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Version versions = 1; + */ + @java.lang.Override + public java.util.List getVersionsList() { + return versions_; + } + /** + * + * + *
+   * The versions corresponding to an API.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Version versions = 1; + */ + @java.lang.Override + public java.util.List + getVersionsOrBuilderList() { + return versions_; + } + /** + * + * + *
+   * The versions corresponding to an API.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Version versions = 1; + */ + @java.lang.Override + public int getVersionsCount() { + return versions_.size(); + } + /** + * + * + *
+   * The versions corresponding to an API.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Version versions = 1; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Version getVersions(int index) { + return versions_.get(index); + } + /** + * + * + *
+   * The versions corresponding to an API.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Version versions = 1; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.VersionOrBuilder getVersionsOrBuilder(int index) { + return versions_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * 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 < versions_.size(); i++) { + output.writeMessage(1, versions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < versions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, versions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().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.apihub.v1.ListVersionsResponse)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.ListVersionsResponse other = + (com.google.cloud.apihub.v1.ListVersionsResponse) obj; + + if (!getVersionsList().equals(other.getVersionsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getVersionsCount() > 0) { + hash = (37 * hash) + VERSIONS_FIELD_NUMBER; + hash = (53 * hash) + getVersionsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.ListVersionsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListVersionsResponse 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.apihub.v1.ListVersionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListVersionsResponse 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.apihub.v1.ListVersionsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.ListVersionsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.ListVersionsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListVersionsResponse 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.apihub.v1.ListVersionsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListVersionsResponse 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.apihub.v1.ListVersionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.ListVersionsResponse 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.apihub.v1.ListVersionsResponse 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 [ListVersions][google.cloud.apihub.v1.ApiHub.ListVersions] method's
+   * response.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.ListVersionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.ListVersionsResponse) + com.google.cloud.apihub.v1.ListVersionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListVersionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListVersionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.ListVersionsResponse.class, + com.google.cloud.apihub.v1.ListVersionsResponse.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.ListVersionsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (versionsBuilder_ == null) { + versions_ = java.util.Collections.emptyList(); + } else { + versions_ = null; + versionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_ListVersionsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListVersionsResponse getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.ListVersionsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListVersionsResponse build() { + com.google.cloud.apihub.v1.ListVersionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.ListVersionsResponse buildPartial() { + com.google.cloud.apihub.v1.ListVersionsResponse result = + new com.google.cloud.apihub.v1.ListVersionsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.apihub.v1.ListVersionsResponse result) { + if (versionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + versions_ = java.util.Collections.unmodifiableList(versions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.versions_ = versions_; + } else { + result.versions_ = versionsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.apihub.v1.ListVersionsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.apihub.v1.ListVersionsResponse) { + return mergeFrom((com.google.cloud.apihub.v1.ListVersionsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.ListVersionsResponse other) { + if (other == com.google.cloud.apihub.v1.ListVersionsResponse.getDefaultInstance()) + return this; + if (versionsBuilder_ == null) { + if (!other.versions_.isEmpty()) { + if (versions_.isEmpty()) { + versions_ = other.versions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureVersionsIsMutable(); + versions_.addAll(other.versions_); + } + onChanged(); + } + } else { + if (!other.versions_.isEmpty()) { + if (versionsBuilder_.isEmpty()) { + versionsBuilder_.dispose(); + versionsBuilder_ = null; + versions_ = other.versions_; + bitField0_ = (bitField0_ & ~0x00000001); + versionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getVersionsFieldBuilder() + : null; + } else { + versionsBuilder_.addAllMessages(other.versions_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.apihub.v1.Version m = + input.readMessage( + com.google.cloud.apihub.v1.Version.parser(), extensionRegistry); + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + versions_.add(m); + } else { + versionsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List versions_ = + java.util.Collections.emptyList(); + + private void ensureVersionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + versions_ = new java.util.ArrayList(versions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.Version, + com.google.cloud.apihub.v1.Version.Builder, + com.google.cloud.apihub.v1.VersionOrBuilder> + versionsBuilder_; + + /** + * + * + *
+     * The versions corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Version versions = 1; + */ + public java.util.List getVersionsList() { + if (versionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(versions_); + } else { + return versionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The versions corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Version versions = 1; + */ + public int getVersionsCount() { + if (versionsBuilder_ == null) { + return versions_.size(); + } else { + return versionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The versions corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Version versions = 1; + */ + public com.google.cloud.apihub.v1.Version getVersions(int index) { + if (versionsBuilder_ == null) { + return versions_.get(index); + } else { + return versionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The versions corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Version versions = 1; + */ + public Builder setVersions(int index, com.google.cloud.apihub.v1.Version value) { + if (versionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVersionsIsMutable(); + versions_.set(index, value); + onChanged(); + } else { + versionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The versions corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Version versions = 1; + */ + public Builder setVersions( + int index, com.google.cloud.apihub.v1.Version.Builder builderForValue) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + versions_.set(index, builderForValue.build()); + onChanged(); + } else { + versionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The versions corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Version versions = 1; + */ + public Builder addVersions(com.google.cloud.apihub.v1.Version value) { + if (versionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVersionsIsMutable(); + versions_.add(value); + onChanged(); + } else { + versionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The versions corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Version versions = 1; + */ + public Builder addVersions(int index, com.google.cloud.apihub.v1.Version value) { + if (versionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVersionsIsMutable(); + versions_.add(index, value); + onChanged(); + } else { + versionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The versions corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Version versions = 1; + */ + public Builder addVersions(com.google.cloud.apihub.v1.Version.Builder builderForValue) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + versions_.add(builderForValue.build()); + onChanged(); + } else { + versionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The versions corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Version versions = 1; + */ + public Builder addVersions( + int index, com.google.cloud.apihub.v1.Version.Builder builderForValue) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + versions_.add(index, builderForValue.build()); + onChanged(); + } else { + versionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The versions corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Version versions = 1; + */ + public Builder addAllVersions( + java.lang.Iterable values) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, versions_); + onChanged(); + } else { + versionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The versions corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Version versions = 1; + */ + public Builder clearVersions() { + if (versionsBuilder_ == null) { + versions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + versionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The versions corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Version versions = 1; + */ + public Builder removeVersions(int index) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + versions_.remove(index); + onChanged(); + } else { + versionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The versions corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Version versions = 1; + */ + public com.google.cloud.apihub.v1.Version.Builder getVersionsBuilder(int index) { + return getVersionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The versions corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Version versions = 1; + */ + public com.google.cloud.apihub.v1.VersionOrBuilder getVersionsOrBuilder(int index) { + if (versionsBuilder_ == null) { + return versions_.get(index); + } else { + return versionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The versions corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Version versions = 1; + */ + public java.util.List + getVersionsOrBuilderList() { + if (versionsBuilder_ != null) { + return versionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(versions_); + } + } + /** + * + * + *
+     * The versions corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Version versions = 1; + */ + public com.google.cloud.apihub.v1.Version.Builder addVersionsBuilder() { + return getVersionsFieldBuilder() + .addBuilder(com.google.cloud.apihub.v1.Version.getDefaultInstance()); + } + /** + * + * + *
+     * The versions corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Version versions = 1; + */ + public com.google.cloud.apihub.v1.Version.Builder addVersionsBuilder(int index) { + return getVersionsFieldBuilder() + .addBuilder(index, com.google.cloud.apihub.v1.Version.getDefaultInstance()); + } + /** + * + * + *
+     * The versions corresponding to an API.
+     * 
+ * + * repeated .google.cloud.apihub.v1.Version versions = 1; + */ + public java.util.List getVersionsBuilderList() { + return getVersionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.Version, + com.google.cloud.apihub.v1.Version.Builder, + com.google.cloud.apihub.v1.VersionOrBuilder> + getVersionsFieldBuilder() { + if (versionsBuilder_ == null) { + versionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.Version, + com.google.cloud.apihub.v1.Version.Builder, + com.google.cloud.apihub.v1.VersionOrBuilder>( + versions_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + versions_ = null; + } + return versionsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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 token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + 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.apihub.v1.ListVersionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.ListVersionsResponse) + private static final com.google.cloud.apihub.v1.ListVersionsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.ListVersionsResponse(); + } + + public static com.google.cloud.apihub.v1.ListVersionsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListVersionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.ListVersionsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListVersionsResponseOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListVersionsResponseOrBuilder.java new file mode 100644 index 000000000000..59a63e404957 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ListVersionsResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface ListVersionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.ListVersionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The versions corresponding to an API.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Version versions = 1; + */ + java.util.List getVersionsList(); + /** + * + * + *
+   * The versions corresponding to an API.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Version versions = 1; + */ + com.google.cloud.apihub.v1.Version getVersions(int index); + /** + * + * + *
+   * The versions corresponding to an API.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Version versions = 1; + */ + int getVersionsCount(); + /** + * + * + *
+   * The versions corresponding to an API.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Version versions = 1; + */ + java.util.List getVersionsOrBuilderList(); + /** + * + * + *
+   * The versions corresponding to an API.
+   * 
+ * + * repeated .google.cloud.apihub.v1.Version versions = 1; + */ + com.google.cloud.apihub.v1.VersionOrBuilder getVersionsOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LocationName.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LocationName.java new file mode 100644 index 000000000000..4019c6e9b54a --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +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 LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + 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 (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.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); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupApiHubInstanceRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupApiHubInstanceRequest.java new file mode 100644 index 000000000000..adc7f0be2074 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupApiHubInstanceRequest.java @@ -0,0 +1,665 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/provisioning_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The
+ * [LookupApiHubInstance][google.cloud.apihub.v1.Provisioning.LookupApiHubInstance]
+ * method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.LookupApiHubInstanceRequest} + */ +public final class LookupApiHubInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.LookupApiHubInstanceRequest) + LookupApiHubInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use LookupApiHubInstanceRequest.newBuilder() to construct. + private LookupApiHubInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LookupApiHubInstanceRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LookupApiHubInstanceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ProvisioningServiceProto + .internal_static_google_cloud_apihub_v1_LookupApiHubInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ProvisioningServiceProto + .internal_static_google_cloud_apihub_v1_LookupApiHubInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.LookupApiHubInstanceRequest.class, + com.google.cloud.apihub.v1.LookupApiHubInstanceRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. There will always be only one Api Hub instance for a GCP project
+   * across all locations.
+   * The parent resource for the Api Hub instance resource.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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. There will always be only one Api Hub instance for a GCP project
+   * across all locations.
+   * The parent resource for the Api Hub instance resource.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * 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; + } + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + size += getUnknownFields().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.apihub.v1.LookupApiHubInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.LookupApiHubInstanceRequest other = + (com.google.cloud.apihub.v1.LookupApiHubInstanceRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.LookupApiHubInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.LookupApiHubInstanceRequest 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.apihub.v1.LookupApiHubInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.LookupApiHubInstanceRequest 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.apihub.v1.LookupApiHubInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.LookupApiHubInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.LookupApiHubInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.LookupApiHubInstanceRequest 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.apihub.v1.LookupApiHubInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.LookupApiHubInstanceRequest 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.apihub.v1.LookupApiHubInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.LookupApiHubInstanceRequest 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.apihub.v1.LookupApiHubInstanceRequest 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
+   * [LookupApiHubInstance][google.cloud.apihub.v1.Provisioning.LookupApiHubInstance]
+   * method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.LookupApiHubInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.LookupApiHubInstanceRequest) + com.google.cloud.apihub.v1.LookupApiHubInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ProvisioningServiceProto + .internal_static_google_cloud_apihub_v1_LookupApiHubInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ProvisioningServiceProto + .internal_static_google_cloud_apihub_v1_LookupApiHubInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.LookupApiHubInstanceRequest.class, + com.google.cloud.apihub.v1.LookupApiHubInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.LookupApiHubInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ProvisioningServiceProto + .internal_static_google_cloud_apihub_v1_LookupApiHubInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.LookupApiHubInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.LookupApiHubInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.LookupApiHubInstanceRequest build() { + com.google.cloud.apihub.v1.LookupApiHubInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.LookupApiHubInstanceRequest buildPartial() { + com.google.cloud.apihub.v1.LookupApiHubInstanceRequest result = + new com.google.cloud.apihub.v1.LookupApiHubInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.LookupApiHubInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + } + + @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.apihub.v1.LookupApiHubInstanceRequest) { + return mergeFrom((com.google.cloud.apihub.v1.LookupApiHubInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.LookupApiHubInstanceRequest other) { + if (other == com.google.cloud.apihub.v1.LookupApiHubInstanceRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. There will always be only one Api Hub instance for a GCP project
+     * across all locations.
+     * The parent resource for the Api Hub instance resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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. There will always be only one Api Hub instance for a GCP project
+     * across all locations.
+     * The parent resource for the Api Hub instance resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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. There will always be only one Api Hub instance for a GCP project
+     * across all locations.
+     * The parent resource for the Api Hub instance resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. There will always be only one Api Hub instance for a GCP project
+     * across all locations.
+     * The parent resource for the Api Hub instance resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. There will always be only one Api Hub instance for a GCP project
+     * across all locations.
+     * The parent resource for the Api Hub instance resource.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.apihub.v1.LookupApiHubInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.LookupApiHubInstanceRequest) + private static final com.google.cloud.apihub.v1.LookupApiHubInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.LookupApiHubInstanceRequest(); + } + + public static com.google.cloud.apihub.v1.LookupApiHubInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LookupApiHubInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.LookupApiHubInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupApiHubInstanceRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupApiHubInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..a6165be4bbe7 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupApiHubInstanceRequestOrBuilder.java @@ -0,0 +1,61 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/provisioning_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface LookupApiHubInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.LookupApiHubInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. There will always be only one Api Hub instance for a GCP project
+   * across all locations.
+   * The parent resource for the Api Hub instance resource.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. There will always be only one Api Hub instance for a GCP project
+   * across all locations.
+   * The parent resource for the Api Hub instance resource.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupApiHubInstanceResponse.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupApiHubInstanceResponse.java new file mode 100644 index 000000000000..00bb49e0f8a0 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupApiHubInstanceResponse.java @@ -0,0 +1,728 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/provisioning_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The
+ * [LookupApiHubInstance][google.cloud.apihub.v1.Provisioning.LookupApiHubInstance]
+ * method's response.`
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.LookupApiHubInstanceResponse} + */ +public final class LookupApiHubInstanceResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.LookupApiHubInstanceResponse) + LookupApiHubInstanceResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use LookupApiHubInstanceResponse.newBuilder() to construct. + private LookupApiHubInstanceResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LookupApiHubInstanceResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LookupApiHubInstanceResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ProvisioningServiceProto + .internal_static_google_cloud_apihub_v1_LookupApiHubInstanceResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ProvisioningServiceProto + .internal_static_google_cloud_apihub_v1_LookupApiHubInstanceResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.LookupApiHubInstanceResponse.class, + com.google.cloud.apihub.v1.LookupApiHubInstanceResponse.Builder.class); + } + + private int bitField0_; + public static final int API_HUB_INSTANCE_FIELD_NUMBER = 1; + private com.google.cloud.apihub.v1.ApiHubInstance apiHubInstance_; + /** + * + * + *
+   * API Hub instance for a project if it exists, empty otherwise.
+   * 
+ * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 1; + * + * @return Whether the apiHubInstance field is set. + */ + @java.lang.Override + public boolean hasApiHubInstance() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * API Hub instance for a project if it exists, empty otherwise.
+   * 
+ * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 1; + * + * @return The apiHubInstance. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.ApiHubInstance getApiHubInstance() { + return apiHubInstance_ == null + ? com.google.cloud.apihub.v1.ApiHubInstance.getDefaultInstance() + : apiHubInstance_; + } + /** + * + * + *
+   * API Hub instance for a project if it exists, empty otherwise.
+   * 
+ * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 1; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.ApiHubInstanceOrBuilder getApiHubInstanceOrBuilder() { + return apiHubInstance_ == null + ? com.google.cloud.apihub.v1.ApiHubInstance.getDefaultInstance() + : apiHubInstance_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getApiHubInstance()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getApiHubInstance()); + } + size += getUnknownFields().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.apihub.v1.LookupApiHubInstanceResponse)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.LookupApiHubInstanceResponse other = + (com.google.cloud.apihub.v1.LookupApiHubInstanceResponse) obj; + + if (hasApiHubInstance() != other.hasApiHubInstance()) return false; + if (hasApiHubInstance()) { + if (!getApiHubInstance().equals(other.getApiHubInstance())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasApiHubInstance()) { + hash = (37 * hash) + API_HUB_INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getApiHubInstance().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.LookupApiHubInstanceResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.LookupApiHubInstanceResponse 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.apihub.v1.LookupApiHubInstanceResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.LookupApiHubInstanceResponse 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.apihub.v1.LookupApiHubInstanceResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.LookupApiHubInstanceResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.LookupApiHubInstanceResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.LookupApiHubInstanceResponse 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.apihub.v1.LookupApiHubInstanceResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.LookupApiHubInstanceResponse 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.apihub.v1.LookupApiHubInstanceResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.LookupApiHubInstanceResponse 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.apihub.v1.LookupApiHubInstanceResponse 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
+   * [LookupApiHubInstance][google.cloud.apihub.v1.Provisioning.LookupApiHubInstance]
+   * method's response.`
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.LookupApiHubInstanceResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.LookupApiHubInstanceResponse) + com.google.cloud.apihub.v1.LookupApiHubInstanceResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ProvisioningServiceProto + .internal_static_google_cloud_apihub_v1_LookupApiHubInstanceResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ProvisioningServiceProto + .internal_static_google_cloud_apihub_v1_LookupApiHubInstanceResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.LookupApiHubInstanceResponse.class, + com.google.cloud.apihub.v1.LookupApiHubInstanceResponse.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.LookupApiHubInstanceResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getApiHubInstanceFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + apiHubInstance_ = null; + if (apiHubInstanceBuilder_ != null) { + apiHubInstanceBuilder_.dispose(); + apiHubInstanceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ProvisioningServiceProto + .internal_static_google_cloud_apihub_v1_LookupApiHubInstanceResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.LookupApiHubInstanceResponse getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.LookupApiHubInstanceResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.LookupApiHubInstanceResponse build() { + com.google.cloud.apihub.v1.LookupApiHubInstanceResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.LookupApiHubInstanceResponse buildPartial() { + com.google.cloud.apihub.v1.LookupApiHubInstanceResponse result = + new com.google.cloud.apihub.v1.LookupApiHubInstanceResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.LookupApiHubInstanceResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.apiHubInstance_ = + apiHubInstanceBuilder_ == null ? apiHubInstance_ : apiHubInstanceBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.LookupApiHubInstanceResponse) { + return mergeFrom((com.google.cloud.apihub.v1.LookupApiHubInstanceResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.LookupApiHubInstanceResponse other) { + if (other == com.google.cloud.apihub.v1.LookupApiHubInstanceResponse.getDefaultInstance()) + return this; + if (other.hasApiHubInstance()) { + mergeApiHubInstance(other.getApiHubInstance()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getApiHubInstanceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.apihub.v1.ApiHubInstance apiHubInstance_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.ApiHubInstance, + com.google.cloud.apihub.v1.ApiHubInstance.Builder, + com.google.cloud.apihub.v1.ApiHubInstanceOrBuilder> + apiHubInstanceBuilder_; + /** + * + * + *
+     * API Hub instance for a project if it exists, empty otherwise.
+     * 
+ * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 1; + * + * @return Whether the apiHubInstance field is set. + */ + public boolean hasApiHubInstance() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * API Hub instance for a project if it exists, empty otherwise.
+     * 
+ * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 1; + * + * @return The apiHubInstance. + */ + public com.google.cloud.apihub.v1.ApiHubInstance getApiHubInstance() { + if (apiHubInstanceBuilder_ == null) { + return apiHubInstance_ == null + ? com.google.cloud.apihub.v1.ApiHubInstance.getDefaultInstance() + : apiHubInstance_; + } else { + return apiHubInstanceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * API Hub instance for a project if it exists, empty otherwise.
+     * 
+ * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 1; + */ + public Builder setApiHubInstance(com.google.cloud.apihub.v1.ApiHubInstance value) { + if (apiHubInstanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + apiHubInstance_ = value; + } else { + apiHubInstanceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * API Hub instance for a project if it exists, empty otherwise.
+     * 
+ * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 1; + */ + public Builder setApiHubInstance( + com.google.cloud.apihub.v1.ApiHubInstance.Builder builderForValue) { + if (apiHubInstanceBuilder_ == null) { + apiHubInstance_ = builderForValue.build(); + } else { + apiHubInstanceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * API Hub instance for a project if it exists, empty otherwise.
+     * 
+ * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 1; + */ + public Builder mergeApiHubInstance(com.google.cloud.apihub.v1.ApiHubInstance value) { + if (apiHubInstanceBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && apiHubInstance_ != null + && apiHubInstance_ != com.google.cloud.apihub.v1.ApiHubInstance.getDefaultInstance()) { + getApiHubInstanceBuilder().mergeFrom(value); + } else { + apiHubInstance_ = value; + } + } else { + apiHubInstanceBuilder_.mergeFrom(value); + } + if (apiHubInstance_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * API Hub instance for a project if it exists, empty otherwise.
+     * 
+ * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 1; + */ + public Builder clearApiHubInstance() { + bitField0_ = (bitField0_ & ~0x00000001); + apiHubInstance_ = null; + if (apiHubInstanceBuilder_ != null) { + apiHubInstanceBuilder_.dispose(); + apiHubInstanceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * API Hub instance for a project if it exists, empty otherwise.
+     * 
+ * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 1; + */ + public com.google.cloud.apihub.v1.ApiHubInstance.Builder getApiHubInstanceBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getApiHubInstanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * API Hub instance for a project if it exists, empty otherwise.
+     * 
+ * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 1; + */ + public com.google.cloud.apihub.v1.ApiHubInstanceOrBuilder getApiHubInstanceOrBuilder() { + if (apiHubInstanceBuilder_ != null) { + return apiHubInstanceBuilder_.getMessageOrBuilder(); + } else { + return apiHubInstance_ == null + ? com.google.cloud.apihub.v1.ApiHubInstance.getDefaultInstance() + : apiHubInstance_; + } + } + /** + * + * + *
+     * API Hub instance for a project if it exists, empty otherwise.
+     * 
+ * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.ApiHubInstance, + com.google.cloud.apihub.v1.ApiHubInstance.Builder, + com.google.cloud.apihub.v1.ApiHubInstanceOrBuilder> + getApiHubInstanceFieldBuilder() { + if (apiHubInstanceBuilder_ == null) { + apiHubInstanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.ApiHubInstance, + com.google.cloud.apihub.v1.ApiHubInstance.Builder, + com.google.cloud.apihub.v1.ApiHubInstanceOrBuilder>( + getApiHubInstance(), getParentForChildren(), isClean()); + apiHubInstance_ = null; + } + return apiHubInstanceBuilder_; + } + + @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.apihub.v1.LookupApiHubInstanceResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.LookupApiHubInstanceResponse) + private static final com.google.cloud.apihub.v1.LookupApiHubInstanceResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.LookupApiHubInstanceResponse(); + } + + public static com.google.cloud.apihub.v1.LookupApiHubInstanceResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LookupApiHubInstanceResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.LookupApiHubInstanceResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupApiHubInstanceResponseOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupApiHubInstanceResponseOrBuilder.java new file mode 100644 index 000000000000..50c680523646 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupApiHubInstanceResponseOrBuilder.java @@ -0,0 +1,61 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/provisioning_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface LookupApiHubInstanceResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.LookupApiHubInstanceResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * API Hub instance for a project if it exists, empty otherwise.
+   * 
+ * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 1; + * + * @return Whether the apiHubInstance field is set. + */ + boolean hasApiHubInstance(); + /** + * + * + *
+   * API Hub instance for a project if it exists, empty otherwise.
+   * 
+ * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 1; + * + * @return The apiHubInstance. + */ + com.google.cloud.apihub.v1.ApiHubInstance getApiHubInstance(); + /** + * + * + *
+   * API Hub instance for a project if it exists, empty otherwise.
+   * 
+ * + * .google.cloud.apihub.v1.ApiHubInstance api_hub_instance = 1; + */ + com.google.cloud.apihub.v1.ApiHubInstanceOrBuilder getApiHubInstanceOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupRuntimeProjectAttachmentRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupRuntimeProjectAttachmentRequest.java new file mode 100644 index 000000000000..b47b532d7435 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupRuntimeProjectAttachmentRequest.java @@ -0,0 +1,667 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/runtime_project_attachment_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The
+ * [LookupRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.LookupRuntimeProjectAttachment]
+ * method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest} + */ +public final class LookupRuntimeProjectAttachmentRequest + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest) + LookupRuntimeProjectAttachmentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use LookupRuntimeProjectAttachmentRequest.newBuilder() to construct. + private LookupRuntimeProjectAttachmentRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LookupRuntimeProjectAttachmentRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LookupRuntimeProjectAttachmentRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_LookupRuntimeProjectAttachmentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_LookupRuntimeProjectAttachmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest.class, + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Runtime project ID to look up runtime project attachment for.
+   * Lookup happens across all regions. Expected format:
+   * `projects/{project}/locations/{location}`.
+   * 
+ * + * + * 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. Runtime project ID to look up runtime project attachment for.
+   * Lookup happens across all regions. Expected format:
+   * `projects/{project}/locations/{location}`.
+   * 
+ * + * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.apihub.v1.LookupRuntimeProjectAttachmentRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest other = + (com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest 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.apihub.v1.LookupRuntimeProjectAttachmentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest 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.apihub.v1.LookupRuntimeProjectAttachmentRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest 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.apihub.v1.LookupRuntimeProjectAttachmentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest 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.apihub.v1.LookupRuntimeProjectAttachmentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest 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.apihub.v1.LookupRuntimeProjectAttachmentRequest 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
+   * [LookupRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.LookupRuntimeProjectAttachment]
+   * method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest) + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_LookupRuntimeProjectAttachmentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_LookupRuntimeProjectAttachmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest.class, + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_LookupRuntimeProjectAttachmentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest + getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest build() { + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest buildPartial() { + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest result = + new com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.apihub.v1.LookupRuntimeProjectAttachmentRequest) { + return mergeFrom((com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest other) { + if (other + == com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Runtime project ID to look up runtime project attachment for.
+     * Lookup happens across all regions. Expected format:
+     * `projects/{project}/locations/{location}`.
+     * 
+ * + * + * 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. Runtime project ID to look up runtime project attachment for.
+     * Lookup happens across all regions. Expected format:
+     * `projects/{project}/locations/{location}`.
+     * 
+ * + * + * 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. Runtime project ID to look up runtime project attachment for.
+     * Lookup happens across all regions. Expected format:
+     * `projects/{project}/locations/{location}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Runtime project ID to look up runtime project attachment for.
+     * Lookup happens across all regions. Expected format:
+     * `projects/{project}/locations/{location}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Runtime project ID to look up runtime project attachment for.
+     * Lookup happens across all regions. Expected format:
+     * `projects/{project}/locations/{location}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.apihub.v1.LookupRuntimeProjectAttachmentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest) + private static final com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest(); + } + + public static com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LookupRuntimeProjectAttachmentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.LookupRuntimeProjectAttachmentRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupRuntimeProjectAttachmentRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupRuntimeProjectAttachmentRequestOrBuilder.java new file mode 100644 index 000000000000..5eedd80b2ae2 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupRuntimeProjectAttachmentRequestOrBuilder.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/runtime_project_attachment_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface LookupRuntimeProjectAttachmentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Runtime project ID to look up runtime project attachment for.
+   * Lookup happens across all regions. Expected format:
+   * `projects/{project}/locations/{location}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Runtime project ID to look up runtime project attachment for.
+   * Lookup happens across all regions. Expected format:
+   * `projects/{project}/locations/{location}`.
+   * 
+ * + * + * 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-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupRuntimeProjectAttachmentResponse.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupRuntimeProjectAttachmentResponse.java new file mode 100644 index 000000000000..7501a361581e --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupRuntimeProjectAttachmentResponse.java @@ -0,0 +1,750 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/runtime_project_attachment_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The
+ * [ListRuntimeProjectAttachments][google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments]
+ * method's response.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse} + */ +public final class LookupRuntimeProjectAttachmentResponse + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse) + LookupRuntimeProjectAttachmentResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use LookupRuntimeProjectAttachmentResponse.newBuilder() to construct. + private LookupRuntimeProjectAttachmentResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LookupRuntimeProjectAttachmentResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LookupRuntimeProjectAttachmentResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_LookupRuntimeProjectAttachmentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_LookupRuntimeProjectAttachmentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse.class, + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse.Builder.class); + } + + private int bitField0_; + public static final int RUNTIME_PROJECT_ATTACHMENT_FIELD_NUMBER = 1; + private com.google.cloud.apihub.v1.RuntimeProjectAttachment runtimeProjectAttachment_; + /** + * + * + *
+   * Runtime project attachment for a project if exists, empty otherwise.
+   * 
+ * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 1; + * + * @return Whether the runtimeProjectAttachment field is set. + */ + @java.lang.Override + public boolean hasRuntimeProjectAttachment() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Runtime project attachment for a project if exists, empty otherwise.
+   * 
+ * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 1; + * + * @return The runtimeProjectAttachment. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.RuntimeProjectAttachment getRuntimeProjectAttachment() { + return runtimeProjectAttachment_ == null + ? com.google.cloud.apihub.v1.RuntimeProjectAttachment.getDefaultInstance() + : runtimeProjectAttachment_; + } + /** + * + * + *
+   * Runtime project attachment for a project if exists, empty otherwise.
+   * 
+ * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 1; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.RuntimeProjectAttachmentOrBuilder + getRuntimeProjectAttachmentOrBuilder() { + return runtimeProjectAttachment_ == null + ? com.google.cloud.apihub.v1.RuntimeProjectAttachment.getDefaultInstance() + : runtimeProjectAttachment_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getRuntimeProjectAttachment()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, getRuntimeProjectAttachment()); + } + size += getUnknownFields().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.apihub.v1.LookupRuntimeProjectAttachmentResponse)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse other = + (com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse) obj; + + if (hasRuntimeProjectAttachment() != other.hasRuntimeProjectAttachment()) return false; + if (hasRuntimeProjectAttachment()) { + if (!getRuntimeProjectAttachment().equals(other.getRuntimeProjectAttachment())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasRuntimeProjectAttachment()) { + hash = (37 * hash) + RUNTIME_PROJECT_ATTACHMENT_FIELD_NUMBER; + hash = (53 * hash) + getRuntimeProjectAttachment().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse 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.apihub.v1.LookupRuntimeProjectAttachmentResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse 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.apihub.v1.LookupRuntimeProjectAttachmentResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse 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.apihub.v1.LookupRuntimeProjectAttachmentResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse + 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.apihub.v1.LookupRuntimeProjectAttachmentResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse 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.apihub.v1.LookupRuntimeProjectAttachmentResponse 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
+   * [ListRuntimeProjectAttachments][google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments]
+   * method's response.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse) + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_LookupRuntimeProjectAttachmentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_LookupRuntimeProjectAttachmentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse.class, + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse.Builder.class); + } + + // Construct using + // com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRuntimeProjectAttachmentFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + runtimeProjectAttachment_ = null; + if (runtimeProjectAttachmentBuilder_ != null) { + runtimeProjectAttachmentBuilder_.dispose(); + runtimeProjectAttachmentBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_LookupRuntimeProjectAttachmentResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse + getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse build() { + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse buildPartial() { + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse result = + new com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.runtimeProjectAttachment_ = + runtimeProjectAttachmentBuilder_ == null + ? runtimeProjectAttachment_ + : runtimeProjectAttachmentBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.LookupRuntimeProjectAttachmentResponse) { + return mergeFrom((com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse other) { + if (other + == com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse.getDefaultInstance()) + return this; + if (other.hasRuntimeProjectAttachment()) { + mergeRuntimeProjectAttachment(other.getRuntimeProjectAttachment()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getRuntimeProjectAttachmentFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.apihub.v1.RuntimeProjectAttachment runtimeProjectAttachment_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.RuntimeProjectAttachment, + com.google.cloud.apihub.v1.RuntimeProjectAttachment.Builder, + com.google.cloud.apihub.v1.RuntimeProjectAttachmentOrBuilder> + runtimeProjectAttachmentBuilder_; + /** + * + * + *
+     * Runtime project attachment for a project if exists, empty otherwise.
+     * 
+ * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 1; + * + * @return Whether the runtimeProjectAttachment field is set. + */ + public boolean hasRuntimeProjectAttachment() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Runtime project attachment for a project if exists, empty otherwise.
+     * 
+ * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 1; + * + * @return The runtimeProjectAttachment. + */ + public com.google.cloud.apihub.v1.RuntimeProjectAttachment getRuntimeProjectAttachment() { + if (runtimeProjectAttachmentBuilder_ == null) { + return runtimeProjectAttachment_ == null + ? com.google.cloud.apihub.v1.RuntimeProjectAttachment.getDefaultInstance() + : runtimeProjectAttachment_; + } else { + return runtimeProjectAttachmentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Runtime project attachment for a project if exists, empty otherwise.
+     * 
+ * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 1; + */ + public Builder setRuntimeProjectAttachment( + com.google.cloud.apihub.v1.RuntimeProjectAttachment value) { + if (runtimeProjectAttachmentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + runtimeProjectAttachment_ = value; + } else { + runtimeProjectAttachmentBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Runtime project attachment for a project if exists, empty otherwise.
+     * 
+ * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 1; + */ + public Builder setRuntimeProjectAttachment( + com.google.cloud.apihub.v1.RuntimeProjectAttachment.Builder builderForValue) { + if (runtimeProjectAttachmentBuilder_ == null) { + runtimeProjectAttachment_ = builderForValue.build(); + } else { + runtimeProjectAttachmentBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Runtime project attachment for a project if exists, empty otherwise.
+     * 
+ * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 1; + */ + public Builder mergeRuntimeProjectAttachment( + com.google.cloud.apihub.v1.RuntimeProjectAttachment value) { + if (runtimeProjectAttachmentBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && runtimeProjectAttachment_ != null + && runtimeProjectAttachment_ + != com.google.cloud.apihub.v1.RuntimeProjectAttachment.getDefaultInstance()) { + getRuntimeProjectAttachmentBuilder().mergeFrom(value); + } else { + runtimeProjectAttachment_ = value; + } + } else { + runtimeProjectAttachmentBuilder_.mergeFrom(value); + } + if (runtimeProjectAttachment_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Runtime project attachment for a project if exists, empty otherwise.
+     * 
+ * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 1; + */ + public Builder clearRuntimeProjectAttachment() { + bitField0_ = (bitField0_ & ~0x00000001); + runtimeProjectAttachment_ = null; + if (runtimeProjectAttachmentBuilder_ != null) { + runtimeProjectAttachmentBuilder_.dispose(); + runtimeProjectAttachmentBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Runtime project attachment for a project if exists, empty otherwise.
+     * 
+ * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 1; + */ + public com.google.cloud.apihub.v1.RuntimeProjectAttachment.Builder + getRuntimeProjectAttachmentBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getRuntimeProjectAttachmentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Runtime project attachment for a project if exists, empty otherwise.
+     * 
+ * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 1; + */ + public com.google.cloud.apihub.v1.RuntimeProjectAttachmentOrBuilder + getRuntimeProjectAttachmentOrBuilder() { + if (runtimeProjectAttachmentBuilder_ != null) { + return runtimeProjectAttachmentBuilder_.getMessageOrBuilder(); + } else { + return runtimeProjectAttachment_ == null + ? com.google.cloud.apihub.v1.RuntimeProjectAttachment.getDefaultInstance() + : runtimeProjectAttachment_; + } + } + /** + * + * + *
+     * Runtime project attachment for a project if exists, empty otherwise.
+     * 
+ * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.RuntimeProjectAttachment, + com.google.cloud.apihub.v1.RuntimeProjectAttachment.Builder, + com.google.cloud.apihub.v1.RuntimeProjectAttachmentOrBuilder> + getRuntimeProjectAttachmentFieldBuilder() { + if (runtimeProjectAttachmentBuilder_ == null) { + runtimeProjectAttachmentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.RuntimeProjectAttachment, + com.google.cloud.apihub.v1.RuntimeProjectAttachment.Builder, + com.google.cloud.apihub.v1.RuntimeProjectAttachmentOrBuilder>( + getRuntimeProjectAttachment(), getParentForChildren(), isClean()); + runtimeProjectAttachment_ = null; + } + return runtimeProjectAttachmentBuilder_; + } + + @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.apihub.v1.LookupRuntimeProjectAttachmentResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse) + private static final com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse(); + } + + public static com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LookupRuntimeProjectAttachmentResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.LookupRuntimeProjectAttachmentResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupRuntimeProjectAttachmentResponseOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupRuntimeProjectAttachmentResponseOrBuilder.java new file mode 100644 index 000000000000..15ff711a81a8 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/LookupRuntimeProjectAttachmentResponseOrBuilder.java @@ -0,0 +1,62 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/runtime_project_attachment_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface LookupRuntimeProjectAttachmentResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Runtime project attachment for a project if exists, empty otherwise.
+   * 
+ * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 1; + * + * @return Whether the runtimeProjectAttachment field is set. + */ + boolean hasRuntimeProjectAttachment(); + /** + * + * + *
+   * Runtime project attachment for a project if exists, empty otherwise.
+   * 
+ * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 1; + * + * @return The runtimeProjectAttachment. + */ + com.google.cloud.apihub.v1.RuntimeProjectAttachment getRuntimeProjectAttachment(); + /** + * + * + *
+   * Runtime project attachment for a project if exists, empty otherwise.
+   * 
+ * + * .google.cloud.apihub.v1.RuntimeProjectAttachment runtime_project_attachment = 1; + */ + com.google.cloud.apihub.v1.RuntimeProjectAttachmentOrBuilder + getRuntimeProjectAttachmentOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/OpenApiSpecDetails.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/OpenApiSpecDetails.java new file mode 100644 index 000000000000..4951066dd1e8 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/OpenApiSpecDetails.java @@ -0,0 +1,1277 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * OpenApiSpecDetails contains the details parsed from an OpenAPI spec in
+ * addition to the fields mentioned in
+ * [SpecDetails][google.cloud.apihub.v1.SpecDetails].
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.OpenApiSpecDetails} + */ +public final class OpenApiSpecDetails extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.OpenApiSpecDetails) + OpenApiSpecDetailsOrBuilder { + private static final long serialVersionUID = 0L; + // Use OpenApiSpecDetails.newBuilder() to construct. + private OpenApiSpecDetails(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OpenApiSpecDetails() { + format_ = 0; + version_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OpenApiSpecDetails(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_OpenApiSpecDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_OpenApiSpecDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.OpenApiSpecDetails.class, + com.google.cloud.apihub.v1.OpenApiSpecDetails.Builder.class); + } + + /** + * + * + *
+   * Enumeration of spec formats.
+   * 
+ * + * Protobuf enum {@code google.cloud.apihub.v1.OpenApiSpecDetails.Format} + */ + public enum Format implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * SpecFile type unspecified.
+     * 
+ * + * FORMAT_UNSPECIFIED = 0; + */ + FORMAT_UNSPECIFIED(0), + /** + * + * + *
+     * OpenAPI Spec v2.0.
+     * 
+ * + * OPEN_API_SPEC_2_0 = 1; + */ + OPEN_API_SPEC_2_0(1), + /** + * + * + *
+     * OpenAPI Spec v3.0.
+     * 
+ * + * OPEN_API_SPEC_3_0 = 2; + */ + OPEN_API_SPEC_3_0(2), + /** + * + * + *
+     * OpenAPI Spec v3.1.
+     * 
+ * + * OPEN_API_SPEC_3_1 = 3; + */ + OPEN_API_SPEC_3_1(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * SpecFile type unspecified.
+     * 
+ * + * FORMAT_UNSPECIFIED = 0; + */ + public static final int FORMAT_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * OpenAPI Spec v2.0.
+     * 
+ * + * OPEN_API_SPEC_2_0 = 1; + */ + public static final int OPEN_API_SPEC_2_0_VALUE = 1; + /** + * + * + *
+     * OpenAPI Spec v3.0.
+     * 
+ * + * OPEN_API_SPEC_3_0 = 2; + */ + public static final int OPEN_API_SPEC_3_0_VALUE = 2; + /** + * + * + *
+     * OpenAPI Spec v3.1.
+     * 
+ * + * OPEN_API_SPEC_3_1 = 3; + */ + public static final int OPEN_API_SPEC_3_1_VALUE = 3; + + 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 Format 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 Format forNumber(int value) { + switch (value) { + case 0: + return FORMAT_UNSPECIFIED; + case 1: + return OPEN_API_SPEC_2_0; + case 2: + return OPEN_API_SPEC_3_0; + case 3: + return OPEN_API_SPEC_3_1; + 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 Format findValueByNumber(int number) { + return Format.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.apihub.v1.OpenApiSpecDetails.getDescriptor().getEnumTypes().get(0); + } + + private static final Format[] VALUES = values(); + + public static Format 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 Format(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.apihub.v1.OpenApiSpecDetails.Format) + } + + private int bitField0_; + public static final int FORMAT_FIELD_NUMBER = 1; + private int format_ = 0; + /** + * + * + *
+   * Output only. The format of the spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.OpenApiSpecDetails.Format format = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for format. + */ + @java.lang.Override + public int getFormatValue() { + return format_; + } + /** + * + * + *
+   * Output only. The format of the spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.OpenApiSpecDetails.Format format = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The format. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.OpenApiSpecDetails.Format getFormat() { + com.google.cloud.apihub.v1.OpenApiSpecDetails.Format result = + com.google.cloud.apihub.v1.OpenApiSpecDetails.Format.forNumber(format_); + return result == null + ? com.google.cloud.apihub.v1.OpenApiSpecDetails.Format.UNRECOGNIZED + : result; + } + + public static final int VERSION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object version_ = ""; + /** + * + * + *
+   * Output only. The version in the spec.
+   * This maps to `info.version` in OpenAPI spec.
+   * 
+ * + * string version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The version. + */ + @java.lang.Override + public java.lang.String getVersion() { + java.lang.Object ref = version_; + 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(); + version_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The version in the spec.
+   * This maps to `info.version` in OpenAPI spec.
+   * 
+ * + * string version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for version. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OWNER_FIELD_NUMBER = 3; + private com.google.cloud.apihub.v1.Owner owner_; + /** + * + * + *
+   * Output only. Owner details for the spec.
+   * This maps to `info.contact` in OpenAPI spec.
+   * 
+ * + * .google.cloud.apihub.v1.Owner owner = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the owner field is set. + */ + @java.lang.Override + public boolean hasOwner() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. Owner details for the spec.
+   * This maps to `info.contact` in OpenAPI spec.
+   * 
+ * + * .google.cloud.apihub.v1.Owner owner = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The owner. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Owner getOwner() { + return owner_ == null ? com.google.cloud.apihub.v1.Owner.getDefaultInstance() : owner_; + } + /** + * + * + *
+   * Output only. Owner details for the spec.
+   * This maps to `info.contact` in OpenAPI spec.
+   * 
+ * + * .google.cloud.apihub.v1.Owner owner = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.OwnerOrBuilder getOwnerOrBuilder() { + return owner_ == null ? com.google.cloud.apihub.v1.Owner.getDefaultInstance() : owner_; + } + + 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 (format_ + != com.google.cloud.apihub.v1.OpenApiSpecDetails.Format.FORMAT_UNSPECIFIED.getNumber()) { + output.writeEnum(1, format_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, version_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getOwner()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (format_ + != com.google.cloud.apihub.v1.OpenApiSpecDetails.Format.FORMAT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, format_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, version_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getOwner()); + } + size += getUnknownFields().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.apihub.v1.OpenApiSpecDetails)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.OpenApiSpecDetails other = + (com.google.cloud.apihub.v1.OpenApiSpecDetails) obj; + + if (format_ != other.format_) return false; + if (!getVersion().equals(other.getVersion())) return false; + if (hasOwner() != other.hasOwner()) return false; + if (hasOwner()) { + if (!getOwner().equals(other.getOwner())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FORMAT_FIELD_NUMBER; + hash = (53 * hash) + format_; + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + if (hasOwner()) { + hash = (37 * hash) + OWNER_FIELD_NUMBER; + hash = (53 * hash) + getOwner().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.OpenApiSpecDetails parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.OpenApiSpecDetails 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.apihub.v1.OpenApiSpecDetails parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.OpenApiSpecDetails 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.apihub.v1.OpenApiSpecDetails parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.OpenApiSpecDetails parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.OpenApiSpecDetails parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.OpenApiSpecDetails 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.apihub.v1.OpenApiSpecDetails parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.OpenApiSpecDetails 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.apihub.v1.OpenApiSpecDetails parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.OpenApiSpecDetails 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.apihub.v1.OpenApiSpecDetails 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; + } + /** + * + * + *
+   * OpenApiSpecDetails contains the details parsed from an OpenAPI spec in
+   * addition to the fields mentioned in
+   * [SpecDetails][google.cloud.apihub.v1.SpecDetails].
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.OpenApiSpecDetails} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.OpenApiSpecDetails) + com.google.cloud.apihub.v1.OpenApiSpecDetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_OpenApiSpecDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_OpenApiSpecDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.OpenApiSpecDetails.class, + com.google.cloud.apihub.v1.OpenApiSpecDetails.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.OpenApiSpecDetails.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getOwnerFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + format_ = 0; + version_ = ""; + owner_ = null; + if (ownerBuilder_ != null) { + ownerBuilder_.dispose(); + ownerBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_OpenApiSpecDetails_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.OpenApiSpecDetails getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.OpenApiSpecDetails.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.OpenApiSpecDetails build() { + com.google.cloud.apihub.v1.OpenApiSpecDetails result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.OpenApiSpecDetails buildPartial() { + com.google.cloud.apihub.v1.OpenApiSpecDetails result = + new com.google.cloud.apihub.v1.OpenApiSpecDetails(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.OpenApiSpecDetails result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.format_ = format_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.version_ = version_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.owner_ = ownerBuilder_ == null ? owner_ : ownerBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.OpenApiSpecDetails) { + return mergeFrom((com.google.cloud.apihub.v1.OpenApiSpecDetails) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.OpenApiSpecDetails other) { + if (other == com.google.cloud.apihub.v1.OpenApiSpecDetails.getDefaultInstance()) return this; + if (other.format_ != 0) { + setFormatValue(other.getFormatValue()); + } + if (!other.getVersion().isEmpty()) { + version_ = other.version_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasOwner()) { + mergeOwner(other.getOwner()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + format_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + version_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getOwnerFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int format_ = 0; + /** + * + * + *
+     * Output only. The format of the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.OpenApiSpecDetails.Format format = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for format. + */ + @java.lang.Override + public int getFormatValue() { + return format_; + } + /** + * + * + *
+     * Output only. The format of the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.OpenApiSpecDetails.Format format = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for format to set. + * @return This builder for chaining. + */ + public Builder setFormatValue(int value) { + format_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The format of the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.OpenApiSpecDetails.Format format = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The format. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.OpenApiSpecDetails.Format getFormat() { + com.google.cloud.apihub.v1.OpenApiSpecDetails.Format result = + com.google.cloud.apihub.v1.OpenApiSpecDetails.Format.forNumber(format_); + return result == null + ? com.google.cloud.apihub.v1.OpenApiSpecDetails.Format.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The format of the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.OpenApiSpecDetails.Format format = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The format to set. + * @return This builder for chaining. + */ + public Builder setFormat(com.google.cloud.apihub.v1.OpenApiSpecDetails.Format value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + format_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The format of the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.OpenApiSpecDetails.Format format = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearFormat() { + bitField0_ = (bitField0_ & ~0x00000001); + format_ = 0; + onChanged(); + return this; + } + + private java.lang.Object version_ = ""; + /** + * + * + *
+     * Output only. The version in the spec.
+     * This maps to `info.version` in OpenAPI spec.
+     * 
+ * + * string version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The version. + */ + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The version in the spec.
+     * This maps to `info.version` in OpenAPI spec.
+     * 
+ * + * string version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for version. + */ + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The version in the spec.
+     * This maps to `info.version` in OpenAPI spec.
+     * 
+ * + * string version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + version_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The version in the spec.
+     * This maps to `info.version` in OpenAPI spec.
+     * 
+ * + * string version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearVersion() { + version_ = getDefaultInstance().getVersion(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The version in the spec.
+     * This maps to `info.version` in OpenAPI spec.
+     * 
+ * + * string version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + public Builder setVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + version_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.apihub.v1.Owner owner_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Owner, + com.google.cloud.apihub.v1.Owner.Builder, + com.google.cloud.apihub.v1.OwnerOrBuilder> + ownerBuilder_; + /** + * + * + *
+     * Output only. Owner details for the spec.
+     * This maps to `info.contact` in OpenAPI spec.
+     * 
+ * + * .google.cloud.apihub.v1.Owner owner = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the owner field is set. + */ + public boolean hasOwner() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. Owner details for the spec.
+     * This maps to `info.contact` in OpenAPI spec.
+     * 
+ * + * .google.cloud.apihub.v1.Owner owner = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The owner. + */ + public com.google.cloud.apihub.v1.Owner getOwner() { + if (ownerBuilder_ == null) { + return owner_ == null ? com.google.cloud.apihub.v1.Owner.getDefaultInstance() : owner_; + } else { + return ownerBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Owner details for the spec.
+     * This maps to `info.contact` in OpenAPI spec.
+     * 
+ * + * .google.cloud.apihub.v1.Owner owner = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setOwner(com.google.cloud.apihub.v1.Owner value) { + if (ownerBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + owner_ = value; + } else { + ownerBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Owner details for the spec.
+     * This maps to `info.contact` in OpenAPI spec.
+     * 
+ * + * .google.cloud.apihub.v1.Owner owner = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setOwner(com.google.cloud.apihub.v1.Owner.Builder builderForValue) { + if (ownerBuilder_ == null) { + owner_ = builderForValue.build(); + } else { + ownerBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Owner details for the spec.
+     * This maps to `info.contact` in OpenAPI spec.
+     * 
+ * + * .google.cloud.apihub.v1.Owner owner = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeOwner(com.google.cloud.apihub.v1.Owner value) { + if (ownerBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && owner_ != null + && owner_ != com.google.cloud.apihub.v1.Owner.getDefaultInstance()) { + getOwnerBuilder().mergeFrom(value); + } else { + owner_ = value; + } + } else { + ownerBuilder_.mergeFrom(value); + } + if (owner_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Owner details for the spec.
+     * This maps to `info.contact` in OpenAPI spec.
+     * 
+ * + * .google.cloud.apihub.v1.Owner owner = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearOwner() { + bitField0_ = (bitField0_ & ~0x00000004); + owner_ = null; + if (ownerBuilder_ != null) { + ownerBuilder_.dispose(); + ownerBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Owner details for the spec.
+     * This maps to `info.contact` in OpenAPI spec.
+     * 
+ * + * .google.cloud.apihub.v1.Owner owner = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.apihub.v1.Owner.Builder getOwnerBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getOwnerFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Owner details for the spec.
+     * This maps to `info.contact` in OpenAPI spec.
+     * 
+ * + * .google.cloud.apihub.v1.Owner owner = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.apihub.v1.OwnerOrBuilder getOwnerOrBuilder() { + if (ownerBuilder_ != null) { + return ownerBuilder_.getMessageOrBuilder(); + } else { + return owner_ == null ? com.google.cloud.apihub.v1.Owner.getDefaultInstance() : owner_; + } + } + /** + * + * + *
+     * Output only. Owner details for the spec.
+     * This maps to `info.contact` in OpenAPI spec.
+     * 
+ * + * .google.cloud.apihub.v1.Owner owner = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Owner, + com.google.cloud.apihub.v1.Owner.Builder, + com.google.cloud.apihub.v1.OwnerOrBuilder> + getOwnerFieldBuilder() { + if (ownerBuilder_ == null) { + ownerBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Owner, + com.google.cloud.apihub.v1.Owner.Builder, + com.google.cloud.apihub.v1.OwnerOrBuilder>( + getOwner(), getParentForChildren(), isClean()); + owner_ = null; + } + return ownerBuilder_; + } + + @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.apihub.v1.OpenApiSpecDetails) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.OpenApiSpecDetails) + private static final com.google.cloud.apihub.v1.OpenApiSpecDetails DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.OpenApiSpecDetails(); + } + + public static com.google.cloud.apihub.v1.OpenApiSpecDetails getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OpenApiSpecDetails parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.OpenApiSpecDetails getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/OpenApiSpecDetailsOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/OpenApiSpecDetailsOrBuilder.java new file mode 100644 index 000000000000..a8d1a1aff561 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/OpenApiSpecDetailsOrBuilder.java @@ -0,0 +1,123 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface OpenApiSpecDetailsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.OpenApiSpecDetails) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The format of the spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.OpenApiSpecDetails.Format format = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for format. + */ + int getFormatValue(); + /** + * + * + *
+   * Output only. The format of the spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.OpenApiSpecDetails.Format format = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The format. + */ + com.google.cloud.apihub.v1.OpenApiSpecDetails.Format getFormat(); + + /** + * + * + *
+   * Output only. The version in the spec.
+   * This maps to `info.version` in OpenAPI spec.
+   * 
+ * + * string version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The version. + */ + java.lang.String getVersion(); + /** + * + * + *
+   * Output only. The version in the spec.
+   * This maps to `info.version` in OpenAPI spec.
+   * 
+ * + * string version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for version. + */ + com.google.protobuf.ByteString getVersionBytes(); + + /** + * + * + *
+   * Output only. Owner details for the spec.
+   * This maps to `info.contact` in OpenAPI spec.
+   * 
+ * + * .google.cloud.apihub.v1.Owner owner = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the owner field is set. + */ + boolean hasOwner(); + /** + * + * + *
+   * Output only. Owner details for the spec.
+   * This maps to `info.contact` in OpenAPI spec.
+   * 
+ * + * .google.cloud.apihub.v1.Owner owner = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The owner. + */ + com.google.cloud.apihub.v1.Owner getOwner(); + /** + * + * + *
+   * Output only. Owner details for the spec.
+   * This maps to `info.contact` in OpenAPI spec.
+   * 
+ * + * .google.cloud.apihub.v1.Owner owner = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.apihub.v1.OwnerOrBuilder getOwnerOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/OperationDetails.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/OperationDetails.java new file mode 100644 index 000000000000..3f350f891fb2 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/OperationDetails.java @@ -0,0 +1,1427 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The operation details parsed from the spec.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.OperationDetails} + */ +public final class OperationDetails extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.OperationDetails) + OperationDetailsOrBuilder { + private static final long serialVersionUID = 0L; + // Use OperationDetails.newBuilder() to construct. + private OperationDetails(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OperationDetails() { + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OperationDetails(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_OperationDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_OperationDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.OperationDetails.class, + com.google.cloud.apihub.v1.OperationDetails.Builder.class); + } + + private int bitField0_; + private int operationCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object operation_; + + public enum OperationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + HTTP_OPERATION(4), + OPERATION_NOT_SET(0); + private final int value; + + private OperationCase(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 OperationCase valueOf(int value) { + return forNumber(value); + } + + public static OperationCase forNumber(int value) { + switch (value) { + case 4: + return HTTP_OPERATION; + case 0: + return OPERATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public OperationCase getOperationCase() { + return OperationCase.forNumber(operationCase_); + } + + public static final int HTTP_OPERATION_FIELD_NUMBER = 4; + /** + * + * + *
+   * The HTTP Operation.
+   * 
+ * + * .google.cloud.apihub.v1.HttpOperation http_operation = 4; + * + * @return Whether the httpOperation field is set. + */ + @java.lang.Override + public boolean hasHttpOperation() { + return operationCase_ == 4; + } + /** + * + * + *
+   * The HTTP Operation.
+   * 
+ * + * .google.cloud.apihub.v1.HttpOperation http_operation = 4; + * + * @return The httpOperation. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.HttpOperation getHttpOperation() { + if (operationCase_ == 4) { + return (com.google.cloud.apihub.v1.HttpOperation) operation_; + } + return com.google.cloud.apihub.v1.HttpOperation.getDefaultInstance(); + } + /** + * + * + *
+   * The HTTP Operation.
+   * 
+ * + * .google.cloud.apihub.v1.HttpOperation http_operation = 4; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.HttpOperationOrBuilder getHttpOperationOrBuilder() { + if (operationCase_ == 4) { + return (com.google.cloud.apihub.v1.HttpOperation) operation_; + } + return com.google.cloud.apihub.v1.HttpOperation.getDefaultInstance(); + } + + public static final int DESCRIPTION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * Output only. Description of the operation behavior.
+   * For OpenAPI spec, this will map to `operation.description` in the
+   * spec, in case description is empty, `operation.summary` will be used.
+   * 
+ * + * string description = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. Description of the operation behavior.
+   * For OpenAPI spec, this will map to `operation.description` in the
+   * spec, in case description is empty, `operation.summary` will be used.
+   * 
+ * + * string description = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 DOCUMENTATION_FIELD_NUMBER = 2; + private com.google.cloud.apihub.v1.Documentation documentation_; + /** + * + * + *
+   * Output only. Additional external documentation for this operation.
+   * For OpenAPI spec, this will map to `operation.documentation` in the spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the documentation field is set. + */ + @java.lang.Override + public boolean hasDocumentation() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. Additional external documentation for this operation.
+   * For OpenAPI spec, this will map to `operation.documentation` in the spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The documentation. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Documentation getDocumentation() { + return documentation_ == null + ? com.google.cloud.apihub.v1.Documentation.getDefaultInstance() + : documentation_; + } + /** + * + * + *
+   * Output only. Additional external documentation for this operation.
+   * For OpenAPI spec, this will map to `operation.documentation` in the spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.DocumentationOrBuilder getDocumentationOrBuilder() { + return documentation_ == null + ? com.google.cloud.apihub.v1.Documentation.getDefaultInstance() + : documentation_; + } + + public static final int DEPRECATED_FIELD_NUMBER = 3; + private boolean deprecated_ = false; + /** + * + * + *
+   * Output only. For OpenAPI spec, this will be set if `operation.deprecated`is
+   * marked as `true` in the spec.
+   * 
+ * + * bool deprecated = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The deprecated. + */ + @java.lang.Override + public boolean getDeprecated() { + return deprecated_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getDocumentation()); + } + if (deprecated_ != false) { + output.writeBool(3, deprecated_); + } + if (operationCase_ == 4) { + output.writeMessage(4, (com.google.cloud.apihub.v1.HttpOperation) operation_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDocumentation()); + } + if (deprecated_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, deprecated_); + } + if (operationCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.apihub.v1.HttpOperation) operation_); + } + size += getUnknownFields().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.apihub.v1.OperationDetails)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.OperationDetails other = + (com.google.cloud.apihub.v1.OperationDetails) obj; + + if (!getDescription().equals(other.getDescription())) return false; + if (hasDocumentation() != other.hasDocumentation()) return false; + if (hasDocumentation()) { + if (!getDocumentation().equals(other.getDocumentation())) return false; + } + if (getDeprecated() != other.getDeprecated()) return false; + if (!getOperationCase().equals(other.getOperationCase())) return false; + switch (operationCase_) { + case 4: + if (!getHttpOperation().equals(other.getHttpOperation())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasDocumentation()) { + hash = (37 * hash) + DOCUMENTATION_FIELD_NUMBER; + hash = (53 * hash) + getDocumentation().hashCode(); + } + hash = (37 * hash) + DEPRECATED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDeprecated()); + switch (operationCase_) { + case 4: + hash = (37 * hash) + HTTP_OPERATION_FIELD_NUMBER; + hash = (53 * hash) + getHttpOperation().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.OperationDetails parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.OperationDetails 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.apihub.v1.OperationDetails parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.OperationDetails 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.apihub.v1.OperationDetails parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.OperationDetails parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.OperationDetails parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.OperationDetails 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.apihub.v1.OperationDetails parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.OperationDetails 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.apihub.v1.OperationDetails parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.OperationDetails 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.apihub.v1.OperationDetails 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 operation details parsed from the spec.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.OperationDetails} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.OperationDetails) + com.google.cloud.apihub.v1.OperationDetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_OperationDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_OperationDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.OperationDetails.class, + com.google.cloud.apihub.v1.OperationDetails.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.OperationDetails.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getDocumentationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (httpOperationBuilder_ != null) { + httpOperationBuilder_.clear(); + } + description_ = ""; + documentation_ = null; + if (documentationBuilder_ != null) { + documentationBuilder_.dispose(); + documentationBuilder_ = null; + } + deprecated_ = false; + operationCase_ = 0; + operation_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_OperationDetails_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.OperationDetails getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.OperationDetails.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.OperationDetails build() { + com.google.cloud.apihub.v1.OperationDetails result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.OperationDetails buildPartial() { + com.google.cloud.apihub.v1.OperationDetails result = + new com.google.cloud.apihub.v1.OperationDetails(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.OperationDetails result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.description_ = description_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.documentation_ = + documentationBuilder_ == null ? documentation_ : documentationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.deprecated_ = deprecated_; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.apihub.v1.OperationDetails result) { + result.operationCase_ = operationCase_; + result.operation_ = this.operation_; + if (operationCase_ == 4 && httpOperationBuilder_ != null) { + result.operation_ = httpOperationBuilder_.build(); + } + } + + @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.apihub.v1.OperationDetails) { + return mergeFrom((com.google.cloud.apihub.v1.OperationDetails) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.OperationDetails other) { + if (other == com.google.cloud.apihub.v1.OperationDetails.getDefaultInstance()) return this; + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasDocumentation()) { + mergeDocumentation(other.getDocumentation()); + } + if (other.getDeprecated() != false) { + setDeprecated(other.getDeprecated()); + } + switch (other.getOperationCase()) { + case HTTP_OPERATION: + { + mergeHttpOperation(other.getHttpOperation()); + break; + } + case OPERATION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 10 + case 18: + { + input.readMessage(getDocumentationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 18 + case 24: + { + deprecated_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 24 + case 34: + { + input.readMessage(getHttpOperationFieldBuilder().getBuilder(), extensionRegistry); + operationCase_ = 4; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int operationCase_ = 0; + private java.lang.Object operation_; + + public OperationCase getOperationCase() { + return OperationCase.forNumber(operationCase_); + } + + public Builder clearOperation() { + operationCase_ = 0; + operation_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.HttpOperation, + com.google.cloud.apihub.v1.HttpOperation.Builder, + com.google.cloud.apihub.v1.HttpOperationOrBuilder> + httpOperationBuilder_; + /** + * + * + *
+     * The HTTP Operation.
+     * 
+ * + * .google.cloud.apihub.v1.HttpOperation http_operation = 4; + * + * @return Whether the httpOperation field is set. + */ + @java.lang.Override + public boolean hasHttpOperation() { + return operationCase_ == 4; + } + /** + * + * + *
+     * The HTTP Operation.
+     * 
+ * + * .google.cloud.apihub.v1.HttpOperation http_operation = 4; + * + * @return The httpOperation. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.HttpOperation getHttpOperation() { + if (httpOperationBuilder_ == null) { + if (operationCase_ == 4) { + return (com.google.cloud.apihub.v1.HttpOperation) operation_; + } + return com.google.cloud.apihub.v1.HttpOperation.getDefaultInstance(); + } else { + if (operationCase_ == 4) { + return httpOperationBuilder_.getMessage(); + } + return com.google.cloud.apihub.v1.HttpOperation.getDefaultInstance(); + } + } + /** + * + * + *
+     * The HTTP Operation.
+     * 
+ * + * .google.cloud.apihub.v1.HttpOperation http_operation = 4; + */ + public Builder setHttpOperation(com.google.cloud.apihub.v1.HttpOperation value) { + if (httpOperationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + operation_ = value; + onChanged(); + } else { + httpOperationBuilder_.setMessage(value); + } + operationCase_ = 4; + return this; + } + /** + * + * + *
+     * The HTTP Operation.
+     * 
+ * + * .google.cloud.apihub.v1.HttpOperation http_operation = 4; + */ + public Builder setHttpOperation( + com.google.cloud.apihub.v1.HttpOperation.Builder builderForValue) { + if (httpOperationBuilder_ == null) { + operation_ = builderForValue.build(); + onChanged(); + } else { + httpOperationBuilder_.setMessage(builderForValue.build()); + } + operationCase_ = 4; + return this; + } + /** + * + * + *
+     * The HTTP Operation.
+     * 
+ * + * .google.cloud.apihub.v1.HttpOperation http_operation = 4; + */ + public Builder mergeHttpOperation(com.google.cloud.apihub.v1.HttpOperation value) { + if (httpOperationBuilder_ == null) { + if (operationCase_ == 4 + && operation_ != com.google.cloud.apihub.v1.HttpOperation.getDefaultInstance()) { + operation_ = + com.google.cloud.apihub.v1.HttpOperation.newBuilder( + (com.google.cloud.apihub.v1.HttpOperation) operation_) + .mergeFrom(value) + .buildPartial(); + } else { + operation_ = value; + } + onChanged(); + } else { + if (operationCase_ == 4) { + httpOperationBuilder_.mergeFrom(value); + } else { + httpOperationBuilder_.setMessage(value); + } + } + operationCase_ = 4; + return this; + } + /** + * + * + *
+     * The HTTP Operation.
+     * 
+ * + * .google.cloud.apihub.v1.HttpOperation http_operation = 4; + */ + public Builder clearHttpOperation() { + if (httpOperationBuilder_ == null) { + if (operationCase_ == 4) { + operationCase_ = 0; + operation_ = null; + onChanged(); + } + } else { + if (operationCase_ == 4) { + operationCase_ = 0; + operation_ = null; + } + httpOperationBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The HTTP Operation.
+     * 
+ * + * .google.cloud.apihub.v1.HttpOperation http_operation = 4; + */ + public com.google.cloud.apihub.v1.HttpOperation.Builder getHttpOperationBuilder() { + return getHttpOperationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The HTTP Operation.
+     * 
+ * + * .google.cloud.apihub.v1.HttpOperation http_operation = 4; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.HttpOperationOrBuilder getHttpOperationOrBuilder() { + if ((operationCase_ == 4) && (httpOperationBuilder_ != null)) { + return httpOperationBuilder_.getMessageOrBuilder(); + } else { + if (operationCase_ == 4) { + return (com.google.cloud.apihub.v1.HttpOperation) operation_; + } + return com.google.cloud.apihub.v1.HttpOperation.getDefaultInstance(); + } + } + /** + * + * + *
+     * The HTTP Operation.
+     * 
+ * + * .google.cloud.apihub.v1.HttpOperation http_operation = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.HttpOperation, + com.google.cloud.apihub.v1.HttpOperation.Builder, + com.google.cloud.apihub.v1.HttpOperationOrBuilder> + getHttpOperationFieldBuilder() { + if (httpOperationBuilder_ == null) { + if (!(operationCase_ == 4)) { + operation_ = com.google.cloud.apihub.v1.HttpOperation.getDefaultInstance(); + } + httpOperationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.HttpOperation, + com.google.cloud.apihub.v1.HttpOperation.Builder, + com.google.cloud.apihub.v1.HttpOperationOrBuilder>( + (com.google.cloud.apihub.v1.HttpOperation) operation_, + getParentForChildren(), + isClean()); + operation_ = null; + } + operationCase_ = 4; + onChanged(); + return httpOperationBuilder_; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Output only. Description of the operation behavior.
+     * For OpenAPI spec, this will map to `operation.description` in the
+     * spec, in case description is empty, `operation.summary` will be used.
+     * 
+ * + * string description = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. Description of the operation behavior.
+     * For OpenAPI spec, this will map to `operation.description` in the
+     * spec, in case description is empty, `operation.summary` will be used.
+     * 
+ * + * string description = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. Description of the operation behavior.
+     * For OpenAPI spec, this will map to `operation.description` in the
+     * spec, in case description is empty, `operation.summary` will be used.
+     * 
+ * + * string description = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Description of the operation behavior.
+     * For OpenAPI spec, this will map to `operation.description` in the
+     * spec, in case description is empty, `operation.summary` will be used.
+     * 
+ * + * string description = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Description of the operation behavior.
+     * For OpenAPI spec, this will map to `operation.description` in the
+     * spec, in case description is empty, `operation.summary` will be used.
+     * 
+ * + * string description = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.apihub.v1.Documentation documentation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Documentation, + com.google.cloud.apihub.v1.Documentation.Builder, + com.google.cloud.apihub.v1.DocumentationOrBuilder> + documentationBuilder_; + /** + * + * + *
+     * Output only. Additional external documentation for this operation.
+     * For OpenAPI spec, this will map to `operation.documentation` in the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the documentation field is set. + */ + public boolean hasDocumentation() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. Additional external documentation for this operation.
+     * For OpenAPI spec, this will map to `operation.documentation` in the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The documentation. + */ + public com.google.cloud.apihub.v1.Documentation getDocumentation() { + if (documentationBuilder_ == null) { + return documentation_ == null + ? com.google.cloud.apihub.v1.Documentation.getDefaultInstance() + : documentation_; + } else { + return documentationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Additional external documentation for this operation.
+     * For OpenAPI spec, this will map to `operation.documentation` in the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDocumentation(com.google.cloud.apihub.v1.Documentation value) { + if (documentationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + documentation_ = value; + } else { + documentationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Additional external documentation for this operation.
+     * For OpenAPI spec, this will map to `operation.documentation` in the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDocumentation( + com.google.cloud.apihub.v1.Documentation.Builder builderForValue) { + if (documentationBuilder_ == null) { + documentation_ = builderForValue.build(); + } else { + documentationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Additional external documentation for this operation.
+     * For OpenAPI spec, this will map to `operation.documentation` in the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeDocumentation(com.google.cloud.apihub.v1.Documentation value) { + if (documentationBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && documentation_ != null + && documentation_ != com.google.cloud.apihub.v1.Documentation.getDefaultInstance()) { + getDocumentationBuilder().mergeFrom(value); + } else { + documentation_ = value; + } + } else { + documentationBuilder_.mergeFrom(value); + } + if (documentation_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Additional external documentation for this operation.
+     * For OpenAPI spec, this will map to `operation.documentation` in the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDocumentation() { + bitField0_ = (bitField0_ & ~0x00000004); + documentation_ = null; + if (documentationBuilder_ != null) { + documentationBuilder_.dispose(); + documentationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Additional external documentation for this operation.
+     * For OpenAPI spec, this will map to `operation.documentation` in the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.apihub.v1.Documentation.Builder getDocumentationBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getDocumentationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Additional external documentation for this operation.
+     * For OpenAPI spec, this will map to `operation.documentation` in the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.apihub.v1.DocumentationOrBuilder getDocumentationOrBuilder() { + if (documentationBuilder_ != null) { + return documentationBuilder_.getMessageOrBuilder(); + } else { + return documentation_ == null + ? com.google.cloud.apihub.v1.Documentation.getDefaultInstance() + : documentation_; + } + } + /** + * + * + *
+     * Output only. Additional external documentation for this operation.
+     * For OpenAPI spec, this will map to `operation.documentation` in the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Documentation, + com.google.cloud.apihub.v1.Documentation.Builder, + com.google.cloud.apihub.v1.DocumentationOrBuilder> + getDocumentationFieldBuilder() { + if (documentationBuilder_ == null) { + documentationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Documentation, + com.google.cloud.apihub.v1.Documentation.Builder, + com.google.cloud.apihub.v1.DocumentationOrBuilder>( + getDocumentation(), getParentForChildren(), isClean()); + documentation_ = null; + } + return documentationBuilder_; + } + + private boolean deprecated_; + /** + * + * + *
+     * Output only. For OpenAPI spec, this will be set if `operation.deprecated`is
+     * marked as `true` in the spec.
+     * 
+ * + * bool deprecated = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The deprecated. + */ + @java.lang.Override + public boolean getDeprecated() { + return deprecated_; + } + /** + * + * + *
+     * Output only. For OpenAPI spec, this will be set if `operation.deprecated`is
+     * marked as `true` in the spec.
+     * 
+ * + * bool deprecated = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The deprecated to set. + * @return This builder for chaining. + */ + public Builder setDeprecated(boolean value) { + + deprecated_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. For OpenAPI spec, this will be set if `operation.deprecated`is
+     * marked as `true` in the spec.
+     * 
+ * + * bool deprecated = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDeprecated() { + bitField0_ = (bitField0_ & ~0x00000008); + deprecated_ = 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.apihub.v1.OperationDetails) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.OperationDetails) + private static final com.google.cloud.apihub.v1.OperationDetails DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.OperationDetails(); + } + + public static com.google.cloud.apihub.v1.OperationDetails getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationDetails parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.OperationDetails getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/OperationDetailsOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/OperationDetailsOrBuilder.java new file mode 100644 index 000000000000..639e566966bc --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/OperationDetailsOrBuilder.java @@ -0,0 +1,150 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface OperationDetailsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.OperationDetails) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The HTTP Operation.
+   * 
+ * + * .google.cloud.apihub.v1.HttpOperation http_operation = 4; + * + * @return Whether the httpOperation field is set. + */ + boolean hasHttpOperation(); + /** + * + * + *
+   * The HTTP Operation.
+   * 
+ * + * .google.cloud.apihub.v1.HttpOperation http_operation = 4; + * + * @return The httpOperation. + */ + com.google.cloud.apihub.v1.HttpOperation getHttpOperation(); + /** + * + * + *
+   * The HTTP Operation.
+   * 
+ * + * .google.cloud.apihub.v1.HttpOperation http_operation = 4; + */ + com.google.cloud.apihub.v1.HttpOperationOrBuilder getHttpOperationOrBuilder(); + + /** + * + * + *
+   * Output only. Description of the operation behavior.
+   * For OpenAPI spec, this will map to `operation.description` in the
+   * spec, in case description is empty, `operation.summary` will be used.
+   * 
+ * + * string description = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Output only. Description of the operation behavior.
+   * For OpenAPI spec, this will map to `operation.description` in the
+   * spec, in case description is empty, `operation.summary` will be used.
+   * 
+ * + * string description = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. Additional external documentation for this operation.
+   * For OpenAPI spec, this will map to `operation.documentation` in the spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the documentation field is set. + */ + boolean hasDocumentation(); + /** + * + * + *
+   * Output only. Additional external documentation for this operation.
+   * For OpenAPI spec, this will map to `operation.documentation` in the spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The documentation. + */ + com.google.cloud.apihub.v1.Documentation getDocumentation(); + /** + * + * + *
+   * Output only. Additional external documentation for this operation.
+   * For OpenAPI spec, this will map to `operation.documentation` in the spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.apihub.v1.DocumentationOrBuilder getDocumentationOrBuilder(); + + /** + * + * + *
+   * Output only. For OpenAPI spec, this will be set if `operation.deprecated`is
+   * marked as `true` in the spec.
+   * 
+ * + * bool deprecated = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The deprecated. + */ + boolean getDeprecated(); + + com.google.cloud.apihub.v1.OperationDetails.OperationCase getOperationCase(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/OperationMetadata.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/OperationMetadata.java new file mode 100644 index 000000000000..fbee188cac2d --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/OperationMetadata.java @@ -0,0 +1,1847 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * Represents the metadata of the long-running operation.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.OperationMetadata) + OperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OperationMetadata() { + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + apiVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OperationMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.OperationMetadata.class, + com.google.cloud.apihub.v1.OperationMetadata.Builder.class); + } + + private int bitField0_; + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.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. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int TARGET_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object target_ = ""; + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + @java.lang.Override + public java.lang.String getTarget() { + java.lang.Object ref = target_; + 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(); + target_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERB_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object verb_ = ""; + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + @java.lang.Override + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + 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(); + verb_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_MESSAGE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object statusMessage_ = ""; + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + @java.lang.Override + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + 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(); + statusMessage_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUESTED_CANCELLATION_FIELD_NUMBER = 6; + private boolean requestedCancellation_ = false; + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have been cancelled successfully
+   * have [Operation.error][] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+   * `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + + public static final int API_VERSION_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object apiVersion_ = ""; + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + @java.lang.Override + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + 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(); + apiVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, statusMessage_); + } + if (requestedCancellation_ != false) { + output.writeBool(6, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, apiVersion_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusMessage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, statusMessage_); + } + if (requestedCancellation_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, apiVersion_); + } + size += getUnknownFields().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.apihub.v1.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.OperationMetadata other = + (com.google.cloud.apihub.v1.OperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getTarget().equals(other.getTarget())) return false; + if (!getVerb().equals(other.getVerb())) return false; + if (!getStatusMessage().equals(other.getStatusMessage())) return false; + if (getRequestedCancellation() != other.getRequestedCancellation()) return false; + if (!getApiVersion().equals(other.getApiVersion())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + hash = (37 * hash) + VERB_FIELD_NUMBER; + hash = (53 * hash) + getVerb().hashCode(); + hash = (37 * hash) + STATUS_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getStatusMessage().hashCode(); + hash = (37 * hash) + REQUESTED_CANCELLATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequestedCancellation()); + hash = (37 * hash) + API_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getApiVersion().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.OperationMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.OperationMetadata 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.apihub.v1.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.OperationMetadata 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.apihub.v1.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.OperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.OperationMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.OperationMetadata 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.apihub.v1.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.OperationMetadata 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.apihub.v1.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.OperationMetadata 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.apihub.v1.OperationMetadata 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; + } + /** + * + * + *
+   * Represents the metadata of the long-running operation.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.OperationMetadata) + com.google.cloud.apihub.v1.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.OperationMetadata.class, + com.google.cloud.apihub.v1.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.OperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCreateTimeFieldBuilder(); + getEndTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + requestedCancellation_ = false; + apiVersion_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.OperationMetadata build() { + com.google.cloud.apihub.v1.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.OperationMetadata buildPartial() { + com.google.cloud.apihub.v1.OperationMetadata result = + new com.google.cloud.apihub.v1.OperationMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.OperationMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.target_ = target_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.verb_ = verb_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.statusMessage_ = statusMessage_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.requestedCancellation_ = requestedCancellation_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.apiVersion_ = apiVersion_; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.OperationMetadata) { + return mergeFrom((com.google.cloud.apihub.v1.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.OperationMetadata other) { + if (other == com.google.cloud.apihub.v1.OperationMetadata.getDefaultInstance()) return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getStatusMessage().isEmpty()) { + statusMessage_ = other.statusMessage_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.getRequestedCancellation() != false) { + setRequestedCancellation(other.getRequestedCancellation()); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + bitField0_ |= 0x00000040; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + target_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + verb_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + statusMessage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + requestedCancellation_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: + { + apiVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + 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. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000001); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000002); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object target_ = ""; + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + target_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTarget() { + target_ = getDefaultInstance().getTarget(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + target_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object verb_ = ""; + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The verb to set. + * @return This builder for chaining. + */ + public Builder setVerb(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + verb_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearVerb() { + verb_ = getDefaultInstance().getVerb(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for verb to set. + * @return This builder for chaining. + */ + public Builder setVerbBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + verb_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object statusMessage_ = ""; + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + statusMessage_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStatusMessage() { + statusMessage_ = getDefaultInstance().getStatusMessage(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + statusMessage_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private boolean requestedCancellation_; + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have been cancelled successfully
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have been cancelled successfully
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The requestedCancellation to set. + * @return This builder for chaining. + */ + public Builder setRequestedCancellation(boolean value) { + + requestedCancellation_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have been cancelled successfully
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearRequestedCancellation() { + bitField0_ = (bitField0_ & ~0x00000020); + requestedCancellation_ = false; + onChanged(); + return this; + } + + private java.lang.Object apiVersion_ = ""; + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + apiVersion_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearApiVersion() { + apiVersion_ = getDefaultInstance().getApiVersion(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + apiVersion_ = value; + bitField0_ |= 0x00000040; + 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.apihub.v1.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.OperationMetadata) + private static final com.google.cloud.apihub.v1.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.OperationMetadata(); + } + + public static com.google.cloud.apihub.v1.OperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/OperationMetadataOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/OperationMetadataOrBuilder.java new file mode 100644 index 000000000000..b89e89d82ec4 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/OperationMetadataOrBuilder.java @@ -0,0 +1,219 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + java.lang.String getTarget(); + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + com.google.protobuf.ByteString getTargetBytes(); + + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + java.lang.String getVerb(); + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + com.google.protobuf.ByteString getVerbBytes(); + + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + java.lang.String getStatusMessage(); + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + com.google.protobuf.ByteString getStatusMessageBytes(); + + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have been cancelled successfully
+   * have [Operation.error][] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+   * `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + boolean getRequestedCancellation(); + + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + java.lang.String getApiVersion(); + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + com.google.protobuf.ByteString getApiVersionBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Owner.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Owner.java new file mode 100644 index 000000000000..b54124b81276 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Owner.java @@ -0,0 +1,802 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * Owner details.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Owner} + */ +public final class Owner extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.Owner) + OwnerOrBuilder { + private static final long serialVersionUID = 0L; + // Use Owner.newBuilder() to construct. + private Owner(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Owner() { + displayName_ = ""; + email_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Owner(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Owner_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Owner_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Owner.class, com.google.cloud.apihub.v1.Owner.Builder.class); + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * Optional. The name of the owner.
+   * 
+ * + * string display_name = 1 [(.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. The name of the owner.
+   * 
+ * + * string display_name = 1 [(.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 EMAIL_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object email_ = ""; + /** + * + * + *
+   * Required. The email of the owner.
+   * 
+ * + * string email = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The email. + */ + @java.lang.Override + public java.lang.String getEmail() { + java.lang.Object ref = email_; + 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(); + email_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The email of the owner.
+   * 
+ * + * string email = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for email. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEmailBytes() { + java.lang.Object ref = email_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + email_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(email_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, email_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(email_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, email_); + } + size += getUnknownFields().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.apihub.v1.Owner)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.Owner other = (com.google.cloud.apihub.v1.Owner) obj; + + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getEmail().equals(other.getEmail())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + EMAIL_FIELD_NUMBER; + hash = (53 * hash) + getEmail().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.Owner parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Owner 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.apihub.v1.Owner parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Owner 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.apihub.v1.Owner parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Owner parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.Owner parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Owner 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.apihub.v1.Owner parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Owner 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.apihub.v1.Owner parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Owner 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.apihub.v1.Owner 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; + } + /** + * + * + *
+   * Owner details.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Owner} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.Owner) + com.google.cloud.apihub.v1.OwnerOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Owner_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Owner_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Owner.class, + com.google.cloud.apihub.v1.Owner.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.Owner.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + displayName_ = ""; + email_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Owner_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Owner getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.Owner.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Owner build() { + com.google.cloud.apihub.v1.Owner result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Owner buildPartial() { + com.google.cloud.apihub.v1.Owner result = new com.google.cloud.apihub.v1.Owner(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.Owner result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.email_ = email_; + } + } + + @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.apihub.v1.Owner) { + return mergeFrom((com.google.cloud.apihub.v1.Owner) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.Owner other) { + if (other == com.google.cloud.apihub.v1.Owner.getDefaultInstance()) return this; + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getEmail().isEmpty()) { + email_ = other.email_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + email_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Optional. The name of the owner.
+     * 
+ * + * string display_name = 1 [(.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. The name of the owner.
+     * 
+ * + * string display_name = 1 [(.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. The name of the owner.
+     * 
+ * + * string display_name = 1 [(.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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The name of the owner.
+     * 
+ * + * string display_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The name of the owner.
+     * 
+ * + * string display_name = 1 [(.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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object email_ = ""; + /** + * + * + *
+     * Required. The email of the owner.
+     * 
+ * + * string email = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The email. + */ + public java.lang.String getEmail() { + java.lang.Object ref = email_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + email_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The email of the owner.
+     * 
+ * + * string email = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for email. + */ + public com.google.protobuf.ByteString getEmailBytes() { + java.lang.Object ref = email_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + email_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The email of the owner.
+     * 
+ * + * string email = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The email to set. + * @return This builder for chaining. + */ + public Builder setEmail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + email_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The email of the owner.
+     * 
+ * + * string email = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearEmail() { + email_ = getDefaultInstance().getEmail(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The email of the owner.
+     * 
+ * + * string email = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for email to set. + * @return This builder for chaining. + */ + public Builder setEmailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + email_ = value; + bitField0_ |= 0x00000002; + 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.apihub.v1.Owner) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.Owner) + private static final com.google.cloud.apihub.v1.Owner DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.Owner(); + } + + public static com.google.cloud.apihub.v1.Owner getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Owner parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.Owner getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/OwnerOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/OwnerOrBuilder.java new file mode 100644 index 000000000000..114602c2cbf9 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/OwnerOrBuilder.java @@ -0,0 +1,76 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface OwnerOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.Owner) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. The name of the owner.
+   * 
+ * + * string display_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Optional. The name of the owner.
+   * 
+ * + * string display_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Required. The email of the owner.
+   * 
+ * + * string email = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The email. + */ + java.lang.String getEmail(); + /** + * + * + *
+   * Required. The email of the owner.
+   * 
+ * + * string email = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for email. + */ + com.google.protobuf.ByteString getEmailBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Path.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Path.java new file mode 100644 index 000000000000..80a3fd1b2d05 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Path.java @@ -0,0 +1,801 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The path details derived from the spec.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Path} + */ +public final class Path extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.Path) + PathOrBuilder { + private static final long serialVersionUID = 0L; + // Use Path.newBuilder() to construct. + private Path(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Path() { + path_ = ""; + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Path(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Path_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Path_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Path.class, com.google.cloud.apihub.v1.Path.Builder.class); + } + + public static final int PATH_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object path_ = ""; + /** + * + * + *
+   * Output only. Complete path relative to server endpoint.
+   * 
+ * + * string path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The path. + */ + @java.lang.Override + public java.lang.String getPath() { + java.lang.Object ref = path_; + 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(); + path_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Complete path relative to server endpoint.
+   * 
+ * + * string path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for path. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPathBytes() { + java.lang.Object ref = path_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + path_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * Output only. A short description for the path applicable to all operations.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. A short description for the path applicable to all operations.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(path_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, path_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(path_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, path_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + size += getUnknownFields().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.apihub.v1.Path)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.Path other = (com.google.cloud.apihub.v1.Path) obj; + + if (!getPath().equals(other.getPath())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PATH_FIELD_NUMBER; + hash = (53 * hash) + getPath().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.Path parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Path 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.apihub.v1.Path parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Path 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.apihub.v1.Path parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Path parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.Path parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Path 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.apihub.v1.Path parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Path 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.apihub.v1.Path parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Path 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.apihub.v1.Path 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 path details derived from the spec.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Path} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.Path) + com.google.cloud.apihub.v1.PathOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Path_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Path_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Path.class, com.google.cloud.apihub.v1.Path.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.Path.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + path_ = ""; + description_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Path_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Path getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.Path.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Path build() { + com.google.cloud.apihub.v1.Path result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Path buildPartial() { + com.google.cloud.apihub.v1.Path result = new com.google.cloud.apihub.v1.Path(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.Path result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.path_ = path_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.description_ = description_; + } + } + + @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.apihub.v1.Path) { + return mergeFrom((com.google.cloud.apihub.v1.Path) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.Path other) { + if (other == com.google.cloud.apihub.v1.Path.getDefaultInstance()) return this; + if (!other.getPath().isEmpty()) { + path_ = other.path_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + path_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object path_ = ""; + /** + * + * + *
+     * Output only. Complete path relative to server endpoint.
+     * 
+ * + * string path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The path. + */ + public java.lang.String getPath() { + java.lang.Object ref = path_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + path_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Complete path relative to server endpoint.
+     * 
+ * + * string path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for path. + */ + public com.google.protobuf.ByteString getPathBytes() { + java.lang.Object ref = path_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + path_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Complete path relative to server endpoint.
+     * 
+ * + * string path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The path to set. + * @return This builder for chaining. + */ + public Builder setPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + path_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Complete path relative to server endpoint.
+     * 
+ * + * string path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearPath() { + path_ = getDefaultInstance().getPath(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Complete path relative to server endpoint.
+     * 
+ * + * string path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for path to set. + * @return This builder for chaining. + */ + public Builder setPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + path_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Output only. A short description for the path applicable to all operations.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. A short description for the path applicable to all operations.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. A short description for the path applicable to all operations.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A short description for the path applicable to all operations.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A short description for the path applicable to all operations.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000002; + 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.apihub.v1.Path) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.Path) + private static final com.google.cloud.apihub.v1.Path DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.Path(); + } + + public static com.google.cloud.apihub.v1.Path getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Path parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.Path getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/PathOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/PathOrBuilder.java new file mode 100644 index 000000000000..5c9a229700bc --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/PathOrBuilder.java @@ -0,0 +1,76 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface PathOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.Path) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Complete path relative to server endpoint.
+   * 
+ * + * string path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The path. + */ + java.lang.String getPath(); + /** + * + * + *
+   * Output only. Complete path relative to server endpoint.
+   * 
+ * + * string path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for path. + */ + com.google.protobuf.ByteString getPathBytes(); + + /** + * + * + *
+   * Output only. A short description for the path applicable to all operations.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Output only. A short description for the path applicable to all operations.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Plugin.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Plugin.java new file mode 100644 index 000000000000..7a051933ca58 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Plugin.java @@ -0,0 +1,1710 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/plugin_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * A plugin resource in the API Hub.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Plugin} + */ +public final class Plugin extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.Plugin) + PluginOrBuilder { + private static final long serialVersionUID = 0L; + // Use Plugin.newBuilder() to construct. + private Plugin(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Plugin() { + name_ = ""; + displayName_ = ""; + description_ = ""; + state_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Plugin(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.PluginServiceProto + .internal_static_google_cloud_apihub_v1_Plugin_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.PluginServiceProto + .internal_static_google_cloud_apihub_v1_Plugin_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Plugin.class, + com.google.cloud.apihub.v1.Plugin.Builder.class); + } + + /** + * + * + *
+   * Possible states a plugin can have. Note that this enum may receive new
+   * values in the future. Consumers are advised to always code against the
+   * enum values expecting new states can be added later on.
+   * 
+ * + * Protobuf enum {@code google.cloud.apihub.v1.Plugin.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The default value. This value is used if the state is omitted.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The plugin is enabled.
+     * 
+ * + * ENABLED = 1; + */ + ENABLED(1), + /** + * + * + *
+     * The plugin is disabled.
+     * 
+ * + * DISABLED = 2; + */ + DISABLED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The default value. This value is used if the state is omitted.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The plugin is enabled.
+     * 
+ * + * ENABLED = 1; + */ + public static final int ENABLED_VALUE = 1; + /** + * + * + *
+     * The plugin is disabled.
+     * 
+ * + * DISABLED = 2; + */ + public static final int DISABLED_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 ENABLED; + case 2: + return DISABLED; + 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.apihub.v1.Plugin.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.apihub.v1.Plugin.State) + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. The name of the plugin.
+   * Format: `projects/{project}/locations/{location}/plugins/{plugin}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+   * Identifier. The name of the plugin.
+   * Format: `projects/{project}/locations/{location}/plugins/{plugin}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * Required. The display name of the plugin. Max length is 50 characters
+   * (Unicode code points).
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+   * Required. The display name of the plugin. Max length is 50 characters
+   * (Unicode code points).
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 TYPE_FIELD_NUMBER = 3; + private com.google.cloud.apihub.v1.AttributeValues type_; + /** + * + * + *
+   * Required. The type of the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-plugin-type`
+   * attribute.
+   * The number of allowed values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the type field is set. + */ + @java.lang.Override + public boolean hasType() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The type of the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-plugin-type`
+   * attribute.
+   * The number of allowed values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getType() { + return type_ == null ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() : type_; + } + /** + * + * + *
+   * Required. The type of the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-plugin-type`
+   * attribute.
+   * The number of allowed values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValuesOrBuilder getTypeOrBuilder() { + return type_ == null ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() : type_; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * Optional. The plugin description. Max length is 2000 characters (Unicode
+   * code points).
+   * 
+ * + * string description = 4 [(.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. The plugin description. Max length is 2000 characters (Unicode
+   * code points).
+   * 
+ * + * string description = 4 [(.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 STATE_FIELD_NUMBER = 5; + private int state_ = 0; + /** + * + * + *
+   * Output only. Represents the state of the plugin.
+   * 
+ * + * + * .google.cloud.apihub.v1.Plugin.State state = 5 [(.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. Represents the state of the plugin.
+   * 
+ * + * + * .google.cloud.apihub.v1.Plugin.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Plugin.State getState() { + com.google.cloud.apihub.v1.Plugin.State result = + com.google.cloud.apihub.v1.Plugin.State.forNumber(state_); + return result == null ? com.google.cloud.apihub.v1.Plugin.State.UNRECOGNIZED : result; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getType()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, description_); + } + if (state_ != com.google.cloud.apihub.v1.Plugin.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(5, state_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getType()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, description_); + } + if (state_ != com.google.cloud.apihub.v1.Plugin.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, state_); + } + size += getUnknownFields().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.apihub.v1.Plugin)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.Plugin other = (com.google.cloud.apihub.v1.Plugin) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (hasType() != other.hasType()) return false; + if (hasType()) { + if (!getType().equals(other.getType())) return false; + } + if (!getDescription().equals(other.getDescription())) return false; + if (state_ != other.state_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (hasType()) { + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + } + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.Plugin parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Plugin 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.apihub.v1.Plugin parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Plugin 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.apihub.v1.Plugin parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Plugin parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.Plugin parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Plugin 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.apihub.v1.Plugin parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Plugin 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.apihub.v1.Plugin parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Plugin 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.apihub.v1.Plugin 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 plugin resource in the API Hub.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Plugin} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.Plugin) + com.google.cloud.apihub.v1.PluginOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.PluginServiceProto + .internal_static_google_cloud_apihub_v1_Plugin_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.PluginServiceProto + .internal_static_google_cloud_apihub_v1_Plugin_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Plugin.class, + com.google.cloud.apihub.v1.Plugin.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.Plugin.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTypeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + type_ = null; + if (typeBuilder_ != null) { + typeBuilder_.dispose(); + typeBuilder_ = null; + } + description_ = ""; + state_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.PluginServiceProto + .internal_static_google_cloud_apihub_v1_Plugin_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Plugin getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.Plugin.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Plugin build() { + com.google.cloud.apihub.v1.Plugin result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Plugin buildPartial() { + com.google.cloud.apihub.v1.Plugin result = new com.google.cloud.apihub.v1.Plugin(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.Plugin result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.type_ = typeBuilder_ == null ? type_ : typeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.state_ = state_; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.Plugin) { + return mergeFrom((com.google.cloud.apihub.v1.Plugin) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.Plugin other) { + if (other == com.google.cloud.apihub.v1.Plugin.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasType()) { + mergeType(other.getType()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. The name of the plugin.
+     * Format: `projects/{project}/locations/{location}/plugins/{plugin}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. The name of the plugin.
+     * Format: `projects/{project}/locations/{location}/plugins/{plugin}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. The name of the plugin.
+     * Format: `projects/{project}/locations/{location}/plugins/{plugin}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The name of the plugin.
+     * Format: `projects/{project}/locations/{location}/plugins/{plugin}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The name of the plugin.
+     * Format: `projects/{project}/locations/{location}/plugins/{plugin}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Required. The display name of the plugin. Max length is 50 characters
+     * (Unicode code points).
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. The display name of the plugin. Max length is 50 characters
+     * (Unicode code points).
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. The display name of the plugin. Max length is 50 characters
+     * (Unicode code points).
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The display name of the plugin. Max length is 50 characters
+     * (Unicode code points).
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The display name of the plugin. Max length is 50 characters
+     * (Unicode code points).
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.apihub.v1.AttributeValues type_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder> + typeBuilder_; + /** + * + * + *
+     * Required. The type of the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-plugin-type`
+     * attribute.
+     * The number of allowed values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the type field is set. + */ + public boolean hasType() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The type of the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-plugin-type`
+     * attribute.
+     * The number of allowed values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The type. + */ + public com.google.cloud.apihub.v1.AttributeValues getType() { + if (typeBuilder_ == null) { + return type_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : type_; + } else { + return typeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The type of the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-plugin-type`
+     * attribute.
+     * The number of allowed values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setType(com.google.cloud.apihub.v1.AttributeValues value) { + if (typeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + } else { + typeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-plugin-type`
+     * attribute.
+     * The number of allowed values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setType(com.google.cloud.apihub.v1.AttributeValues.Builder builderForValue) { + if (typeBuilder_ == null) { + type_ = builderForValue.build(); + } else { + typeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-plugin-type`
+     * attribute.
+     * The number of allowed values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeType(com.google.cloud.apihub.v1.AttributeValues value) { + if (typeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && type_ != null + && type_ != com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance()) { + getTypeBuilder().mergeFrom(value); + } else { + type_ = value; + } + } else { + typeBuilder_.mergeFrom(value); + } + if (type_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The type of the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-plugin-type`
+     * attribute.
+     * The number of allowed values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000004); + type_ = null; + if (typeBuilder_ != null) { + typeBuilder_.dispose(); + typeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-plugin-type`
+     * attribute.
+     * The number of allowed values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.AttributeValues.Builder getTypeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getTypeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The type of the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-plugin-type`
+     * attribute.
+     * The number of allowed values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.AttributeValuesOrBuilder getTypeOrBuilder() { + if (typeBuilder_ != null) { + return typeBuilder_.getMessageOrBuilder(); + } else { + return type_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : type_; + } + } + /** + * + * + *
+     * Required. The type of the API.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-plugin-type`
+     * attribute.
+     * The number of allowed values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder> + getTypeFieldBuilder() { + if (typeBuilder_ == null) { + typeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder>( + getType(), getParentForChildren(), isClean()); + type_ = null; + } + return typeBuilder_; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Optional. The plugin description. Max length is 2000 characters (Unicode
+     * code points).
+     * 
+ * + * string description = 4 [(.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. The plugin description. Max length is 2000 characters (Unicode
+     * code points).
+     * 
+ * + * string description = 4 [(.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. The plugin description. Max length is 2000 characters (Unicode
+     * code points).
+     * 
+ * + * string description = 4 [(.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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The plugin description. Max length is 2000 characters (Unicode
+     * code points).
+     * 
+ * + * string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The plugin description. Max length is 2000 characters (Unicode
+     * code points).
+     * 
+ * + * string description = 4 [(.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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. Represents the state of the plugin.
+     * 
+ * + * + * .google.cloud.apihub.v1.Plugin.State state = 5 [(.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. Represents the state of the plugin.
+     * 
+ * + * + * .google.cloud.apihub.v1.Plugin.State state = 5 [(.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; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Represents the state of the plugin.
+     * 
+ * + * + * .google.cloud.apihub.v1.Plugin.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Plugin.State getState() { + com.google.cloud.apihub.v1.Plugin.State result = + com.google.cloud.apihub.v1.Plugin.State.forNumber(state_); + return result == null ? com.google.cloud.apihub.v1.Plugin.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. Represents the state of the plugin.
+     * 
+ * + * + * .google.cloud.apihub.v1.Plugin.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.apihub.v1.Plugin.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Represents the state of the plugin.
+     * 
+ * + * + * .google.cloud.apihub.v1.Plugin.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000010); + state_ = 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.apihub.v1.Plugin) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.Plugin) + private static final com.google.cloud.apihub.v1.Plugin DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.Plugin(); + } + + public static com.google.cloud.apihub.v1.Plugin getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Plugin parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.Plugin getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/PluginName.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/PluginName.java new file mode 100644 index 000000000000..455d8a197076 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/PluginName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +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 PluginName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_PLUGIN = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/plugins/{plugin}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String plugin; + + @Deprecated + protected PluginName() { + project = null; + location = null; + plugin = null; + } + + private PluginName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + plugin = Preconditions.checkNotNull(builder.getPlugin()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getPlugin() { + return plugin; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static PluginName of(String project, String location, String plugin) { + return newBuilder().setProject(project).setLocation(location).setPlugin(plugin).build(); + } + + public static String format(String project, String location, String plugin) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setPlugin(plugin) + .build() + .toString(); + } + + public static PluginName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_PLUGIN.validatedMatch( + formattedString, "PluginName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("plugin")); + } + + 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 (PluginName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_PLUGIN.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); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (plugin != null) { + fieldMapBuilder.put("plugin", plugin); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_PLUGIN.instantiate( + "project", project, "location", location, "plugin", plugin); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + PluginName that = ((PluginName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.plugin, that.plugin); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(plugin); + return h; + } + + /** Builder for projects/{project}/locations/{location}/plugins/{plugin}. */ + public static class Builder { + private String project; + private String location; + private String plugin; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getPlugin() { + return plugin; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setPlugin(String plugin) { + this.plugin = plugin; + return this; + } + + private Builder(PluginName pluginName) { + this.project = pluginName.project; + this.location = pluginName.location; + this.plugin = pluginName.plugin; + } + + public PluginName build() { + return new PluginName(this); + } + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/PluginOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/PluginOrBuilder.java new file mode 100644 index 000000000000..0d2e53d21ad2 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/PluginOrBuilder.java @@ -0,0 +1,198 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/plugin_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface PluginOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.Plugin) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. The name of the plugin.
+   * Format: `projects/{project}/locations/{location}/plugins/{plugin}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. The name of the plugin.
+   * Format: `projects/{project}/locations/{location}/plugins/{plugin}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The display name of the plugin. Max length is 50 characters
+   * (Unicode code points).
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. The display name of the plugin. Max length is 50 characters
+   * (Unicode code points).
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Required. The type of the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-plugin-type`
+   * attribute.
+   * The number of allowed values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the type field is set. + */ + boolean hasType(); + /** + * + * + *
+   * Required. The type of the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-plugin-type`
+   * attribute.
+   * The number of allowed values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The type. + */ + com.google.cloud.apihub.v1.AttributeValues getType(); + /** + * + * + *
+   * Required. The type of the API.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-plugin-type`
+   * attribute.
+   * The number of allowed values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.apihub.v1.AttributeValuesOrBuilder getTypeOrBuilder(); + + /** + * + * + *
+   * Optional. The plugin description. Max length is 2000 characters (Unicode
+   * code points).
+   * 
+ * + * string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Optional. The plugin description. Max length is 2000 characters (Unicode
+   * code points).
+   * 
+ * + * string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. Represents the state of the plugin.
+   * 
+ * + * + * .google.cloud.apihub.v1.Plugin.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. Represents the state of the plugin.
+   * 
+ * + * + * .google.cloud.apihub.v1.Plugin.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.apihub.v1.Plugin.State getState(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/PluginServiceProto.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/PluginServiceProto.java new file mode 100644 index 000000000000..65f9632a83c3 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/PluginServiceProto.java @@ -0,0 +1,158 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/plugin_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public final class PluginServiceProto { + private PluginServiceProto() {} + + 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_apihub_v1_Plugin_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_Plugin_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_GetPluginRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_GetPluginRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_EnablePluginRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_EnablePluginRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_DisablePluginRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_DisablePluginRequest_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/apihub/v1/plugin_service." + + "proto\022\026google.cloud.apihub.v1\032\034google/ap" + + "i/annotations.proto\032\027google/api/client.p" + + "roto\032\037google/api/field_behavior.proto\032\031g" + + "oogle/api/resource.proto\032*google/cloud/a" + + "pihub/v1/common_fields.proto\"\357\002\n\006Plugin\022" + + "\021\n\004name\030\001 \001(\tB\003\340A\010\022\031\n\014display_name\030\002 \001(\t" + + "B\003\340A\002\022:\n\004type\030\003 \001(\0132\'.google.cloud.apihu" + + "b.v1.AttributeValuesB\003\340A\002\022\030\n\013description" + + "\030\004 \001(\tB\003\340A\001\0228\n\005state\030\005 \001(\0162$.google.clou" + + "d.apihub.v1.Plugin.StateB\003\340A\003\"9\n\005State\022\025" + + "\n\021STATE_UNSPECIFIED\020\000\022\013\n\007ENABLED\020\001\022\014\n\010DI" + + "SABLED\020\002:l\352Ai\n\034apihub.googleapis.com/Plu" + + "gin\0228projects/{project}/locations/{locat" + + "ion}/plugins/{plugin}*\007plugins2\006plugin\"F" + + "\n\020GetPluginRequest\0222\n\004name\030\001 \001(\tB$\340A\002\372A\036" + + "\n\034apihub.googleapis.com/Plugin\"I\n\023Enable" + + "PluginRequest\0222\n\004name\030\001 \001(\tB$\340A\002\372A\036\n\034api" + + "hub.googleapis.com/Plugin\"J\n\024DisablePlug" + + "inRequest\0222\n\004name\030\001 \001(\tB$\340A\002\372A\036\n\034apihub." + + "googleapis.com/Plugin2\270\004\n\014ApiHubPlugin\022\221" + + "\001\n\tGetPlugin\022(.google.cloud.apihub.v1.Ge" + + "tPluginRequest\032\036.google.cloud.apihub.v1." + + "Plugin\":\332A\004name\202\323\344\223\002-\022+/v1/{name=project" + + "s/*/locations/*/plugins/*}\022\241\001\n\014EnablePlu" + + "gin\022+.google.cloud.apihub.v1.EnablePlugi" + + "nRequest\032\036.google.cloud.apihub.v1.Plugin" + + "\"D\332A\004name\202\323\344\223\0027\"2/v1/{name=projects/*/lo" + + "cations/*/plugins/*}:enable:\001*\022\244\001\n\rDisab" + + "lePlugin\022,.google.cloud.apihub.v1.Disabl" + + "ePluginRequest\032\036.google.cloud.apihub.v1." + + "Plugin\"E\332A\004name\202\323\344\223\0028\"3/v1/{name=project" + + "s/*/locations/*/plugins/*}:disable:\001*\032I\312" + + "A\025apihub.googleapis.com\322A.https://www.go" + + "ogleapis.com/auth/cloud-platformB\264\001\n\032com" + + ".google.cloud.apihub.v1B\022PluginServicePr" + + "otoP\001Z2cloud.google.com/go/apihub/apiv1/" + + "apihubpb;apihubpb\252\002\026Google.Cloud.ApiHub." + + "V1\312\002\026Google\\Cloud\\ApiHub\\V1\352\002\031Google::Cl" + + "oud::ApiHub::V1b\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.cloud.apihub.v1.CommonFieldsProto.getDescriptor(), + }); + internal_static_google_cloud_apihub_v1_Plugin_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_apihub_v1_Plugin_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_Plugin_descriptor, + new java.lang.String[] { + "Name", "DisplayName", "Type", "Description", "State", + }); + internal_static_google_cloud_apihub_v1_GetPluginRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_apihub_v1_GetPluginRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_GetPluginRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_apihub_v1_EnablePluginRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_apihub_v1_EnablePluginRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_EnablePluginRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_apihub_v1_DisablePluginRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_apihub_v1_DisablePluginRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_DisablePluginRequest_descriptor, + new java.lang.String[] { + "Name", + }); + 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.cloud.apihub.v1.CommonFieldsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Point.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Point.java new file mode 100644 index 000000000000..de63117b1c42 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Point.java @@ -0,0 +1,623 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * Point within the file (line and character).
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Point} + */ +public final class Point extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.Point) + PointOrBuilder { + private static final long serialVersionUID = 0L; + // Use Point.newBuilder() to construct. + private Point(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Point() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Point(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Point_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Point_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Point.class, com.google.cloud.apihub.v1.Point.Builder.class); + } + + public static final int LINE_FIELD_NUMBER = 1; + private int line_ = 0; + /** + * + * + *
+   * Required. Line number (zero-indexed).
+   * 
+ * + * int32 line = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The line. + */ + @java.lang.Override + public int getLine() { + return line_; + } + + public static final int CHARACTER_FIELD_NUMBER = 2; + private int character_ = 0; + /** + * + * + *
+   * Required. Character position within the line (zero-indexed).
+   * 
+ * + * int32 character = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The character. + */ + @java.lang.Override + public int getCharacter() { + return character_; + } + + 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 (line_ != 0) { + output.writeInt32(1, line_); + } + if (character_ != 0) { + output.writeInt32(2, character_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (line_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, line_); + } + if (character_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, character_); + } + size += getUnknownFields().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.apihub.v1.Point)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.Point other = (com.google.cloud.apihub.v1.Point) obj; + + if (getLine() != other.getLine()) return false; + if (getCharacter() != other.getCharacter()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + LINE_FIELD_NUMBER; + hash = (53 * hash) + getLine(); + hash = (37 * hash) + CHARACTER_FIELD_NUMBER; + hash = (53 * hash) + getCharacter(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.Point parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Point 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.apihub.v1.Point parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Point 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.apihub.v1.Point parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Point parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.Point parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Point 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.apihub.v1.Point parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Point 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.apihub.v1.Point parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Point 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.apihub.v1.Point 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; + } + /** + * + * + *
+   * Point within the file (line and character).
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Point} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.Point) + com.google.cloud.apihub.v1.PointOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Point_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Point_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Point.class, + com.google.cloud.apihub.v1.Point.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.Point.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + line_ = 0; + character_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Point_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Point getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.Point.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Point build() { + com.google.cloud.apihub.v1.Point result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Point buildPartial() { + com.google.cloud.apihub.v1.Point result = new com.google.cloud.apihub.v1.Point(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.Point result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.line_ = line_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.character_ = character_; + } + } + + @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.apihub.v1.Point) { + return mergeFrom((com.google.cloud.apihub.v1.Point) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.Point other) { + if (other == com.google.cloud.apihub.v1.Point.getDefaultInstance()) return this; + if (other.getLine() != 0) { + setLine(other.getLine()); + } + if (other.getCharacter() != 0) { + setCharacter(other.getCharacter()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + line_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + character_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int line_; + /** + * + * + *
+     * Required. Line number (zero-indexed).
+     * 
+ * + * int32 line = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The line. + */ + @java.lang.Override + public int getLine() { + return line_; + } + /** + * + * + *
+     * Required. Line number (zero-indexed).
+     * 
+ * + * int32 line = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The line to set. + * @return This builder for chaining. + */ + public Builder setLine(int value) { + + line_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Line number (zero-indexed).
+     * 
+ * + * int32 line = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearLine() { + bitField0_ = (bitField0_ & ~0x00000001); + line_ = 0; + onChanged(); + return this; + } + + private int character_; + /** + * + * + *
+     * Required. Character position within the line (zero-indexed).
+     * 
+ * + * int32 character = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The character. + */ + @java.lang.Override + public int getCharacter() { + return character_; + } + /** + * + * + *
+     * Required. Character position within the line (zero-indexed).
+     * 
+ * + * int32 character = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The character to set. + * @return This builder for chaining. + */ + public Builder setCharacter(int value) { + + character_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Character position within the line (zero-indexed).
+     * 
+ * + * int32 character = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearCharacter() { + bitField0_ = (bitField0_ & ~0x00000002); + character_ = 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.apihub.v1.Point) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.Point) + private static final com.google.cloud.apihub.v1.Point DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.Point(); + } + + public static com.google.cloud.apihub.v1.Point getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Point parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.Point getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/PointOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/PointOrBuilder.java new file mode 100644 index 000000000000..1e9b1e1bf634 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/PointOrBuilder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface PointOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.Point) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Line number (zero-indexed).
+   * 
+ * + * int32 line = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The line. + */ + int getLine(); + + /** + * + * + *
+   * Required. Character position within the line (zero-indexed).
+   * 
+ * + * int32 character = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The character. + */ + int getCharacter(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ProvisioningServiceProto.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ProvisioningServiceProto.java new file mode 100644 index 000000000000..dd481539ffa5 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/ProvisioningServiceProto.java @@ -0,0 +1,163 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/provisioning_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public final class ProvisioningServiceProto { + private ProvisioningServiceProto() {} + + 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_apihub_v1_CreateApiHubInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_CreateApiHubInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_GetApiHubInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_GetApiHubInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_LookupApiHubInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_LookupApiHubInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_LookupApiHubInstanceResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_LookupApiHubInstanceResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n1google/cloud/apihub/v1/provisioning_se" + + "rvice.proto\022\026google.cloud.apihub.v1\032\034goo" + + "gle/api/annotations.proto\032\027google/api/cl" + + "ient.proto\032\037google/api/field_behavior.pr" + + "oto\032\031google/api/resource.proto\032*google/c" + + "loud/apihub/v1/common_fields.proto\032#goog" + + "le/longrunning/operations.proto\"\301\001\n\033Crea" + + "teApiHubInstanceRequest\0229\n\006parent\030\001 \001(\tB" + + ")\340A\002\372A#\n!locations.googleapis.com/Locati" + + "on\022 \n\023api_hub_instance_id\030\002 \001(\tB\003\340A\001\022E\n\020" + + "api_hub_instance\030\003 \001(\0132&.google.cloud.ap" + + "ihub.v1.ApiHubInstanceB\003\340A\002\"V\n\030GetApiHub" + + "InstanceRequest\022:\n\004name\030\001 \001(\tB,\340A\002\372A&\n$a" + + "pihub.googleapis.com/ApiHubInstance\"[\n\033L" + + "ookupApiHubInstanceRequest\022<\n\006parent\030\001 \001" + + "(\tB,\340A\002\372A&\022$apihub.googleapis.com/ApiHub" + + "Instance\"`\n\034LookupApiHubInstanceResponse" + + "\022@\n\020api_hub_instance\030\001 \001(\0132&.google.clou" + + "d.apihub.v1.ApiHubInstance2\357\005\n\014Provision" + + "ing\022\216\002\n\024CreateApiHubInstance\0223.google.cl" + + "oud.apihub.v1.CreateApiHubInstanceReques" + + "t\032\035.google.longrunning.Operation\"\241\001\312A#\n\016" + + "ApiHubInstance\022\021OperationMetadata\332A+pare" + + "nt,api_hub_instance,api_hub_instance_id\202" + + "\323\344\223\002G\"3/v1/{parent=projects/*/locations/" + + "*}/apiHubInstances:\020api_hub_instance\022\261\001\n" + + "\021GetApiHubInstance\0220.google.cloud.apihub" + + ".v1.GetApiHubInstanceRequest\032&.google.cl" + + "oud.apihub.v1.ApiHubInstance\"B\332A\004name\202\323\344" + + "\223\0025\0223/v1/{name=projects/*/locations/*/ap" + + "iHubInstances/*}\022\316\001\n\024LookupApiHubInstanc" + + "e\0223.google.cloud.apihub.v1.LookupApiHubI" + + "nstanceRequest\0324.google.cloud.apihub.v1." + + "LookupApiHubInstanceResponse\"K\332A\006parent\202" + + "\323\344\223\002<\022:/v1/{parent=projects/*/locations/" + + "*}/apiHubInstances:lookup\032I\312A\025apihub.goo" + + "gleapis.com\322A.https://www.googleapis.com" + + "/auth/cloud-platformB\272\001\n\032com.google.clou" + + "d.apihub.v1B\030ProvisioningServiceProtoP\001Z" + + "2cloud.google.com/go/apihub/apiv1/apihub" + + "pb;apihubpb\252\002\026Google.Cloud.ApiHub.V1\312\002\026G" + + "oogle\\Cloud\\ApiHub\\V1\352\002\031Google::Cloud::A" + + "piHub::V1b\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.cloud.apihub.v1.CommonFieldsProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + }); + internal_static_google_cloud_apihub_v1_CreateApiHubInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_apihub_v1_CreateApiHubInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_CreateApiHubInstanceRequest_descriptor, + new java.lang.String[] { + "Parent", "ApiHubInstanceId", "ApiHubInstance", + }); + internal_static_google_cloud_apihub_v1_GetApiHubInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_apihub_v1_GetApiHubInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_GetApiHubInstanceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_apihub_v1_LookupApiHubInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_apihub_v1_LookupApiHubInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_LookupApiHubInstanceRequest_descriptor, + new java.lang.String[] { + "Parent", + }); + internal_static_google_cloud_apihub_v1_LookupApiHubInstanceResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_apihub_v1_LookupApiHubInstanceResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_LookupApiHubInstanceResponse_descriptor, + new java.lang.String[] { + "ApiHubInstance", + }); + 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.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.cloud.apihub.v1.CommonFieldsProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Range.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Range.java new file mode 100644 index 000000000000..c5d3f6a99435 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Range.java @@ -0,0 +1,977 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * Object describing where in the file the issue was found.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Range} + */ +public final class Range extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.Range) + RangeOrBuilder { + private static final long serialVersionUID = 0L; + // Use Range.newBuilder() to construct. + private Range(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Range() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Range(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Range_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Range_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Range.class, com.google.cloud.apihub.v1.Range.Builder.class); + } + + private int bitField0_; + public static final int START_FIELD_NUMBER = 1; + private com.google.cloud.apihub.v1.Point start_; + /** + * + * + *
+   * Required. Start of the issue.
+   * 
+ * + * .google.cloud.apihub.v1.Point start = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the start field is set. + */ + @java.lang.Override + public boolean hasStart() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. Start of the issue.
+   * 
+ * + * .google.cloud.apihub.v1.Point start = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The start. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Point getStart() { + return start_ == null ? com.google.cloud.apihub.v1.Point.getDefaultInstance() : start_; + } + /** + * + * + *
+   * Required. Start of the issue.
+   * 
+ * + * .google.cloud.apihub.v1.Point start = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.PointOrBuilder getStartOrBuilder() { + return start_ == null ? com.google.cloud.apihub.v1.Point.getDefaultInstance() : start_; + } + + public static final int END_FIELD_NUMBER = 2; + private com.google.cloud.apihub.v1.Point end_; + /** + * + * + *
+   * Required. End of the issue.
+   * 
+ * + * .google.cloud.apihub.v1.Point end = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the end field is set. + */ + @java.lang.Override + public boolean hasEnd() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Required. End of the issue.
+   * 
+ * + * .google.cloud.apihub.v1.Point end = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The end. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Point getEnd() { + return end_ == null ? com.google.cloud.apihub.v1.Point.getDefaultInstance() : end_; + } + /** + * + * + *
+   * Required. End of the issue.
+   * 
+ * + * .google.cloud.apihub.v1.Point end = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.PointOrBuilder getEndOrBuilder() { + return end_ == null ? com.google.cloud.apihub.v1.Point.getDefaultInstance() : end_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getStart()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getEnd()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getStart()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEnd()); + } + size += getUnknownFields().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.apihub.v1.Range)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.Range other = (com.google.cloud.apihub.v1.Range) obj; + + if (hasStart() != other.hasStart()) return false; + if (hasStart()) { + if (!getStart().equals(other.getStart())) return false; + } + if (hasEnd() != other.hasEnd()) return false; + if (hasEnd()) { + if (!getEnd().equals(other.getEnd())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasStart()) { + hash = (37 * hash) + START_FIELD_NUMBER; + hash = (53 * hash) + getStart().hashCode(); + } + if (hasEnd()) { + hash = (37 * hash) + END_FIELD_NUMBER; + hash = (53 * hash) + getEnd().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.Range parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Range 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.apihub.v1.Range parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Range 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.apihub.v1.Range parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Range parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.Range parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Range 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.apihub.v1.Range parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Range 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.apihub.v1.Range parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Range 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.apihub.v1.Range 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; + } + /** + * + * + *
+   * Object describing where in the file the issue was found.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Range} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.Range) + com.google.cloud.apihub.v1.RangeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Range_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Range_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Range.class, + com.google.cloud.apihub.v1.Range.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.Range.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStartFieldBuilder(); + getEndFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + start_ = null; + if (startBuilder_ != null) { + startBuilder_.dispose(); + startBuilder_ = null; + } + end_ = null; + if (endBuilder_ != null) { + endBuilder_.dispose(); + endBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Range_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Range getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.Range.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Range build() { + com.google.cloud.apihub.v1.Range result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Range buildPartial() { + com.google.cloud.apihub.v1.Range result = new com.google.cloud.apihub.v1.Range(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.Range result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.start_ = startBuilder_ == null ? start_ : startBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.end_ = endBuilder_ == null ? end_ : endBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.Range) { + return mergeFrom((com.google.cloud.apihub.v1.Range) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.Range other) { + if (other == com.google.cloud.apihub.v1.Range.getDefaultInstance()) return this; + if (other.hasStart()) { + mergeStart(other.getStart()); + } + if (other.hasEnd()) { + mergeEnd(other.getEnd()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getStartFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getEndFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.apihub.v1.Point start_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Point, + com.google.cloud.apihub.v1.Point.Builder, + com.google.cloud.apihub.v1.PointOrBuilder> + startBuilder_; + /** + * + * + *
+     * Required. Start of the issue.
+     * 
+ * + * .google.cloud.apihub.v1.Point start = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the start field is set. + */ + public boolean hasStart() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. Start of the issue.
+     * 
+ * + * .google.cloud.apihub.v1.Point start = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The start. + */ + public com.google.cloud.apihub.v1.Point getStart() { + if (startBuilder_ == null) { + return start_ == null ? com.google.cloud.apihub.v1.Point.getDefaultInstance() : start_; + } else { + return startBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Start of the issue.
+     * 
+ * + * .google.cloud.apihub.v1.Point start = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setStart(com.google.cloud.apihub.v1.Point value) { + if (startBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + start_ = value; + } else { + startBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Start of the issue.
+     * 
+ * + * .google.cloud.apihub.v1.Point start = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setStart(com.google.cloud.apihub.v1.Point.Builder builderForValue) { + if (startBuilder_ == null) { + start_ = builderForValue.build(); + } else { + startBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Start of the issue.
+     * 
+ * + * .google.cloud.apihub.v1.Point start = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeStart(com.google.cloud.apihub.v1.Point value) { + if (startBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && start_ != null + && start_ != com.google.cloud.apihub.v1.Point.getDefaultInstance()) { + getStartBuilder().mergeFrom(value); + } else { + start_ = value; + } + } else { + startBuilder_.mergeFrom(value); + } + if (start_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. Start of the issue.
+     * 
+ * + * .google.cloud.apihub.v1.Point start = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearStart() { + bitField0_ = (bitField0_ & ~0x00000001); + start_ = null; + if (startBuilder_ != null) { + startBuilder_.dispose(); + startBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Start of the issue.
+     * 
+ * + * .google.cloud.apihub.v1.Point start = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.Point.Builder getStartBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getStartFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Start of the issue.
+     * 
+ * + * .google.cloud.apihub.v1.Point start = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.PointOrBuilder getStartOrBuilder() { + if (startBuilder_ != null) { + return startBuilder_.getMessageOrBuilder(); + } else { + return start_ == null ? com.google.cloud.apihub.v1.Point.getDefaultInstance() : start_; + } + } + /** + * + * + *
+     * Required. Start of the issue.
+     * 
+ * + * .google.cloud.apihub.v1.Point start = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Point, + com.google.cloud.apihub.v1.Point.Builder, + com.google.cloud.apihub.v1.PointOrBuilder> + getStartFieldBuilder() { + if (startBuilder_ == null) { + startBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Point, + com.google.cloud.apihub.v1.Point.Builder, + com.google.cloud.apihub.v1.PointOrBuilder>( + getStart(), getParentForChildren(), isClean()); + start_ = null; + } + return startBuilder_; + } + + private com.google.cloud.apihub.v1.Point end_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Point, + com.google.cloud.apihub.v1.Point.Builder, + com.google.cloud.apihub.v1.PointOrBuilder> + endBuilder_; + /** + * + * + *
+     * Required. End of the issue.
+     * 
+ * + * .google.cloud.apihub.v1.Point end = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the end field is set. + */ + public boolean hasEnd() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. End of the issue.
+     * 
+ * + * .google.cloud.apihub.v1.Point end = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The end. + */ + public com.google.cloud.apihub.v1.Point getEnd() { + if (endBuilder_ == null) { + return end_ == null ? com.google.cloud.apihub.v1.Point.getDefaultInstance() : end_; + } else { + return endBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. End of the issue.
+     * 
+ * + * .google.cloud.apihub.v1.Point end = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setEnd(com.google.cloud.apihub.v1.Point value) { + if (endBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + end_ = value; + } else { + endBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. End of the issue.
+     * 
+ * + * .google.cloud.apihub.v1.Point end = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setEnd(com.google.cloud.apihub.v1.Point.Builder builderForValue) { + if (endBuilder_ == null) { + end_ = builderForValue.build(); + } else { + endBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. End of the issue.
+     * 
+ * + * .google.cloud.apihub.v1.Point end = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeEnd(com.google.cloud.apihub.v1.Point value) { + if (endBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && end_ != null + && end_ != com.google.cloud.apihub.v1.Point.getDefaultInstance()) { + getEndBuilder().mergeFrom(value); + } else { + end_ = value; + } + } else { + endBuilder_.mergeFrom(value); + } + if (end_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. End of the issue.
+     * 
+ * + * .google.cloud.apihub.v1.Point end = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearEnd() { + bitField0_ = (bitField0_ & ~0x00000002); + end_ = null; + if (endBuilder_ != null) { + endBuilder_.dispose(); + endBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. End of the issue.
+     * 
+ * + * .google.cloud.apihub.v1.Point end = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.apihub.v1.Point.Builder getEndBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getEndFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. End of the issue.
+     * 
+ * + * .google.cloud.apihub.v1.Point end = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.apihub.v1.PointOrBuilder getEndOrBuilder() { + if (endBuilder_ != null) { + return endBuilder_.getMessageOrBuilder(); + } else { + return end_ == null ? com.google.cloud.apihub.v1.Point.getDefaultInstance() : end_; + } + } + /** + * + * + *
+     * Required. End of the issue.
+     * 
+ * + * .google.cloud.apihub.v1.Point end = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Point, + com.google.cloud.apihub.v1.Point.Builder, + com.google.cloud.apihub.v1.PointOrBuilder> + getEndFieldBuilder() { + if (endBuilder_ == null) { + endBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Point, + com.google.cloud.apihub.v1.Point.Builder, + com.google.cloud.apihub.v1.PointOrBuilder>( + getEnd(), getParentForChildren(), isClean()); + end_ = null; + } + return endBuilder_; + } + + @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.apihub.v1.Range) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.Range) + private static final com.google.cloud.apihub.v1.Range DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.Range(); + } + + public static com.google.cloud.apihub.v1.Range getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Range parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.Range getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/RangeOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/RangeOrBuilder.java new file mode 100644 index 000000000000..f477da65fabc --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/RangeOrBuilder.java @@ -0,0 +1,96 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface RangeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.Range) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Start of the issue.
+   * 
+ * + * .google.cloud.apihub.v1.Point start = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the start field is set. + */ + boolean hasStart(); + /** + * + * + *
+   * Required. Start of the issue.
+   * 
+ * + * .google.cloud.apihub.v1.Point start = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The start. + */ + com.google.cloud.apihub.v1.Point getStart(); + /** + * + * + *
+   * Required. Start of the issue.
+   * 
+ * + * .google.cloud.apihub.v1.Point start = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.apihub.v1.PointOrBuilder getStartOrBuilder(); + + /** + * + * + *
+   * Required. End of the issue.
+   * 
+ * + * .google.cloud.apihub.v1.Point end = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the end field is set. + */ + boolean hasEnd(); + /** + * + * + *
+   * Required. End of the issue.
+   * 
+ * + * .google.cloud.apihub.v1.Point end = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The end. + */ + com.google.cloud.apihub.v1.Point getEnd(); + /** + * + * + *
+   * Required. End of the issue.
+   * 
+ * + * .google.cloud.apihub.v1.Point end = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.apihub.v1.PointOrBuilder getEndOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/RuntimeProjectAttachment.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/RuntimeProjectAttachment.java new file mode 100644 index 000000000000..c9da664a4d4d --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/RuntimeProjectAttachment.java @@ -0,0 +1,1151 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/runtime_project_attachment_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * Runtime project attachment represents an attachment from the runtime project
+ * to the host project. Api Hub looks for deployments in the attached runtime
+ * projects and creates corresponding resources in Api Hub for the discovered
+ * deployments.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.RuntimeProjectAttachment} + */ +public final class RuntimeProjectAttachment extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.RuntimeProjectAttachment) + RuntimeProjectAttachmentOrBuilder { + private static final long serialVersionUID = 0L; + // Use RuntimeProjectAttachment.newBuilder() to construct. + private RuntimeProjectAttachment(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RuntimeProjectAttachment() { + name_ = ""; + runtimeProject_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RuntimeProjectAttachment(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_RuntimeProjectAttachment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_RuntimeProjectAttachment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.RuntimeProjectAttachment.class, + com.google.cloud.apihub.v1.RuntimeProjectAttachment.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. The resource name of a runtime project attachment. Format:
+   * "projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+   * Identifier. The resource name of a runtime project attachment. Format:
+   * "projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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 RUNTIME_PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object runtimeProject_ = ""; + /** + * + * + *
+   * Required. Immutable. Google cloud project name in the format:
+   * "projects/abc" or "projects/123". As input, project name with either
+   * project id or number are accepted. As output, this field will contain
+   * project number.
+   * 
+ * + * + * string runtime_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The runtimeProject. + */ + @java.lang.Override + public java.lang.String getRuntimeProject() { + java.lang.Object ref = runtimeProject_; + 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(); + runtimeProject_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Immutable. Google cloud project name in the format:
+   * "projects/abc" or "projects/123". As input, project name with either
+   * project id or number are accepted. As output, this field will contain
+   * project number.
+   * 
+ * + * + * string runtime_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for runtimeProject. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRuntimeProjectBytes() { + java.lang.Object ref = runtimeProject_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + runtimeProject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. Create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.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. Create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(runtimeProject_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, runtimeProject_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getCreateTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(runtimeProject_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, runtimeProject_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCreateTime()); + } + size += getUnknownFields().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.apihub.v1.RuntimeProjectAttachment)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.RuntimeProjectAttachment other = + (com.google.cloud.apihub.v1.RuntimeProjectAttachment) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRuntimeProject().equals(other.getRuntimeProject())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + RUNTIME_PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getRuntimeProject().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.RuntimeProjectAttachment parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.RuntimeProjectAttachment 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.apihub.v1.RuntimeProjectAttachment parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.RuntimeProjectAttachment 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.apihub.v1.RuntimeProjectAttachment parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.RuntimeProjectAttachment parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.RuntimeProjectAttachment parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.RuntimeProjectAttachment 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.apihub.v1.RuntimeProjectAttachment parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.RuntimeProjectAttachment 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.apihub.v1.RuntimeProjectAttachment parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.RuntimeProjectAttachment 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.apihub.v1.RuntimeProjectAttachment 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 project attachment represents an attachment from the runtime project
+   * to the host project. Api Hub looks for deployments in the attached runtime
+   * projects and creates corresponding resources in Api Hub for the discovered
+   * deployments.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.RuntimeProjectAttachment} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.RuntimeProjectAttachment) + com.google.cloud.apihub.v1.RuntimeProjectAttachmentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_RuntimeProjectAttachment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_RuntimeProjectAttachment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.RuntimeProjectAttachment.class, + com.google.cloud.apihub.v1.RuntimeProjectAttachment.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.RuntimeProjectAttachment.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCreateTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + runtimeProject_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceProto + .internal_static_google_cloud_apihub_v1_RuntimeProjectAttachment_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.RuntimeProjectAttachment getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.RuntimeProjectAttachment.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.RuntimeProjectAttachment build() { + com.google.cloud.apihub.v1.RuntimeProjectAttachment result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.RuntimeProjectAttachment buildPartial() { + com.google.cloud.apihub.v1.RuntimeProjectAttachment result = + new com.google.cloud.apihub.v1.RuntimeProjectAttachment(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.RuntimeProjectAttachment result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.runtimeProject_ = runtimeProject_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.RuntimeProjectAttachment) { + return mergeFrom((com.google.cloud.apihub.v1.RuntimeProjectAttachment) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.RuntimeProjectAttachment other) { + if (other == com.google.cloud.apihub.v1.RuntimeProjectAttachment.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRuntimeProject().isEmpty()) { + runtimeProject_ = other.runtimeProject_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + runtimeProject_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. The resource name of a runtime project attachment. Format:
+     * "projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. The resource name of a runtime project attachment. Format:
+     * "projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. The resource name of a runtime project attachment. Format:
+     * "projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The resource name of a runtime project attachment. Format:
+     * "projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The resource name of a runtime project attachment. Format:
+     * "projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object runtimeProject_ = ""; + /** + * + * + *
+     * Required. Immutable. Google cloud project name in the format:
+     * "projects/abc" or "projects/123". As input, project name with either
+     * project id or number are accepted. As output, this field will contain
+     * project number.
+     * 
+ * + * + * string runtime_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The runtimeProject. + */ + public java.lang.String getRuntimeProject() { + java.lang.Object ref = runtimeProject_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + runtimeProject_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Immutable. Google cloud project name in the format:
+     * "projects/abc" or "projects/123". As input, project name with either
+     * project id or number are accepted. As output, this field will contain
+     * project number.
+     * 
+ * + * + * string runtime_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for runtimeProject. + */ + public com.google.protobuf.ByteString getRuntimeProjectBytes() { + java.lang.Object ref = runtimeProject_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + runtimeProject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Immutable. Google cloud project name in the format:
+     * "projects/abc" or "projects/123". As input, project name with either
+     * project id or number are accepted. As output, this field will contain
+     * project number.
+     * 
+ * + * + * string runtime_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @param value The runtimeProject to set. + * @return This builder for chaining. + */ + public Builder setRuntimeProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + runtimeProject_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. Google cloud project name in the format:
+     * "projects/abc" or "projects/123". As input, project name with either
+     * project id or number are accepted. As output, this field will contain
+     * project number.
+     * 
+ * + * + * string runtime_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearRuntimeProject() { + runtimeProject_ = getDefaultInstance().getRuntimeProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. Google cloud project name in the format:
+     * "projects/abc" or "projects/123". As input, project name with either
+     * project id or number are accepted. As output, this field will contain
+     * project number.
+     * 
+ * + * + * string runtime_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for runtimeProject to set. + * @return This builder for chaining. + */ + public Builder setRuntimeProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + runtimeProject_ = value; + bitField0_ |= 0x00000002; + 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. Create time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. Create time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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. Create time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Create time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000004); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Create time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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. Create time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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_; + } + + @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.apihub.v1.RuntimeProjectAttachment) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.RuntimeProjectAttachment) + private static final com.google.cloud.apihub.v1.RuntimeProjectAttachment DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.RuntimeProjectAttachment(); + } + + public static com.google.cloud.apihub.v1.RuntimeProjectAttachment getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RuntimeProjectAttachment parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.RuntimeProjectAttachment getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentName.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentName.java new file mode 100644 index 000000000000..5406e5fa7db2 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentName.java @@ -0,0 +1,240 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +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 RuntimeProjectAttachmentName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_RUNTIME_PROJECT_ATTACHMENT = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String runtimeProjectAttachment; + + @Deprecated + protected RuntimeProjectAttachmentName() { + project = null; + location = null; + runtimeProjectAttachment = null; + } + + private RuntimeProjectAttachmentName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + runtimeProjectAttachment = Preconditions.checkNotNull(builder.getRuntimeProjectAttachment()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getRuntimeProjectAttachment() { + return runtimeProjectAttachment; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static RuntimeProjectAttachmentName of( + String project, String location, String runtimeProjectAttachment) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setRuntimeProjectAttachment(runtimeProjectAttachment) + .build(); + } + + public static String format(String project, String location, String runtimeProjectAttachment) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setRuntimeProjectAttachment(runtimeProjectAttachment) + .build() + .toString(); + } + + public static RuntimeProjectAttachmentName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_RUNTIME_PROJECT_ATTACHMENT.validatedMatch( + formattedString, + "RuntimeProjectAttachmentName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("runtime_project_attachment")); + } + + 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 (RuntimeProjectAttachmentName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_RUNTIME_PROJECT_ATTACHMENT.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); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (runtimeProjectAttachment != null) { + fieldMapBuilder.put("runtime_project_attachment", runtimeProjectAttachment); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_RUNTIME_PROJECT_ATTACHMENT.instantiate( + "project", + project, + "location", + location, + "runtime_project_attachment", + runtimeProjectAttachment); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + RuntimeProjectAttachmentName that = ((RuntimeProjectAttachmentName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.runtimeProjectAttachment, that.runtimeProjectAttachment); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(runtimeProjectAttachment); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}. + */ + public static class Builder { + private String project; + private String location; + private String runtimeProjectAttachment; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getRuntimeProjectAttachment() { + return runtimeProjectAttachment; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setRuntimeProjectAttachment(String runtimeProjectAttachment) { + this.runtimeProjectAttachment = runtimeProjectAttachment; + return this; + } + + private Builder(RuntimeProjectAttachmentName runtimeProjectAttachmentName) { + this.project = runtimeProjectAttachmentName.project; + this.location = runtimeProjectAttachmentName.location; + this.runtimeProjectAttachment = runtimeProjectAttachmentName.runtimeProjectAttachment; + } + + public RuntimeProjectAttachmentName build() { + return new RuntimeProjectAttachmentName(this); + } + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentOrBuilder.java new file mode 100644 index 000000000000..f93504a86840 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentOrBuilder.java @@ -0,0 +1,126 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/runtime_project_attachment_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface RuntimeProjectAttachmentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.RuntimeProjectAttachment) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. The resource name of a runtime project attachment. Format:
+   * "projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. The resource name of a runtime project attachment. Format:
+   * "projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. Immutable. Google cloud project name in the format:
+   * "projects/abc" or "projects/123". As input, project name with either
+   * project id or number are accepted. As output, this field will contain
+   * project number.
+   * 
+ * + * + * string runtime_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The runtimeProject. + */ + java.lang.String getRuntimeProject(); + /** + * + * + *
+   * Required. Immutable. Google cloud project name in the format:
+   * "projects/abc" or "projects/123". As input, project name with either
+   * project id or number are accepted. As output, this field will contain
+   * project number.
+   * 
+ * + * + * string runtime_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for runtimeProject. + */ + com.google.protobuf.ByteString getRuntimeProjectBytes(); + + /** + * + * + *
+   * Output only. Create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentServiceProto.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentServiceProto.java new file mode 100644 index 000000000000..58caf52e43a5 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/RuntimeProjectAttachmentServiceProto.java @@ -0,0 +1,250 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/runtime_project_attachment_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public final class RuntimeProjectAttachmentServiceProto { + private RuntimeProjectAttachmentServiceProto() {} + + 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_apihub_v1_CreateRuntimeProjectAttachmentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_CreateRuntimeProjectAttachmentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_GetRuntimeProjectAttachmentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_GetRuntimeProjectAttachmentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_ListRuntimeProjectAttachmentsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_ListRuntimeProjectAttachmentsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_ListRuntimeProjectAttachmentsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_ListRuntimeProjectAttachmentsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_DeleteRuntimeProjectAttachmentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_DeleteRuntimeProjectAttachmentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_LookupRuntimeProjectAttachmentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_LookupRuntimeProjectAttachmentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_LookupRuntimeProjectAttachmentResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_LookupRuntimeProjectAttachmentResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apihub_v1_RuntimeProjectAttachment_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apihub_v1_RuntimeProjectAttachment_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/apihub/v1/runtime_project" + + "_attachment_service.proto\022\026google.cloud." + + "apihub.v1\032\034google/api/annotations.proto\032" + + "\027google/api/client.proto\032\037google/api/fie" + + "ld_behavior.proto\032\031google/api/resource.p" + + "roto\032\033google/protobuf/empty.proto\032\037googl" + + "e/protobuf/timestamp.proto\"\366\001\n%CreateRun" + + "timeProjectAttachmentRequest\022F\n\006parent\030\001" + + " \001(\tB6\340A\002\372A0\022.apihub.googleapis.com/Runt" + + "imeProjectAttachment\022*\n\035runtime_project_" + + "attachment_id\030\002 \001(\tB\003\340A\002\022Y\n\032runtime_proj" + + "ect_attachment\030\003 \001(\01320.google.cloud.apih" + + "ub.v1.RuntimeProjectAttachmentB\003\340A\002\"j\n\"G" + + "etRuntimeProjectAttachmentRequest\022D\n\004nam" + + "e\030\001 \001(\tB6\340A\002\372A0\n.apihub.googleapis.com/R" + + "untimeProjectAttachment\"\313\001\n$ListRuntimeP" + + "rojectAttachmentsRequest\022F\n\006parent\030\001 \001(\t" + + "B6\340A\002\372A0\022.apihub.googleapis.com/RuntimeP" + + "rojectAttachment\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\023\n\006filter\030\004 \001(" + + "\tB\003\340A\001\022\025\n\010order_by\030\005 \001(\tB\003\340A\001\"\227\001\n%ListRu" + + "ntimeProjectAttachmentsResponse\022U\n\033runti" + + "me_project_attachments\030\001 \003(\01320.google.cl" + + "oud.apihub.v1.RuntimeProjectAttachment\022\027" + + "\n\017next_page_token\030\002 \001(\t\"m\n%DeleteRuntime" + + "ProjectAttachmentRequest\022D\n\004name\030\001 \001(\tB6" + + "\340A\002\372A0\n.apihub.googleapis.com/RuntimePro" + + "jectAttachment\"`\n%LookupRuntimeProjectAt" + + "tachmentRequest\0227\n\004name\030\001 \001(\tB)\340A\002\372A#\n!l" + + "ocations.googleapis.com/Location\"~\n&Look" + + "upRuntimeProjectAttachmentResponse\022T\n\032ru" + + "ntime_project_attachment\030\001 \001(\01320.google." + + "cloud.apihub.v1.RuntimeProjectAttachment" + + "\"\200\003\n\030RuntimeProjectAttachment\022\021\n\004name\030\001 " + + "\001(\tB\003\340A\010\022O\n\017runtime_project\030\002 \001(\tB6\340A\002\340A" + + "\005\372A-\n+cloudresourcemanager.googleapis.co" + + "m/Project\0224\n\013create_time\030\003 \001(\0132\032.google." + + "protobuf.TimestampB\003\340A\003:\311\001\352A\305\001\n.apihub.g" + + "oogleapis.com/RuntimeProjectAttachment\022^" + + "projects/{project}/locations/{location}/" + + "runtimeProjectAttachments/{runtime_proje" + + "ct_attachment}*\031runtimeProjectAttachment" + + "s2\030runtimeProjectAttachment2\254\n\n\037RuntimeP" + + "rojectAttachmentService\022\267\002\n\036CreateRuntim" + + "eProjectAttachment\022=.google.cloud.apihub" + + ".v1.CreateRuntimeProjectAttachmentReques" + + "t\0320.google.cloud.apihub.v1.RuntimeProjec" + + "tAttachment\"\243\001\332A?parent,runtime_project_" + + "attachment,runtime_project_attachment_id" + + "\202\323\344\223\002[\"=/v1/{parent=projects/*/locations" + + "/*}/runtimeProjectAttachments:\032runtime_p" + + "roject_attachment\022\331\001\n\033GetRuntimeProjectA" + + "ttachment\022:.google.cloud.apihub.v1.GetRu" + + "ntimeProjectAttachmentRequest\0320.google.c" + + "loud.apihub.v1.RuntimeProjectAttachment\"" + + "L\332A\004name\202\323\344\223\002?\022=/v1/{name=projects/*/loc" + + "ations/*/runtimeProjectAttachments/*}\022\354\001" + + "\n\035ListRuntimeProjectAttachments\022<.google" + + ".cloud.apihub.v1.ListRuntimeProjectAttac" + + "hmentsRequest\032=.google.cloud.apihub.v1.L" + + "istRuntimeProjectAttachmentsResponse\"N\332A" + + "\006parent\202\323\344\223\002?\022=/v1/{parent=projects/*/lo" + + "cations/*}/runtimeProjectAttachments\022\305\001\n" + + "\036DeleteRuntimeProjectAttachment\022=.google" + + ".cloud.apihub.v1.DeleteRuntimeProjectAtt" + + "achmentRequest\032\026.google.protobuf.Empty\"L" + + "\332A\004name\202\323\344\223\002?*=/v1/{name=projects/*/loca" + + "tions/*/runtimeProjectAttachments/*}\022\360\001\n" + + "\036LookupRuntimeProjectAttachment\022=.google" + + ".cloud.apihub.v1.LookupRuntimeProjectAtt" + + "achmentRequest\032>.google.cloud.apihub.v1." + + "LookupRuntimeProjectAttachmentResponse\"O" + + "\332A\004name\202\323\344\223\002B\022@/v1/{name=projects/*/loca" + + "tions/*}:lookupRuntimeProjectAttachment\032" + + "I\312A\025apihub.googleapis.com\322A.https://www." + + "googleapis.com/auth/cloud-platformB\306\001\n\032c" + + "om.google.cloud.apihub.v1B$RuntimeProjec" + + "tAttachmentServiceProtoP\001Z2cloud.google." + + "com/go/apihub/apiv1/apihubpb;apihubpb\252\002\026" + + "Google.Cloud.ApiHub.V1\312\002\026Google\\Cloud\\Ap" + + "iHub\\V1\352\002\031Google::Cloud::ApiHub::V1b\006pro" + + "to3" + }; + 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.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_apihub_v1_CreateRuntimeProjectAttachmentRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_apihub_v1_CreateRuntimeProjectAttachmentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_CreateRuntimeProjectAttachmentRequest_descriptor, + new java.lang.String[] { + "Parent", "RuntimeProjectAttachmentId", "RuntimeProjectAttachment", + }); + internal_static_google_cloud_apihub_v1_GetRuntimeProjectAttachmentRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_apihub_v1_GetRuntimeProjectAttachmentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_GetRuntimeProjectAttachmentRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_apihub_v1_ListRuntimeProjectAttachmentsRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_apihub_v1_ListRuntimeProjectAttachmentsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_ListRuntimeProjectAttachmentsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_apihub_v1_ListRuntimeProjectAttachmentsResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_apihub_v1_ListRuntimeProjectAttachmentsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_ListRuntimeProjectAttachmentsResponse_descriptor, + new java.lang.String[] { + "RuntimeProjectAttachments", "NextPageToken", + }); + internal_static_google_cloud_apihub_v1_DeleteRuntimeProjectAttachmentRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_apihub_v1_DeleteRuntimeProjectAttachmentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_DeleteRuntimeProjectAttachmentRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_apihub_v1_LookupRuntimeProjectAttachmentRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_apihub_v1_LookupRuntimeProjectAttachmentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_LookupRuntimeProjectAttachmentRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_apihub_v1_LookupRuntimeProjectAttachmentResponse_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_apihub_v1_LookupRuntimeProjectAttachmentResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_LookupRuntimeProjectAttachmentResponse_descriptor, + new java.lang.String[] { + "RuntimeProjectAttachment", + }); + internal_static_google_cloud_apihub_v1_RuntimeProjectAttachment_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_apihub_v1_RuntimeProjectAttachment_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apihub_v1_RuntimeProjectAttachment_descriptor, + new java.lang.String[] { + "Name", "RuntimeProject", "CreateTime", + }); + 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.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Schema.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Schema.java new file mode 100644 index 000000000000..6c76ce285974 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Schema.java @@ -0,0 +1,736 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The schema details derived from the spec. Currently, this entity is supported
+ * for OpenAPI spec only.
+ * For OpenAPI spec, this maps to the schema defined in
+ * the  `definitions` section for OpenAPI 2.0 version and in
+ * `components.schemas` section for OpenAPI 3.0 and 3.1 version.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Schema} + */ +public final class Schema extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.Schema) + SchemaOrBuilder { + private static final long serialVersionUID = 0L; + // Use Schema.newBuilder() to construct. + private Schema(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Schema() { + displayName_ = ""; + rawValue_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Schema(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Schema_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Schema_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Schema.class, + com.google.cloud.apihub.v1.Schema.Builder.class); + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * Output only. The display name of the schema.
+   * This will map to the name of the schema in the spec.
+   * 
+ * + * string display_name = 1 [(.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. The display name of the schema.
+   * This will map to the name of the schema in the spec.
+   * 
+ * + * string display_name = 1 [(.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 RAW_VALUE_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString rawValue_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+   * Output only. The raw value of the schema definition corresponding to the
+   * schema name in the spec.
+   * 
+ * + * bytes raw_value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The rawValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRawValue() { + return rawValue_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, displayName_); + } + if (!rawValue_.isEmpty()) { + output.writeBytes(2, rawValue_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, displayName_); + } + if (!rawValue_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, rawValue_); + } + size += getUnknownFields().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.apihub.v1.Schema)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.Schema other = (com.google.cloud.apihub.v1.Schema) obj; + + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getRawValue().equals(other.getRawValue())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + RAW_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getRawValue().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.Schema parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Schema 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.apihub.v1.Schema parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Schema 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.apihub.v1.Schema parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Schema parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.Schema parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Schema 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.apihub.v1.Schema parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Schema 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.apihub.v1.Schema parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Schema 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.apihub.v1.Schema 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 schema details derived from the spec. Currently, this entity is supported
+   * for OpenAPI spec only.
+   * For OpenAPI spec, this maps to the schema defined in
+   * the  `definitions` section for OpenAPI 2.0 version and in
+   * `components.schemas` section for OpenAPI 3.0 and 3.1 version.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Schema} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.Schema) + com.google.cloud.apihub.v1.SchemaOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Schema_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Schema_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Schema.class, + com.google.cloud.apihub.v1.Schema.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.Schema.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + displayName_ = ""; + rawValue_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Schema_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Schema getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.Schema.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Schema build() { + com.google.cloud.apihub.v1.Schema result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Schema buildPartial() { + com.google.cloud.apihub.v1.Schema result = new com.google.cloud.apihub.v1.Schema(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.Schema result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.rawValue_ = rawValue_; + } + } + + @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.apihub.v1.Schema) { + return mergeFrom((com.google.cloud.apihub.v1.Schema) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.Schema other) { + if (other == com.google.cloud.apihub.v1.Schema.getDefaultInstance()) return this; + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getRawValue() != com.google.protobuf.ByteString.EMPTY) { + setRawValue(other.getRawValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + rawValue_ = input.readBytes(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Output only. The display name of the schema.
+     * This will map to the name of the schema in the spec.
+     * 
+ * + * string display_name = 1 [(.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. The display name of the schema.
+     * This will map to the name of the schema in the spec.
+     * 
+ * + * string display_name = 1 [(.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. The display name of the schema.
+     * This will map to the name of the schema in the spec.
+     * 
+ * + * string display_name = 1 [(.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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The display name of the schema.
+     * This will map to the name of the schema in the spec.
+     * 
+ * + * string display_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The display name of the schema.
+     * This will map to the name of the schema in the spec.
+     * 
+ * + * string display_name = 1 [(.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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString rawValue_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * Output only. The raw value of the schema definition corresponding to the
+     * schema name in the spec.
+     * 
+ * + * bytes raw_value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The rawValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRawValue() { + return rawValue_; + } + /** + * + * + *
+     * Output only. The raw value of the schema definition corresponding to the
+     * schema name in the spec.
+     * 
+ * + * bytes raw_value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The rawValue to set. + * @return This builder for chaining. + */ + public Builder setRawValue(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + rawValue_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The raw value of the schema definition corresponding to the
+     * schema name in the spec.
+     * 
+ * + * bytes raw_value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearRawValue() { + bitField0_ = (bitField0_ & ~0x00000002); + rawValue_ = getDefaultInstance().getRawValue(); + 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.apihub.v1.Schema) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.Schema) + private static final com.google.cloud.apihub.v1.Schema DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.Schema(); + } + + public static com.google.cloud.apihub.v1.Schema getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Schema parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.Schema getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SchemaOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SchemaOrBuilder.java new file mode 100644 index 000000000000..27492d978bcc --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SchemaOrBuilder.java @@ -0,0 +1,67 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface SchemaOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.Schema) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The display name of the schema.
+   * This will map to the name of the schema in the spec.
+   * 
+ * + * string display_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Output only. The display name of the schema.
+   * This will map to the name of the schema in the spec.
+   * 
+ * + * string display_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Output only. The raw value of the schema definition corresponding to the
+   * schema name in the spec.
+   * 
+ * + * bytes raw_value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The rawValue. + */ + com.google.protobuf.ByteString getRawValue(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SearchResourcesRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SearchResourcesRequest.java new file mode 100644 index 000000000000..2abfbf1cd01f --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SearchResourcesRequest.java @@ -0,0 +1,1496 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [SearchResources][google.cloud.apihub.v1.ApiHub.SearchResources] method's
+ * request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.SearchResourcesRequest} + */ +public final class SearchResourcesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.SearchResourcesRequest) + SearchResourcesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchResourcesRequest.newBuilder() to construct. + private SearchResourcesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchResourcesRequest() { + location_ = ""; + query_ = ""; + filter_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchResourcesRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_SearchResourcesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_SearchResourcesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.SearchResourcesRequest.class, + com.google.cloud.apihub.v1.SearchResourcesRequest.Builder.class); + } + + public static final int LOCATION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object location_ = ""; + /** + * + * + *
+   * Required. The resource name of the location which will be of the type
+   * `projects/{project_id}/locations/{location_id}`. This field is used to
+   * identify the instance of API-Hub in which resources should be searched.
+   * 
+ * + * + * string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The location. + */ + @java.lang.Override + public java.lang.String getLocation() { + java.lang.Object ref = location_; + 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(); + location_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the location which will be of the type
+   * `projects/{project_id}/locations/{location_id}`. This field is used to
+   * identify the instance of API-Hub in which resources should be searched.
+   * 
+ * + * + * string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for location. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERY_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object query_ = ""; + /** + * + * + *
+   * Required. The free text search query. This query can contain keywords which
+   * could be related to any detail of the API-Hub resources such display names,
+   * descriptions, attributes etc.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+   * Required. The free text search query. This query can contain keywords which
+   * could be related to any detail of the API-Hub resources such display names,
+   * descriptions, attributes etc.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 FILTER_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. An expression that filters the list of search results.
+   *
+   * A filter expression consists of a field name, a comparison operator,
+   * and a value for filtering. The value must be a string, a number, or a
+   * boolean. The comparison operator must be `=`. Filters are not case
+   * sensitive.
+   *
+   * The following field names are eligible for filtering:
+   *    * `resource_type` - The type of resource in the search results.
+   *    Must be one of the following: `Api`, `ApiOperation`, `Deployment`,
+   *    `Definition`, `Spec` or `Version`. This field can only be specified once
+   *    in the filter.
+   *
+   * Here are is an example:
+   *
+   *   * `resource_type = Api` - The resource_type is _Api_.
+   * 
+ * + * string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + 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(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An expression that filters the list of search results.
+   *
+   * A filter expression consists of a field name, a comparison operator,
+   * and a value for filtering. The value must be a string, a number, or a
+   * boolean. The comparison operator must be `=`. Filters are not case
+   * sensitive.
+   *
+   * The following field names are eligible for filtering:
+   *    * `resource_type` - The type of resource in the search results.
+   *    Must be one of the following: `Api`, `ApiOperation`, `Deployment`,
+   *    `Definition`, `Spec` or `Version`. This field can only be specified once
+   *    in the filter.
+   *
+   * Here are is an example:
+   *
+   *   * `resource_type = Api` - The resource_type is _Api_.
+   * 
+ * + * string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 4; + private int pageSize_ = 0; + /** + * + * + *
+   * Optional. The maximum number of search results to return. The service may
+   * return fewer than this value. If unspecified at most 10 search results will
+   * be returned. If value is negative then `INVALID_ARGUMENT` error is
+   * returned. The maximum value is 25; values above 25 will be coerced to 25.
+   * While paginating, you can specify a new page size parameter for each page
+   * of search results to be listed.
+   * 
+ * + * int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Optional. A page token, received from a previous
+   * [SearchResources][SearchResources]
+   * call. Specify this parameter to retrieve the next page of transactions.
+   *
+   * When paginating, you must specify the `page_token` parameter and all the
+   * other parameters except
+   * [page_size][google.cloud.apihub.v1.SearchResourcesRequest.page_size]
+   * should be specified with the same value which was used in the previous
+   * call. If the other fields are set with a different value than the previous
+   * call then `INVALID_ARGUMENT` error is returned.
+   * 
+ * + * string page_token = 5 [(.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 page token, received from a previous
+   * [SearchResources][SearchResources]
+   * call. Specify this parameter to retrieve the next page of transactions.
+   *
+   * When paginating, you must specify the `page_token` parameter and all the
+   * other parameters except
+   * [page_size][google.cloud.apihub.v1.SearchResourcesRequest.page_size]
+   * should be specified with the same value which was used in the previous
+   * call. If the other fields are set with a different value than the previous
+   * call then `INVALID_ARGUMENT` error is returned.
+   * 
+ * + * string page_token = 5 [(.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, location_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, query_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, filter_); + } + if (pageSize_ != 0) { + output.writeInt32(4, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, location_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, query_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, filter_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, pageToken_); + } + size += getUnknownFields().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.apihub.v1.SearchResourcesRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.SearchResourcesRequest other = + (com.google.cloud.apihub.v1.SearchResourcesRequest) obj; + + if (!getLocation().equals(other.getLocation())) return false; + if (!getQuery().equals(other.getQuery())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.SearchResourcesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.SearchResourcesRequest 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.apihub.v1.SearchResourcesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.SearchResourcesRequest 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.apihub.v1.SearchResourcesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.SearchResourcesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.SearchResourcesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.SearchResourcesRequest 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.apihub.v1.SearchResourcesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.SearchResourcesRequest 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.apihub.v1.SearchResourcesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.SearchResourcesRequest 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.apihub.v1.SearchResourcesRequest 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 [SearchResources][google.cloud.apihub.v1.ApiHub.SearchResources] method's
+   * request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.SearchResourcesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.SearchResourcesRequest) + com.google.cloud.apihub.v1.SearchResourcesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_SearchResourcesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_SearchResourcesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.SearchResourcesRequest.class, + com.google.cloud.apihub.v1.SearchResourcesRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.SearchResourcesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + location_ = ""; + query_ = ""; + filter_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_SearchResourcesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.SearchResourcesRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.SearchResourcesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.SearchResourcesRequest build() { + com.google.cloud.apihub.v1.SearchResourcesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.SearchResourcesRequest buildPartial() { + com.google.cloud.apihub.v1.SearchResourcesRequest result = + new com.google.cloud.apihub.v1.SearchResourcesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.SearchResourcesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.location_ = location_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.query_ = query_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @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.apihub.v1.SearchResourcesRequest) { + return mergeFrom((com.google.cloud.apihub.v1.SearchResourcesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.SearchResourcesRequest other) { + if (other == com.google.cloud.apihub.v1.SearchResourcesRequest.getDefaultInstance()) + return this; + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + location_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + query_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object location_ = ""; + /** + * + * + *
+     * Required. The resource name of the location which will be of the type
+     * `projects/{project_id}/locations/{location_id}`. This field is used to
+     * identify the instance of API-Hub in which resources should be searched.
+     * 
+ * + * + * string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The location. + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the location which will be of the type
+     * `projects/{project_id}/locations/{location_id}`. This field is used to
+     * identify the instance of API-Hub in which resources should be searched.
+     * 
+ * + * + * string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for location. + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the location which will be of the type
+     * `projects/{project_id}/locations/{location_id}`. This field is used to
+     * identify the instance of API-Hub in which resources should be searched.
+     * 
+ * + * + * string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The location to set. + * @return This builder for chaining. + */ + public Builder setLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + location_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the location which will be of the type
+     * `projects/{project_id}/locations/{location_id}`. This field is used to
+     * identify the instance of API-Hub in which resources should be searched.
+     * 
+ * + * + * string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearLocation() { + location_ = getDefaultInstance().getLocation(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the location which will be of the type
+     * `projects/{project_id}/locations/{location_id}`. This field is used to
+     * identify the instance of API-Hub in which resources should be searched.
+     * 
+ * + * + * string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for location to set. + * @return This builder for chaining. + */ + public Builder setLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + location_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object query_ = ""; + /** + * + * + *
+     * Required. The free text search query. This query can contain keywords which
+     * could be related to any detail of the API-Hub resources such display names,
+     * descriptions, attributes etc.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. The free text search query. This query can contain keywords which
+     * could be related to any detail of the API-Hub resources such display names,
+     * descriptions, attributes etc.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. The free text search query. This query can contain keywords which
+     * could be related to any detail of the API-Hub resources such display names,
+     * descriptions, attributes etc.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The free text search query. This query can contain keywords which
+     * could be related to any detail of the API-Hub resources such display names,
+     * descriptions, attributes etc.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + query_ = getDefaultInstance().getQuery(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The free text search query. This query can contain keywords which
+     * could be related to any detail of the API-Hub resources such display names,
+     * descriptions, attributes etc.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. An expression that filters the list of search results.
+     *
+     * A filter expression consists of a field name, a comparison operator,
+     * and a value for filtering. The value must be a string, a number, or a
+     * boolean. The comparison operator must be `=`. Filters are not case
+     * sensitive.
+     *
+     * The following field names are eligible for filtering:
+     *    * `resource_type` - The type of resource in the search results.
+     *    Must be one of the following: `Api`, `ApiOperation`, `Deployment`,
+     *    `Definition`, `Spec` or `Version`. This field can only be specified once
+     *    in the filter.
+     *
+     * Here are is an example:
+     *
+     *   * `resource_type = Api` - The resource_type is _Api_.
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An expression that filters the list of search results.
+     *
+     * A filter expression consists of a field name, a comparison operator,
+     * and a value for filtering. The value must be a string, a number, or a
+     * boolean. The comparison operator must be `=`. Filters are not case
+     * sensitive.
+     *
+     * The following field names are eligible for filtering:
+     *    * `resource_type` - The type of resource in the search results.
+     *    Must be one of the following: `Api`, `ApiOperation`, `Deployment`,
+     *    `Definition`, `Spec` or `Version`. This field can only be specified once
+     *    in the filter.
+     *
+     * Here are is an example:
+     *
+     *   * `resource_type = Api` - The resource_type is _Api_.
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An expression that filters the list of search results.
+     *
+     * A filter expression consists of a field name, a comparison operator,
+     * and a value for filtering. The value must be a string, a number, or a
+     * boolean. The comparison operator must be `=`. Filters are not case
+     * sensitive.
+     *
+     * The following field names are eligible for filtering:
+     *    * `resource_type` - The type of resource in the search results.
+     *    Must be one of the following: `Api`, `ApiOperation`, `Deployment`,
+     *    `Definition`, `Spec` or `Version`. This field can only be specified once
+     *    in the filter.
+     *
+     * Here are is an example:
+     *
+     *   * `resource_type = Api` - The resource_type is _Api_.
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An expression that filters the list of search results.
+     *
+     * A filter expression consists of a field name, a comparison operator,
+     * and a value for filtering. The value must be a string, a number, or a
+     * boolean. The comparison operator must be `=`. Filters are not case
+     * sensitive.
+     *
+     * The following field names are eligible for filtering:
+     *    * `resource_type` - The type of resource in the search results.
+     *    Must be one of the following: `Api`, `ApiOperation`, `Deployment`,
+     *    `Definition`, `Spec` or `Version`. This field can only be specified once
+     *    in the filter.
+     *
+     * Here are is an example:
+     *
+     *   * `resource_type = Api` - The resource_type is _Api_.
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An expression that filters the list of search results.
+     *
+     * A filter expression consists of a field name, a comparison operator,
+     * and a value for filtering. The value must be a string, a number, or a
+     * boolean. The comparison operator must be `=`. Filters are not case
+     * sensitive.
+     *
+     * The following field names are eligible for filtering:
+     *    * `resource_type` - The type of resource in the search results.
+     *    Must be one of the following: `Api`, `ApiOperation`, `Deployment`,
+     *    `Definition`, `Spec` or `Version`. This field can only be specified once
+     *    in the filter.
+     *
+     * Here are is an example:
+     *
+     *   * `resource_type = Api` - The resource_type is _Api_.
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of search results to return. The service may
+     * return fewer than this value. If unspecified at most 10 search results will
+     * be returned. If value is negative then `INVALID_ARGUMENT` error is
+     * returned. The maximum value is 25; values above 25 will be coerced to 25.
+     * While paginating, you can specify a new page size parameter for each page
+     * of search results to be listed.
+     * 
+ * + * int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. The maximum number of search results to return. The service may
+     * return fewer than this value. If unspecified at most 10 search results will
+     * be returned. If value is negative then `INVALID_ARGUMENT` error is
+     * returned. The maximum value is 25; values above 25 will be coerced to 25.
+     * While paginating, you can specify a new page size parameter for each page
+     * of search results to be listed.
+     * 
+ * + * int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of search results to return. The service may
+     * return fewer than this value. If unspecified at most 10 search results will
+     * be returned. If value is negative then `INVALID_ARGUMENT` error is
+     * returned. The maximum value is 25; values above 25 will be coerced to 25.
+     * While paginating, you can specify a new page size parameter for each page
+     * of search results to be listed.
+     * 
+ * + * int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000008); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A page token, received from a previous
+     * [SearchResources][SearchResources]
+     * call. Specify this parameter to retrieve the next page of transactions.
+     *
+     * When paginating, you must specify the `page_token` parameter and all the
+     * other parameters except
+     * [page_size][google.cloud.apihub.v1.SearchResourcesRequest.page_size]
+     * should be specified with the same value which was used in the previous
+     * call. If the other fields are set with a different value than the previous
+     * call then `INVALID_ARGUMENT` error is returned.
+     * 
+ * + * string page_token = 5 [(.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 page token, received from a previous
+     * [SearchResources][SearchResources]
+     * call. Specify this parameter to retrieve the next page of transactions.
+     *
+     * When paginating, you must specify the `page_token` parameter and all the
+     * other parameters except
+     * [page_size][google.cloud.apihub.v1.SearchResourcesRequest.page_size]
+     * should be specified with the same value which was used in the previous
+     * call. If the other fields are set with a different value than the previous
+     * call then `INVALID_ARGUMENT` error is returned.
+     * 
+ * + * string page_token = 5 [(.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 page token, received from a previous
+     * [SearchResources][SearchResources]
+     * call. Specify this parameter to retrieve the next page of transactions.
+     *
+     * When paginating, you must specify the `page_token` parameter and all the
+     * other parameters except
+     * [page_size][google.cloud.apihub.v1.SearchResourcesRequest.page_size]
+     * should be specified with the same value which was used in the previous
+     * call. If the other fields are set with a different value than the previous
+     * call then `INVALID_ARGUMENT` error is returned.
+     * 
+ * + * string page_token = 5 [(.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; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous
+     * [SearchResources][SearchResources]
+     * call. Specify this parameter to retrieve the next page of transactions.
+     *
+     * When paginating, you must specify the `page_token` parameter and all the
+     * other parameters except
+     * [page_size][google.cloud.apihub.v1.SearchResourcesRequest.page_size]
+     * should be specified with the same value which was used in the previous
+     * call. If the other fields are set with a different value than the previous
+     * call then `INVALID_ARGUMENT` error is returned.
+     * 
+ * + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous
+     * [SearchResources][SearchResources]
+     * call. Specify this parameter to retrieve the next page of transactions.
+     *
+     * When paginating, you must specify the `page_token` parameter and all the
+     * other parameters except
+     * [page_size][google.cloud.apihub.v1.SearchResourcesRequest.page_size]
+     * should be specified with the same value which was used in the previous
+     * call. If the other fields are set with a different value than the previous
+     * call then `INVALID_ARGUMENT` error is returned.
+     * 
+ * + * string page_token = 5 [(.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; + bitField0_ |= 0x00000010; + 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.apihub.v1.SearchResourcesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.SearchResourcesRequest) + private static final com.google.cloud.apihub.v1.SearchResourcesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.SearchResourcesRequest(); + } + + public static com.google.cloud.apihub.v1.SearchResourcesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchResourcesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.SearchResourcesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SearchResourcesRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SearchResourcesRequestOrBuilder.java new file mode 100644 index 000000000000..83abcc26dd14 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SearchResourcesRequestOrBuilder.java @@ -0,0 +1,204 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface SearchResourcesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.SearchResourcesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the location which will be of the type
+   * `projects/{project_id}/locations/{location_id}`. This field is used to
+   * identify the instance of API-Hub in which resources should be searched.
+   * 
+ * + * + * string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The location. + */ + java.lang.String getLocation(); + /** + * + * + *
+   * Required. The resource name of the location which will be of the type
+   * `projects/{project_id}/locations/{location_id}`. This field is used to
+   * identify the instance of API-Hub in which resources should be searched.
+   * 
+ * + * + * string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for location. + */ + com.google.protobuf.ByteString getLocationBytes(); + + /** + * + * + *
+   * Required. The free text search query. This query can contain keywords which
+   * could be related to any detail of the API-Hub resources such display names,
+   * descriptions, attributes etc.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + java.lang.String getQuery(); + /** + * + * + *
+   * Required. The free text search query. This query can contain keywords which
+   * could be related to any detail of the API-Hub resources such display names,
+   * descriptions, attributes etc.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); + + /** + * + * + *
+   * Optional. An expression that filters the list of search results.
+   *
+   * A filter expression consists of a field name, a comparison operator,
+   * and a value for filtering. The value must be a string, a number, or a
+   * boolean. The comparison operator must be `=`. Filters are not case
+   * sensitive.
+   *
+   * The following field names are eligible for filtering:
+   *    * `resource_type` - The type of resource in the search results.
+   *    Must be one of the following: `Api`, `ApiOperation`, `Deployment`,
+   *    `Definition`, `Spec` or `Version`. This field can only be specified once
+   *    in the filter.
+   *
+   * Here are is an example:
+   *
+   *   * `resource_type = Api` - The resource_type is _Api_.
+   * 
+ * + * string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. An expression that filters the list of search results.
+   *
+   * A filter expression consists of a field name, a comparison operator,
+   * and a value for filtering. The value must be a string, a number, or a
+   * boolean. The comparison operator must be `=`. Filters are not case
+   * sensitive.
+   *
+   * The following field names are eligible for filtering:
+   *    * `resource_type` - The type of resource in the search results.
+   *    Must be one of the following: `Api`, `ApiOperation`, `Deployment`,
+   *    `Definition`, `Spec` or `Version`. This field can only be specified once
+   *    in the filter.
+   *
+   * Here are is an example:
+   *
+   *   * `resource_type = Api` - The resource_type is _Api_.
+   * 
+ * + * string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. The maximum number of search results to return. The service may
+   * return fewer than this value. If unspecified at most 10 search results will
+   * be returned. If value is negative then `INVALID_ARGUMENT` error is
+   * returned. The maximum value is 25; values above 25 will be coerced to 25.
+   * While paginating, you can specify a new page size parameter for each page
+   * of search results to be listed.
+   * 
+ * + * int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A page token, received from a previous
+   * [SearchResources][SearchResources]
+   * call. Specify this parameter to retrieve the next page of transactions.
+   *
+   * When paginating, you must specify the `page_token` parameter and all the
+   * other parameters except
+   * [page_size][google.cloud.apihub.v1.SearchResourcesRequest.page_size]
+   * should be specified with the same value which was used in the previous
+   * call. If the other fields are set with a different value than the previous
+   * call then `INVALID_ARGUMENT` error is returned.
+   * 
+ * + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A page token, received from a previous
+   * [SearchResources][SearchResources]
+   * call. Specify this parameter to retrieve the next page of transactions.
+   *
+   * When paginating, you must specify the `page_token` parameter and all the
+   * other parameters except
+   * [page_size][google.cloud.apihub.v1.SearchResourcesRequest.page_size]
+   * should be specified with the same value which was used in the previous
+   * call. If the other fields are set with a different value than the previous
+   * call then `INVALID_ARGUMENT` error is returned.
+   * 
+ * + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SearchResourcesResponse.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SearchResourcesResponse.java new file mode 100644 index 000000000000..4cb210622920 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SearchResourcesResponse.java @@ -0,0 +1,1169 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * Response for the
+ * [SearchResources][google.cloud.apihub.v1.ApiHub.SearchResources] method.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.SearchResourcesResponse} + */ +public final class SearchResourcesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.SearchResourcesResponse) + SearchResourcesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchResourcesResponse.newBuilder() to construct. + private SearchResourcesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchResourcesResponse() { + searchResults_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchResourcesResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_SearchResourcesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_SearchResourcesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.SearchResourcesResponse.class, + com.google.cloud.apihub.v1.SearchResourcesResponse.Builder.class); + } + + public static final int SEARCH_RESULTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List searchResults_; + /** + * + * + *
+   * List of search results according to the filter and search query specified.
+   * The order of search results represents the ranking.
+   * 
+ * + * repeated .google.cloud.apihub.v1.SearchResult search_results = 1; + */ + @java.lang.Override + public java.util.List getSearchResultsList() { + return searchResults_; + } + /** + * + * + *
+   * List of search results according to the filter and search query specified.
+   * The order of search results represents the ranking.
+   * 
+ * + * repeated .google.cloud.apihub.v1.SearchResult search_results = 1; + */ + @java.lang.Override + public java.util.List + getSearchResultsOrBuilderList() { + return searchResults_; + } + /** + * + * + *
+   * List of search results according to the filter and search query specified.
+   * The order of search results represents the ranking.
+   * 
+ * + * repeated .google.cloud.apihub.v1.SearchResult search_results = 1; + */ + @java.lang.Override + public int getSearchResultsCount() { + return searchResults_.size(); + } + /** + * + * + *
+   * List of search results according to the filter and search query specified.
+   * The order of search results represents the ranking.
+   * 
+ * + * repeated .google.cloud.apihub.v1.SearchResult search_results = 1; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.SearchResult getSearchResults(int index) { + return searchResults_.get(index); + } + /** + * + * + *
+   * List of search results according to the filter and search query specified.
+   * The order of search results represents the ranking.
+   * 
+ * + * repeated .google.cloud.apihub.v1.SearchResult search_results = 1; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.SearchResultOrBuilder getSearchResultsOrBuilder(int index) { + return searchResults_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * Pass this token in the
+   * [SearchResourcesRequest][google.cloud.apihub.v1.SearchResourcesRequest]
+   * to continue to list results. If all results have been returned, this field
+   * is an empty string or not present in the response.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * Pass this token in the
+   * [SearchResourcesRequest][google.cloud.apihub.v1.SearchResourcesRequest]
+   * to continue to list results. If all results have been returned, this field
+   * is an empty string or not present in the response.
+   * 
+ * + * 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 < searchResults_.size(); i++) { + output.writeMessage(1, searchResults_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < searchResults_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, searchResults_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().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.apihub.v1.SearchResourcesResponse)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.SearchResourcesResponse other = + (com.google.cloud.apihub.v1.SearchResourcesResponse) obj; + + if (!getSearchResultsList().equals(other.getSearchResultsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSearchResultsCount() > 0) { + hash = (37 * hash) + SEARCH_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getSearchResultsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.SearchResourcesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.SearchResourcesResponse 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.apihub.v1.SearchResourcesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.SearchResourcesResponse 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.apihub.v1.SearchResourcesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.SearchResourcesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.SearchResourcesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.SearchResourcesResponse 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.apihub.v1.SearchResourcesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.SearchResourcesResponse 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.apihub.v1.SearchResourcesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.SearchResourcesResponse 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.apihub.v1.SearchResourcesResponse 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; + } + /** + * + * + *
+   * Response for the
+   * [SearchResources][google.cloud.apihub.v1.ApiHub.SearchResources] method.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.SearchResourcesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.SearchResourcesResponse) + com.google.cloud.apihub.v1.SearchResourcesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_SearchResourcesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_SearchResourcesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.SearchResourcesResponse.class, + com.google.cloud.apihub.v1.SearchResourcesResponse.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.SearchResourcesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (searchResultsBuilder_ == null) { + searchResults_ = java.util.Collections.emptyList(); + } else { + searchResults_ = null; + searchResultsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_SearchResourcesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.SearchResourcesResponse getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.SearchResourcesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.SearchResourcesResponse build() { + com.google.cloud.apihub.v1.SearchResourcesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.SearchResourcesResponse buildPartial() { + com.google.cloud.apihub.v1.SearchResourcesResponse result = + new com.google.cloud.apihub.v1.SearchResourcesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.apihub.v1.SearchResourcesResponse result) { + if (searchResultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + searchResults_ = java.util.Collections.unmodifiableList(searchResults_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.searchResults_ = searchResults_; + } else { + result.searchResults_ = searchResultsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.apihub.v1.SearchResourcesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.apihub.v1.SearchResourcesResponse) { + return mergeFrom((com.google.cloud.apihub.v1.SearchResourcesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.SearchResourcesResponse other) { + if (other == com.google.cloud.apihub.v1.SearchResourcesResponse.getDefaultInstance()) + return this; + if (searchResultsBuilder_ == null) { + if (!other.searchResults_.isEmpty()) { + if (searchResults_.isEmpty()) { + searchResults_ = other.searchResults_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSearchResultsIsMutable(); + searchResults_.addAll(other.searchResults_); + } + onChanged(); + } + } else { + if (!other.searchResults_.isEmpty()) { + if (searchResultsBuilder_.isEmpty()) { + searchResultsBuilder_.dispose(); + searchResultsBuilder_ = null; + searchResults_ = other.searchResults_; + bitField0_ = (bitField0_ & ~0x00000001); + searchResultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSearchResultsFieldBuilder() + : null; + } else { + searchResultsBuilder_.addAllMessages(other.searchResults_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.apihub.v1.SearchResult m = + input.readMessage( + com.google.cloud.apihub.v1.SearchResult.parser(), extensionRegistry); + if (searchResultsBuilder_ == null) { + ensureSearchResultsIsMutable(); + searchResults_.add(m); + } else { + searchResultsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List searchResults_ = + java.util.Collections.emptyList(); + + private void ensureSearchResultsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + searchResults_ = + new java.util.ArrayList(searchResults_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.SearchResult, + com.google.cloud.apihub.v1.SearchResult.Builder, + com.google.cloud.apihub.v1.SearchResultOrBuilder> + searchResultsBuilder_; + + /** + * + * + *
+     * List of search results according to the filter and search query specified.
+     * The order of search results represents the ranking.
+     * 
+ * + * repeated .google.cloud.apihub.v1.SearchResult search_results = 1; + */ + public java.util.List getSearchResultsList() { + if (searchResultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(searchResults_); + } else { + return searchResultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of search results according to the filter and search query specified.
+     * The order of search results represents the ranking.
+     * 
+ * + * repeated .google.cloud.apihub.v1.SearchResult search_results = 1; + */ + public int getSearchResultsCount() { + if (searchResultsBuilder_ == null) { + return searchResults_.size(); + } else { + return searchResultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of search results according to the filter and search query specified.
+     * The order of search results represents the ranking.
+     * 
+ * + * repeated .google.cloud.apihub.v1.SearchResult search_results = 1; + */ + public com.google.cloud.apihub.v1.SearchResult getSearchResults(int index) { + if (searchResultsBuilder_ == null) { + return searchResults_.get(index); + } else { + return searchResultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of search results according to the filter and search query specified.
+     * The order of search results represents the ranking.
+     * 
+ * + * repeated .google.cloud.apihub.v1.SearchResult search_results = 1; + */ + public Builder setSearchResults(int index, com.google.cloud.apihub.v1.SearchResult value) { + if (searchResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSearchResultsIsMutable(); + searchResults_.set(index, value); + onChanged(); + } else { + searchResultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of search results according to the filter and search query specified.
+     * The order of search results represents the ranking.
+     * 
+ * + * repeated .google.cloud.apihub.v1.SearchResult search_results = 1; + */ + public Builder setSearchResults( + int index, com.google.cloud.apihub.v1.SearchResult.Builder builderForValue) { + if (searchResultsBuilder_ == null) { + ensureSearchResultsIsMutable(); + searchResults_.set(index, builderForValue.build()); + onChanged(); + } else { + searchResultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of search results according to the filter and search query specified.
+     * The order of search results represents the ranking.
+     * 
+ * + * repeated .google.cloud.apihub.v1.SearchResult search_results = 1; + */ + public Builder addSearchResults(com.google.cloud.apihub.v1.SearchResult value) { + if (searchResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSearchResultsIsMutable(); + searchResults_.add(value); + onChanged(); + } else { + searchResultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of search results according to the filter and search query specified.
+     * The order of search results represents the ranking.
+     * 
+ * + * repeated .google.cloud.apihub.v1.SearchResult search_results = 1; + */ + public Builder addSearchResults(int index, com.google.cloud.apihub.v1.SearchResult value) { + if (searchResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSearchResultsIsMutable(); + searchResults_.add(index, value); + onChanged(); + } else { + searchResultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of search results according to the filter and search query specified.
+     * The order of search results represents the ranking.
+     * 
+ * + * repeated .google.cloud.apihub.v1.SearchResult search_results = 1; + */ + public Builder addSearchResults( + com.google.cloud.apihub.v1.SearchResult.Builder builderForValue) { + if (searchResultsBuilder_ == null) { + ensureSearchResultsIsMutable(); + searchResults_.add(builderForValue.build()); + onChanged(); + } else { + searchResultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of search results according to the filter and search query specified.
+     * The order of search results represents the ranking.
+     * 
+ * + * repeated .google.cloud.apihub.v1.SearchResult search_results = 1; + */ + public Builder addSearchResults( + int index, com.google.cloud.apihub.v1.SearchResult.Builder builderForValue) { + if (searchResultsBuilder_ == null) { + ensureSearchResultsIsMutable(); + searchResults_.add(index, builderForValue.build()); + onChanged(); + } else { + searchResultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of search results according to the filter and search query specified.
+     * The order of search results represents the ranking.
+     * 
+ * + * repeated .google.cloud.apihub.v1.SearchResult search_results = 1; + */ + public Builder addAllSearchResults( + java.lang.Iterable values) { + if (searchResultsBuilder_ == null) { + ensureSearchResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, searchResults_); + onChanged(); + } else { + searchResultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of search results according to the filter and search query specified.
+     * The order of search results represents the ranking.
+     * 
+ * + * repeated .google.cloud.apihub.v1.SearchResult search_results = 1; + */ + public Builder clearSearchResults() { + if (searchResultsBuilder_ == null) { + searchResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + searchResultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of search results according to the filter and search query specified.
+     * The order of search results represents the ranking.
+     * 
+ * + * repeated .google.cloud.apihub.v1.SearchResult search_results = 1; + */ + public Builder removeSearchResults(int index) { + if (searchResultsBuilder_ == null) { + ensureSearchResultsIsMutable(); + searchResults_.remove(index); + onChanged(); + } else { + searchResultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of search results according to the filter and search query specified.
+     * The order of search results represents the ranking.
+     * 
+ * + * repeated .google.cloud.apihub.v1.SearchResult search_results = 1; + */ + public com.google.cloud.apihub.v1.SearchResult.Builder getSearchResultsBuilder(int index) { + return getSearchResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of search results according to the filter and search query specified.
+     * The order of search results represents the ranking.
+     * 
+ * + * repeated .google.cloud.apihub.v1.SearchResult search_results = 1; + */ + public com.google.cloud.apihub.v1.SearchResultOrBuilder getSearchResultsOrBuilder(int index) { + if (searchResultsBuilder_ == null) { + return searchResults_.get(index); + } else { + return searchResultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of search results according to the filter and search query specified.
+     * The order of search results represents the ranking.
+     * 
+ * + * repeated .google.cloud.apihub.v1.SearchResult search_results = 1; + */ + public java.util.List + getSearchResultsOrBuilderList() { + if (searchResultsBuilder_ != null) { + return searchResultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(searchResults_); + } + } + /** + * + * + *
+     * List of search results according to the filter and search query specified.
+     * The order of search results represents the ranking.
+     * 
+ * + * repeated .google.cloud.apihub.v1.SearchResult search_results = 1; + */ + public com.google.cloud.apihub.v1.SearchResult.Builder addSearchResultsBuilder() { + return getSearchResultsFieldBuilder() + .addBuilder(com.google.cloud.apihub.v1.SearchResult.getDefaultInstance()); + } + /** + * + * + *
+     * List of search results according to the filter and search query specified.
+     * The order of search results represents the ranking.
+     * 
+ * + * repeated .google.cloud.apihub.v1.SearchResult search_results = 1; + */ + public com.google.cloud.apihub.v1.SearchResult.Builder addSearchResultsBuilder(int index) { + return getSearchResultsFieldBuilder() + .addBuilder(index, com.google.cloud.apihub.v1.SearchResult.getDefaultInstance()); + } + /** + * + * + *
+     * List of search results according to the filter and search query specified.
+     * The order of search results represents the ranking.
+     * 
+ * + * repeated .google.cloud.apihub.v1.SearchResult search_results = 1; + */ + public java.util.List + getSearchResultsBuilderList() { + return getSearchResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.SearchResult, + com.google.cloud.apihub.v1.SearchResult.Builder, + com.google.cloud.apihub.v1.SearchResultOrBuilder> + getSearchResultsFieldBuilder() { + if (searchResultsBuilder_ == null) { + searchResultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apihub.v1.SearchResult, + com.google.cloud.apihub.v1.SearchResult.Builder, + com.google.cloud.apihub.v1.SearchResultOrBuilder>( + searchResults_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + searchResults_ = null; + } + return searchResultsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Pass this token in the
+     * [SearchResourcesRequest][google.cloud.apihub.v1.SearchResourcesRequest]
+     * to continue to list results. If all results have been returned, this field
+     * is an empty string or not present in the response.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Pass this token in the
+     * [SearchResourcesRequest][google.cloud.apihub.v1.SearchResourcesRequest]
+     * to continue to list results. If all results have been returned, this field
+     * is an empty string or not present in the response.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Pass this token in the
+     * [SearchResourcesRequest][google.cloud.apihub.v1.SearchResourcesRequest]
+     * to continue to list results. If all results have been returned, this field
+     * is an empty string or not present in the response.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Pass this token in the
+     * [SearchResourcesRequest][google.cloud.apihub.v1.SearchResourcesRequest]
+     * to continue to list results. If all results have been returned, this field
+     * is an empty string or not present in the response.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Pass this token in the
+     * [SearchResourcesRequest][google.cloud.apihub.v1.SearchResourcesRequest]
+     * to continue to list results. If all results have been returned, this field
+     * is an empty string or not present in the response.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + 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.apihub.v1.SearchResourcesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.SearchResourcesResponse) + private static final com.google.cloud.apihub.v1.SearchResourcesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.SearchResourcesResponse(); + } + + public static com.google.cloud.apihub.v1.SearchResourcesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchResourcesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.SearchResourcesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SearchResourcesResponseOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SearchResourcesResponseOrBuilder.java new file mode 100644 index 000000000000..0a18f386cf6e --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SearchResourcesResponseOrBuilder.java @@ -0,0 +1,114 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface SearchResourcesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.SearchResourcesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of search results according to the filter and search query specified.
+   * The order of search results represents the ranking.
+   * 
+ * + * repeated .google.cloud.apihub.v1.SearchResult search_results = 1; + */ + java.util.List getSearchResultsList(); + /** + * + * + *
+   * List of search results according to the filter and search query specified.
+   * The order of search results represents the ranking.
+   * 
+ * + * repeated .google.cloud.apihub.v1.SearchResult search_results = 1; + */ + com.google.cloud.apihub.v1.SearchResult getSearchResults(int index); + /** + * + * + *
+   * List of search results according to the filter and search query specified.
+   * The order of search results represents the ranking.
+   * 
+ * + * repeated .google.cloud.apihub.v1.SearchResult search_results = 1; + */ + int getSearchResultsCount(); + /** + * + * + *
+   * List of search results according to the filter and search query specified.
+   * The order of search results represents the ranking.
+   * 
+ * + * repeated .google.cloud.apihub.v1.SearchResult search_results = 1; + */ + java.util.List + getSearchResultsOrBuilderList(); + /** + * + * + *
+   * List of search results according to the filter and search query specified.
+   * The order of search results represents the ranking.
+   * 
+ * + * repeated .google.cloud.apihub.v1.SearchResult search_results = 1; + */ + com.google.cloud.apihub.v1.SearchResultOrBuilder getSearchResultsOrBuilder(int index); + + /** + * + * + *
+   * Pass this token in the
+   * [SearchResourcesRequest][google.cloud.apihub.v1.SearchResourcesRequest]
+   * to continue to list results. If all results have been returned, this field
+   * is an empty string or not present in the response.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Pass this token in the
+   * [SearchResourcesRequest][google.cloud.apihub.v1.SearchResourcesRequest]
+   * to continue to list results. If all results have been returned, this field
+   * is an empty string or not present in the response.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SearchResult.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SearchResult.java new file mode 100644 index 000000000000..d9044fe55bf9 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SearchResult.java @@ -0,0 +1,731 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * Represents the search results.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.SearchResult} + */ +public final class SearchResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.SearchResult) + SearchResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchResult.newBuilder() to construct. + private SearchResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchResult() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchResult(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_SearchResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_SearchResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.SearchResult.class, + com.google.cloud.apihub.v1.SearchResult.Builder.class); + } + + private int bitField0_; + public static final int RESOURCE_FIELD_NUMBER = 1; + private com.google.cloud.apihub.v1.ApiHubResource resource_; + /** + * + * + *
+   * This represents the ApiHubResource.
+   * Note: Only selected fields of the resources are populated in response.
+   * 
+ * + * .google.cloud.apihub.v1.ApiHubResource resource = 1; + * + * @return Whether the resource field is set. + */ + @java.lang.Override + public boolean hasResource() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * This represents the ApiHubResource.
+   * Note: Only selected fields of the resources are populated in response.
+   * 
+ * + * .google.cloud.apihub.v1.ApiHubResource resource = 1; + * + * @return The resource. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.ApiHubResource getResource() { + return resource_ == null + ? com.google.cloud.apihub.v1.ApiHubResource.getDefaultInstance() + : resource_; + } + /** + * + * + *
+   * This represents the ApiHubResource.
+   * Note: Only selected fields of the resources are populated in response.
+   * 
+ * + * .google.cloud.apihub.v1.ApiHubResource resource = 1; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.ApiHubResourceOrBuilder getResourceOrBuilder() { + return resource_ == null + ? com.google.cloud.apihub.v1.ApiHubResource.getDefaultInstance() + : resource_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getResource()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getResource()); + } + size += getUnknownFields().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.apihub.v1.SearchResult)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.SearchResult other = (com.google.cloud.apihub.v1.SearchResult) obj; + + if (hasResource() != other.hasResource()) return false; + if (hasResource()) { + if (!getResource().equals(other.getResource())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasResource()) { + hash = (37 * hash) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.SearchResult parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.SearchResult 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.apihub.v1.SearchResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.SearchResult 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.apihub.v1.SearchResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.SearchResult parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.SearchResult parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.SearchResult 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.apihub.v1.SearchResult parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.SearchResult 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.apihub.v1.SearchResult parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.SearchResult 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.apihub.v1.SearchResult 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; + } + /** + * + * + *
+   * Represents the search results.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.SearchResult} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.SearchResult) + com.google.cloud.apihub.v1.SearchResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_SearchResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_SearchResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.SearchResult.class, + com.google.cloud.apihub.v1.SearchResult.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.SearchResult.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getResourceFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + resource_ = null; + if (resourceBuilder_ != null) { + resourceBuilder_.dispose(); + resourceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_SearchResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.SearchResult getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.SearchResult.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.SearchResult build() { + com.google.cloud.apihub.v1.SearchResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.SearchResult buildPartial() { + com.google.cloud.apihub.v1.SearchResult result = + new com.google.cloud.apihub.v1.SearchResult(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.SearchResult result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.resource_ = resourceBuilder_ == null ? resource_ : resourceBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.SearchResult) { + return mergeFrom((com.google.cloud.apihub.v1.SearchResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.SearchResult other) { + if (other == com.google.cloud.apihub.v1.SearchResult.getDefaultInstance()) return this; + if (other.hasResource()) { + mergeResource(other.getResource()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getResourceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.apihub.v1.ApiHubResource resource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.ApiHubResource, + com.google.cloud.apihub.v1.ApiHubResource.Builder, + com.google.cloud.apihub.v1.ApiHubResourceOrBuilder> + resourceBuilder_; + /** + * + * + *
+     * This represents the ApiHubResource.
+     * Note: Only selected fields of the resources are populated in response.
+     * 
+ * + * .google.cloud.apihub.v1.ApiHubResource resource = 1; + * + * @return Whether the resource field is set. + */ + public boolean hasResource() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * This represents the ApiHubResource.
+     * Note: Only selected fields of the resources are populated in response.
+     * 
+ * + * .google.cloud.apihub.v1.ApiHubResource resource = 1; + * + * @return The resource. + */ + public com.google.cloud.apihub.v1.ApiHubResource getResource() { + if (resourceBuilder_ == null) { + return resource_ == null + ? com.google.cloud.apihub.v1.ApiHubResource.getDefaultInstance() + : resource_; + } else { + return resourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * This represents the ApiHubResource.
+     * Note: Only selected fields of the resources are populated in response.
+     * 
+ * + * .google.cloud.apihub.v1.ApiHubResource resource = 1; + */ + public Builder setResource(com.google.cloud.apihub.v1.ApiHubResource value) { + if (resourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resource_ = value; + } else { + resourceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * This represents the ApiHubResource.
+     * Note: Only selected fields of the resources are populated in response.
+     * 
+ * + * .google.cloud.apihub.v1.ApiHubResource resource = 1; + */ + public Builder setResource(com.google.cloud.apihub.v1.ApiHubResource.Builder builderForValue) { + if (resourceBuilder_ == null) { + resource_ = builderForValue.build(); + } else { + resourceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * This represents the ApiHubResource.
+     * Note: Only selected fields of the resources are populated in response.
+     * 
+ * + * .google.cloud.apihub.v1.ApiHubResource resource = 1; + */ + public Builder mergeResource(com.google.cloud.apihub.v1.ApiHubResource value) { + if (resourceBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && resource_ != null + && resource_ != com.google.cloud.apihub.v1.ApiHubResource.getDefaultInstance()) { + getResourceBuilder().mergeFrom(value); + } else { + resource_ = value; + } + } else { + resourceBuilder_.mergeFrom(value); + } + if (resource_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * This represents the ApiHubResource.
+     * Note: Only selected fields of the resources are populated in response.
+     * 
+ * + * .google.cloud.apihub.v1.ApiHubResource resource = 1; + */ + public Builder clearResource() { + bitField0_ = (bitField0_ & ~0x00000001); + resource_ = null; + if (resourceBuilder_ != null) { + resourceBuilder_.dispose(); + resourceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * This represents the ApiHubResource.
+     * Note: Only selected fields of the resources are populated in response.
+     * 
+ * + * .google.cloud.apihub.v1.ApiHubResource resource = 1; + */ + public com.google.cloud.apihub.v1.ApiHubResource.Builder getResourceBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getResourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * This represents the ApiHubResource.
+     * Note: Only selected fields of the resources are populated in response.
+     * 
+ * + * .google.cloud.apihub.v1.ApiHubResource resource = 1; + */ + public com.google.cloud.apihub.v1.ApiHubResourceOrBuilder getResourceOrBuilder() { + if (resourceBuilder_ != null) { + return resourceBuilder_.getMessageOrBuilder(); + } else { + return resource_ == null + ? com.google.cloud.apihub.v1.ApiHubResource.getDefaultInstance() + : resource_; + } + } + /** + * + * + *
+     * This represents the ApiHubResource.
+     * Note: Only selected fields of the resources are populated in response.
+     * 
+ * + * .google.cloud.apihub.v1.ApiHubResource resource = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.ApiHubResource, + com.google.cloud.apihub.v1.ApiHubResource.Builder, + com.google.cloud.apihub.v1.ApiHubResourceOrBuilder> + getResourceFieldBuilder() { + if (resourceBuilder_ == null) { + resourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.ApiHubResource, + com.google.cloud.apihub.v1.ApiHubResource.Builder, + com.google.cloud.apihub.v1.ApiHubResourceOrBuilder>( + getResource(), getParentForChildren(), isClean()); + resource_ = null; + } + return resourceBuilder_; + } + + @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.apihub.v1.SearchResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.SearchResult) + private static final com.google.cloud.apihub.v1.SearchResult DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.SearchResult(); + } + + public static com.google.cloud.apihub.v1.SearchResult getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.SearchResult getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SearchResultOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SearchResultOrBuilder.java new file mode 100644 index 000000000000..8836c82327e4 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SearchResultOrBuilder.java @@ -0,0 +1,64 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface SearchResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.SearchResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This represents the ApiHubResource.
+   * Note: Only selected fields of the resources are populated in response.
+   * 
+ * + * .google.cloud.apihub.v1.ApiHubResource resource = 1; + * + * @return Whether the resource field is set. + */ + boolean hasResource(); + /** + * + * + *
+   * This represents the ApiHubResource.
+   * Note: Only selected fields of the resources are populated in response.
+   * 
+ * + * .google.cloud.apihub.v1.ApiHubResource resource = 1; + * + * @return The resource. + */ + com.google.cloud.apihub.v1.ApiHubResource getResource(); + /** + * + * + *
+   * This represents the ApiHubResource.
+   * Note: Only selected fields of the resources are populated in response.
+   * 
+ * + * .google.cloud.apihub.v1.ApiHubResource resource = 1; + */ + com.google.cloud.apihub.v1.ApiHubResourceOrBuilder getResourceOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Severity.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Severity.java new file mode 100644 index 000000000000..87c8f5db1c73 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Severity.java @@ -0,0 +1,221 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * Severity of the issue.
+ * 
+ * + * Protobuf enum {@code google.cloud.apihub.v1.Severity} + */ +public enum Severity implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Severity unspecified.
+   * 
+ * + * SEVERITY_UNSPECIFIED = 0; + */ + SEVERITY_UNSPECIFIED(0), + /** + * + * + *
+   * Severity error.
+   * 
+ * + * SEVERITY_ERROR = 1; + */ + SEVERITY_ERROR(1), + /** + * + * + *
+   * Severity warning.
+   * 
+ * + * SEVERITY_WARNING = 2; + */ + SEVERITY_WARNING(2), + /** + * + * + *
+   * Severity info.
+   * 
+ * + * SEVERITY_INFO = 3; + */ + SEVERITY_INFO(3), + /** + * + * + *
+   * Severity hint.
+   * 
+ * + * SEVERITY_HINT = 4; + */ + SEVERITY_HINT(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Severity unspecified.
+   * 
+ * + * SEVERITY_UNSPECIFIED = 0; + */ + public static final int SEVERITY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Severity error.
+   * 
+ * + * SEVERITY_ERROR = 1; + */ + public static final int SEVERITY_ERROR_VALUE = 1; + /** + * + * + *
+   * Severity warning.
+   * 
+ * + * SEVERITY_WARNING = 2; + */ + public static final int SEVERITY_WARNING_VALUE = 2; + /** + * + * + *
+   * Severity info.
+   * 
+ * + * SEVERITY_INFO = 3; + */ + public static final int SEVERITY_INFO_VALUE = 3; + /** + * + * + *
+   * Severity hint.
+   * 
+ * + * SEVERITY_HINT = 4; + */ + public static final int SEVERITY_HINT_VALUE = 4; + + 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 Severity 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 Severity forNumber(int value) { + switch (value) { + case 0: + return SEVERITY_UNSPECIFIED; + case 1: + return SEVERITY_ERROR; + case 2: + return SEVERITY_WARNING; + case 3: + return SEVERITY_INFO; + case 4: + return SEVERITY_HINT; + 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 Severity findValueByNumber(int number) { + return Severity.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.apihub.v1.CommonFieldsProto.getDescriptor().getEnumTypes().get(2); + } + + private static final Severity[] VALUES = values(); + + public static Severity 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 Severity(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.apihub.v1.Severity) +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Spec.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Spec.java new file mode 100644 index 000000000000..0e4a74958d85 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Spec.java @@ -0,0 +1,4004 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * Represents a spec associated with an API version in the API
+ * Hub. Note that specs of various types can be uploaded, however
+ * parsing of details is supported for OpenAPI spec currently.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Spec} + */ +public final class Spec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.Spec) + SpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use Spec.newBuilder() to construct. + private Spec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Spec() { + name_ = ""; + displayName_ = ""; + sourceUri_ = ""; + parsingMode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Spec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Spec_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 10: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Spec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Spec.class, com.google.cloud.apihub.v1.Spec.Builder.class); + } + + /** + * + * + *
+   * Specifies the parsing mode for API specifications during creation and
+   * update.
+   * - `RELAXED`: Parsing errors in the specification content do not fail the
+   * API call.
+   * - `STRICT`: Parsing errors in the specification content result in failure
+   * of the API call.
+   * If not specified, defaults to `RELAXED`.
+   * 
+ * + * Protobuf enum {@code google.cloud.apihub.v1.Spec.ParsingMode} + */ + public enum ParsingMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Defaults to `RELAXED`.
+     * 
+ * + * PARSING_MODE_UNSPECIFIED = 0; + */ + PARSING_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Parsing of the Spec on create and update is relaxed, meaning that
+     * parsing errors the spec contents will not fail the API call.
+     * 
+ * + * RELAXED = 1; + */ + RELAXED(1), + /** + * + * + *
+     * Parsing of the Spec on create and update is strict, meaning that
+     * parsing errors in the spec contents will fail the API call.
+     * 
+ * + * STRICT = 2; + */ + STRICT(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Defaults to `RELAXED`.
+     * 
+ * + * PARSING_MODE_UNSPECIFIED = 0; + */ + public static final int PARSING_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Parsing of the Spec on create and update is relaxed, meaning that
+     * parsing errors the spec contents will not fail the API call.
+     * 
+ * + * RELAXED = 1; + */ + public static final int RELAXED_VALUE = 1; + /** + * + * + *
+     * Parsing of the Spec on create and update is strict, meaning that
+     * parsing errors in the spec contents will fail the API call.
+     * 
+ * + * STRICT = 2; + */ + public static final int STRICT_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 ParsingMode 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 ParsingMode forNumber(int value) { + switch (value) { + case 0: + return PARSING_MODE_UNSPECIFIED; + case 1: + return RELAXED; + case 2: + return STRICT; + 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 ParsingMode findValueByNumber(int number) { + return ParsingMode.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.apihub.v1.Spec.getDescriptor().getEnumTypes().get(0); + } + + private static final ParsingMode[] VALUES = values(); + + public static ParsingMode 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 ParsingMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.apihub.v1.Spec.ParsingMode) + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. The name of the spec.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+   * Identifier. The name of the spec.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * Required. The display name of the spec.
+   * This can contain the file name of the spec.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+   * Required. The display name of the spec.
+   * This can contain the file name of the spec.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 SPEC_TYPE_FIELD_NUMBER = 3; + private com.google.cloud.apihub.v1.AttributeValues specType_; + /** + * + * + *
+   * Required. The type of spec.
+   * The value should be one of the allowed values defined for
+   * `projects/{project}/locations/{location}/attributes/system-spec-type`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API.
+   *
+   * Note, this field is mandatory if content is provided.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues spec_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the specType field is set. + */ + @java.lang.Override + public boolean hasSpecType() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The type of spec.
+   * The value should be one of the allowed values defined for
+   * `projects/{project}/locations/{location}/attributes/system-spec-type`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API.
+   *
+   * Note, this field is mandatory if content is provided.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues spec_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The specType. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getSpecType() { + return specType_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : specType_; + } + /** + * + * + *
+   * Required. The type of spec.
+   * The value should be one of the allowed values defined for
+   * `projects/{project}/locations/{location}/attributes/system-spec-type`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API.
+   *
+   * Note, this field is mandatory if content is provided.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues spec_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValuesOrBuilder getSpecTypeOrBuilder() { + return specType_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : specType_; + } + + public static final int CONTENTS_FIELD_NUMBER = 4; + private com.google.cloud.apihub.v1.SpecContents contents_; + /** + * + * + *
+   * Optional. Input only. The contents of the uploaded spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.SpecContents contents = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the contents field is set. + */ + @java.lang.Override + public boolean hasContents() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Optional. Input only. The contents of the uploaded spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.SpecContents contents = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The contents. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.SpecContents getContents() { + return contents_ == null + ? com.google.cloud.apihub.v1.SpecContents.getDefaultInstance() + : contents_; + } + /** + * + * + *
+   * Optional. Input only. The contents of the uploaded spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.SpecContents contents = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.SpecContentsOrBuilder getContentsOrBuilder() { + return contents_ == null + ? com.google.cloud.apihub.v1.SpecContents.getDefaultInstance() + : contents_; + } + + public static final int DETAILS_FIELD_NUMBER = 5; + private com.google.cloud.apihub.v1.SpecDetails details_; + /** + * + * + *
+   * Output only. Details parsed from the spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.SpecDetails details = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the details field is set. + */ + @java.lang.Override + public boolean hasDetails() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Output only. Details parsed from the spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.SpecDetails details = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The details. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.SpecDetails getDetails() { + return details_ == null + ? com.google.cloud.apihub.v1.SpecDetails.getDefaultInstance() + : details_; + } + /** + * + * + *
+   * Output only. Details parsed from the spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.SpecDetails details = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.SpecDetailsOrBuilder getDetailsOrBuilder() { + return details_ == null + ? com.google.cloud.apihub.v1.SpecDetails.getDefaultInstance() + : details_; + } + + public static final int SOURCE_URI_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object sourceUri_ = ""; + /** + * + * + *
+   * Optional. The URI of the spec source in case file is uploaded
+   * from an external version control system.
+   * 
+ * + * string source_uri = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The sourceUri. + */ + @java.lang.Override + public java.lang.String getSourceUri() { + java.lang.Object ref = sourceUri_; + 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(); + sourceUri_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The URI of the spec source in case file is uploaded
+   * from an external version control system.
+   * 
+ * + * string source_uri = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for sourceUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceUriBytes() { + java.lang.Object ref = sourceUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time at which the spec was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+   * Output only. The time at which the spec was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.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. The time at which the spec was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 8; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The time at which the spec was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+   * Output only. The time at which the spec was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.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 time at which the spec was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int LINT_RESPONSE_FIELD_NUMBER = 9; + private com.google.cloud.apihub.v1.LintResponse lintResponse_; + /** + * + * + *
+   * Optional. The lint response for the spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.LintResponse lint_response = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the lintResponse field is set. + */ + @java.lang.Override + public boolean hasLintResponse() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+   * Optional. The lint response for the spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.LintResponse lint_response = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The lintResponse. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.LintResponse getLintResponse() { + return lintResponse_ == null + ? com.google.cloud.apihub.v1.LintResponse.getDefaultInstance() + : lintResponse_; + } + /** + * + * + *
+   * Optional. The lint response for the spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.LintResponse lint_response = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.LintResponseOrBuilder getLintResponseOrBuilder() { + return lintResponse_ == null + ? com.google.cloud.apihub.v1.LintResponse.getDefaultInstance() + : lintResponse_; + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 10; + + private static final class AttributesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.apihub.v1.AttributeValues> + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Spec_AttributesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField + attributes_; + + private com.google.protobuf.MapField + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField(AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the spec.
+   * The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().getMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the spec.
+   * The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the spec.
+   * The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.apihub.v1.AttributeValues getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the spec.
+   * The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getAttributesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int DOCUMENTATION_FIELD_NUMBER = 11; + private com.google.cloud.apihub.v1.Documentation documentation_; + /** + * + * + *
+   * Optional. The documentation of the spec.
+   * For OpenAPI spec, this will be populated from `externalDocs` in OpenAPI
+   * spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the documentation field is set. + */ + @java.lang.Override + public boolean hasDocumentation() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+   * Optional. The documentation of the spec.
+   * For OpenAPI spec, this will be populated from `externalDocs` in OpenAPI
+   * spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The documentation. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Documentation getDocumentation() { + return documentation_ == null + ? com.google.cloud.apihub.v1.Documentation.getDefaultInstance() + : documentation_; + } + /** + * + * + *
+   * Optional. The documentation of the spec.
+   * For OpenAPI spec, this will be populated from `externalDocs` in OpenAPI
+   * spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.DocumentationOrBuilder getDocumentationOrBuilder() { + return documentation_ == null + ? com.google.cloud.apihub.v1.Documentation.getDefaultInstance() + : documentation_; + } + + public static final int PARSING_MODE_FIELD_NUMBER = 12; + private int parsingMode_ = 0; + /** + * + * + *
+   * Optional. Input only. Enum specifying the parsing mode for OpenAPI
+   * Specification (OAS) parsing.
+   * 
+ * + * + * .google.cloud.apihub.v1.Spec.ParsingMode parsing_mode = 12 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for parsingMode. + */ + @java.lang.Override + public int getParsingModeValue() { + return parsingMode_; + } + /** + * + * + *
+   * Optional. Input only. Enum specifying the parsing mode for OpenAPI
+   * Specification (OAS) parsing.
+   * 
+ * + * + * .google.cloud.apihub.v1.Spec.ParsingMode parsing_mode = 12 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The parsingMode. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Spec.ParsingMode getParsingMode() { + com.google.cloud.apihub.v1.Spec.ParsingMode result = + com.google.cloud.apihub.v1.Spec.ParsingMode.forNumber(parsingMode_); + return result == null ? com.google.cloud.apihub.v1.Spec.ParsingMode.UNRECOGNIZED : result; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getSpecType()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getContents()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(5, getDetails()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, sourceUri_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(7, getCreateTime()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(8, getUpdateTime()); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(9, getLintResponse()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAttributes(), AttributesDefaultEntryHolder.defaultEntry, 10); + if (((bitField0_ & 0x00000040) != 0)) { + output.writeMessage(11, getDocumentation()); + } + if (parsingMode_ + != com.google.cloud.apihub.v1.Spec.ParsingMode.PARSING_MODE_UNSPECIFIED.getNumber()) { + output.writeEnum(12, parsingMode_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSpecType()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getContents()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getDetails()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, sourceUri_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getCreateTime()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getUpdateTime()); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getLintResponse()); + } + for (java.util.Map.Entry entry : + internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry + attributes__ = + AttributesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, attributes__); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getDocumentation()); + } + if (parsingMode_ + != com.google.cloud.apihub.v1.Spec.ParsingMode.PARSING_MODE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(12, parsingMode_); + } + size += getUnknownFields().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.apihub.v1.Spec)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.Spec other = (com.google.cloud.apihub.v1.Spec) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (hasSpecType() != other.hasSpecType()) return false; + if (hasSpecType()) { + if (!getSpecType().equals(other.getSpecType())) return false; + } + if (hasContents() != other.hasContents()) return false; + if (hasContents()) { + if (!getContents().equals(other.getContents())) return false; + } + if (hasDetails() != other.hasDetails()) return false; + if (hasDetails()) { + if (!getDetails().equals(other.getDetails())) return false; + } + if (!getSourceUri().equals(other.getSourceUri())) 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 (hasLintResponse() != other.hasLintResponse()) return false; + if (hasLintResponse()) { + if (!getLintResponse().equals(other.getLintResponse())) return false; + } + if (!internalGetAttributes().equals(other.internalGetAttributes())) return false; + if (hasDocumentation() != other.hasDocumentation()) return false; + if (hasDocumentation()) { + if (!getDocumentation().equals(other.getDocumentation())) return false; + } + if (parsingMode_ != other.parsingMode_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (hasSpecType()) { + hash = (37 * hash) + SPEC_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getSpecType().hashCode(); + } + if (hasContents()) { + hash = (37 * hash) + CONTENTS_FIELD_NUMBER; + hash = (53 * hash) + getContents().hashCode(); + } + if (hasDetails()) { + hash = (37 * hash) + DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getDetails().hashCode(); + } + hash = (37 * hash) + SOURCE_URI_FIELD_NUMBER; + hash = (53 * hash) + getSourceUri().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 (hasLintResponse()) { + hash = (37 * hash) + LINT_RESPONSE_FIELD_NUMBER; + hash = (53 * hash) + getLintResponse().hashCode(); + } + if (!internalGetAttributes().getMap().isEmpty()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttributes().hashCode(); + } + if (hasDocumentation()) { + hash = (37 * hash) + DOCUMENTATION_FIELD_NUMBER; + hash = (53 * hash) + getDocumentation().hashCode(); + } + hash = (37 * hash) + PARSING_MODE_FIELD_NUMBER; + hash = (53 * hash) + parsingMode_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.Spec parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Spec 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.apihub.v1.Spec parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Spec 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.apihub.v1.Spec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Spec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.Spec parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Spec 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.apihub.v1.Spec parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Spec 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.apihub.v1.Spec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Spec 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.apihub.v1.Spec 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; + } + /** + * + * + *
+   * Represents a spec associated with an API version in the API
+   * Hub. Note that specs of various types can be uploaded, however
+   * parsing of details is supported for OpenAPI spec currently.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Spec} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.Spec) + com.google.cloud.apihub.v1.SpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Spec_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 10: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 10: + return internalGetMutableAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Spec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Spec.class, com.google.cloud.apihub.v1.Spec.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.Spec.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSpecTypeFieldBuilder(); + getContentsFieldBuilder(); + getDetailsFieldBuilder(); + getCreateTimeFieldBuilder(); + getUpdateTimeFieldBuilder(); + getLintResponseFieldBuilder(); + getDocumentationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + specType_ = null; + if (specTypeBuilder_ != null) { + specTypeBuilder_.dispose(); + specTypeBuilder_ = null; + } + contents_ = null; + if (contentsBuilder_ != null) { + contentsBuilder_.dispose(); + contentsBuilder_ = null; + } + details_ = null; + if (detailsBuilder_ != null) { + detailsBuilder_.dispose(); + detailsBuilder_ = null; + } + sourceUri_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + lintResponse_ = null; + if (lintResponseBuilder_ != null) { + lintResponseBuilder_.dispose(); + lintResponseBuilder_ = null; + } + internalGetMutableAttributes().clear(); + documentation_ = null; + if (documentationBuilder_ != null) { + documentationBuilder_.dispose(); + documentationBuilder_ = null; + } + parsingMode_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Spec_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Spec getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.Spec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Spec build() { + com.google.cloud.apihub.v1.Spec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Spec buildPartial() { + com.google.cloud.apihub.v1.Spec result = new com.google.cloud.apihub.v1.Spec(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.Spec result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.specType_ = specTypeBuilder_ == null ? specType_ : specTypeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.contents_ = contentsBuilder_ == null ? contents_ : contentsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.details_ = detailsBuilder_ == null ? details_ : detailsBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.sourceUri_ = sourceUri_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.lintResponse_ = + lintResponseBuilder_ == null ? lintResponse_ : lintResponseBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.attributes_ = + internalGetAttributes().build(AttributesDefaultEntryHolder.defaultEntry); + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.documentation_ = + documentationBuilder_ == null ? documentation_ : documentationBuilder_.build(); + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.parsingMode_ = parsingMode_; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.Spec) { + return mergeFrom((com.google.cloud.apihub.v1.Spec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.Spec other) { + if (other == com.google.cloud.apihub.v1.Spec.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasSpecType()) { + mergeSpecType(other.getSpecType()); + } + if (other.hasContents()) { + mergeContents(other.getContents()); + } + if (other.hasDetails()) { + mergeDetails(other.getDetails()); + } + if (!other.getSourceUri().isEmpty()) { + sourceUri_ = other.sourceUri_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasLintResponse()) { + mergeLintResponse(other.getLintResponse()); + } + internalGetMutableAttributes().mergeFrom(other.internalGetAttributes()); + bitField0_ |= 0x00000200; + if (other.hasDocumentation()) { + mergeDocumentation(other.getDocumentation()); + } + if (other.parsingMode_ != 0) { + setParsingModeValue(other.getParsingModeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getSpecTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getContentsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage(getDetailsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + sourceUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 74: + { + input.readMessage(getLintResponseFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 82: + { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.apihub.v1.AttributeValues> + attributes__ = + input.readMessage( + AttributesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAttributes() + .ensureBuilderMap() + .put(attributes__.getKey(), attributes__.getValue()); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 90: + { + input.readMessage(getDocumentationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 90 + case 96: + { + parsingMode_ = input.readEnum(); + bitField0_ |= 0x00000800; + break; + } // case 96 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. The name of the spec.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. The name of the spec.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. The name of the spec.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The name of the spec.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The name of the spec.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Required. The display name of the spec.
+     * This can contain the file name of the spec.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. The display name of the spec.
+     * This can contain the file name of the spec.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. The display name of the spec.
+     * This can contain the file name of the spec.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The display name of the spec.
+     * This can contain the file name of the spec.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The display name of the spec.
+     * This can contain the file name of the spec.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.apihub.v1.AttributeValues specType_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder> + specTypeBuilder_; + /** + * + * + *
+     * Required. The type of spec.
+     * The value should be one of the allowed values defined for
+     * `projects/{project}/locations/{location}/attributes/system-spec-type`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API.
+     *
+     * Note, this field is mandatory if content is provided.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues spec_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the specType field is set. + */ + public boolean hasSpecType() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The type of spec.
+     * The value should be one of the allowed values defined for
+     * `projects/{project}/locations/{location}/attributes/system-spec-type`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API.
+     *
+     * Note, this field is mandatory if content is provided.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues spec_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The specType. + */ + public com.google.cloud.apihub.v1.AttributeValues getSpecType() { + if (specTypeBuilder_ == null) { + return specType_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : specType_; + } else { + return specTypeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The type of spec.
+     * The value should be one of the allowed values defined for
+     * `projects/{project}/locations/{location}/attributes/system-spec-type`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API.
+     *
+     * Note, this field is mandatory if content is provided.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues spec_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSpecType(com.google.cloud.apihub.v1.AttributeValues value) { + if (specTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + specType_ = value; + } else { + specTypeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of spec.
+     * The value should be one of the allowed values defined for
+     * `projects/{project}/locations/{location}/attributes/system-spec-type`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API.
+     *
+     * Note, this field is mandatory if content is provided.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues spec_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSpecType(com.google.cloud.apihub.v1.AttributeValues.Builder builderForValue) { + if (specTypeBuilder_ == null) { + specType_ = builderForValue.build(); + } else { + specTypeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of spec.
+     * The value should be one of the allowed values defined for
+     * `projects/{project}/locations/{location}/attributes/system-spec-type`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API.
+     *
+     * Note, this field is mandatory if content is provided.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues spec_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSpecType(com.google.cloud.apihub.v1.AttributeValues value) { + if (specTypeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && specType_ != null + && specType_ != com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance()) { + getSpecTypeBuilder().mergeFrom(value); + } else { + specType_ = value; + } + } else { + specTypeBuilder_.mergeFrom(value); + } + if (specType_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The type of spec.
+     * The value should be one of the allowed values defined for
+     * `projects/{project}/locations/{location}/attributes/system-spec-type`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API.
+     *
+     * Note, this field is mandatory if content is provided.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues spec_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSpecType() { + bitField0_ = (bitField0_ & ~0x00000004); + specType_ = null; + if (specTypeBuilder_ != null) { + specTypeBuilder_.dispose(); + specTypeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of spec.
+     * The value should be one of the allowed values defined for
+     * `projects/{project}/locations/{location}/attributes/system-spec-type`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API.
+     *
+     * Note, this field is mandatory if content is provided.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues spec_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.AttributeValues.Builder getSpecTypeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getSpecTypeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The type of spec.
+     * The value should be one of the allowed values defined for
+     * `projects/{project}/locations/{location}/attributes/system-spec-type`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API.
+     *
+     * Note, this field is mandatory if content is provided.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues spec_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.AttributeValuesOrBuilder getSpecTypeOrBuilder() { + if (specTypeBuilder_ != null) { + return specTypeBuilder_.getMessageOrBuilder(); + } else { + return specType_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : specType_; + } + } + /** + * + * + *
+     * Required. The type of spec.
+     * The value should be one of the allowed values defined for
+     * `projects/{project}/locations/{location}/attributes/system-spec-type`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API.
+     *
+     * Note, this field is mandatory if content is provided.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues spec_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder> + getSpecTypeFieldBuilder() { + if (specTypeBuilder_ == null) { + specTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder>( + getSpecType(), getParentForChildren(), isClean()); + specType_ = null; + } + return specTypeBuilder_; + } + + private com.google.cloud.apihub.v1.SpecContents contents_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.SpecContents, + com.google.cloud.apihub.v1.SpecContents.Builder, + com.google.cloud.apihub.v1.SpecContentsOrBuilder> + contentsBuilder_; + /** + * + * + *
+     * Optional. Input only. The contents of the uploaded spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.SpecContents contents = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the contents field is set. + */ + public boolean hasContents() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Optional. Input only. The contents of the uploaded spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.SpecContents contents = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The contents. + */ + public com.google.cloud.apihub.v1.SpecContents getContents() { + if (contentsBuilder_ == null) { + return contents_ == null + ? com.google.cloud.apihub.v1.SpecContents.getDefaultInstance() + : contents_; + } else { + return contentsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Input only. The contents of the uploaded spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.SpecContents contents = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder setContents(com.google.cloud.apihub.v1.SpecContents value) { + if (contentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + contents_ = value; + } else { + contentsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Input only. The contents of the uploaded spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.SpecContents contents = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder setContents(com.google.cloud.apihub.v1.SpecContents.Builder builderForValue) { + if (contentsBuilder_ == null) { + contents_ = builderForValue.build(); + } else { + contentsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Input only. The contents of the uploaded spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.SpecContents contents = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder mergeContents(com.google.cloud.apihub.v1.SpecContents value) { + if (contentsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && contents_ != null + && contents_ != com.google.cloud.apihub.v1.SpecContents.getDefaultInstance()) { + getContentsBuilder().mergeFrom(value); + } else { + contents_ = value; + } + } else { + contentsBuilder_.mergeFrom(value); + } + if (contents_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. Input only. The contents of the uploaded spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.SpecContents contents = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder clearContents() { + bitField0_ = (bitField0_ & ~0x00000008); + contents_ = null; + if (contentsBuilder_ != null) { + contentsBuilder_.dispose(); + contentsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Input only. The contents of the uploaded spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.SpecContents contents = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public com.google.cloud.apihub.v1.SpecContents.Builder getContentsBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getContentsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Input only. The contents of the uploaded spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.SpecContents contents = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public com.google.cloud.apihub.v1.SpecContentsOrBuilder getContentsOrBuilder() { + if (contentsBuilder_ != null) { + return contentsBuilder_.getMessageOrBuilder(); + } else { + return contents_ == null + ? com.google.cloud.apihub.v1.SpecContents.getDefaultInstance() + : contents_; + } + } + /** + * + * + *
+     * Optional. Input only. The contents of the uploaded spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.SpecContents contents = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.SpecContents, + com.google.cloud.apihub.v1.SpecContents.Builder, + com.google.cloud.apihub.v1.SpecContentsOrBuilder> + getContentsFieldBuilder() { + if (contentsBuilder_ == null) { + contentsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.SpecContents, + com.google.cloud.apihub.v1.SpecContents.Builder, + com.google.cloud.apihub.v1.SpecContentsOrBuilder>( + getContents(), getParentForChildren(), isClean()); + contents_ = null; + } + return contentsBuilder_; + } + + private com.google.cloud.apihub.v1.SpecDetails details_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.SpecDetails, + com.google.cloud.apihub.v1.SpecDetails.Builder, + com.google.cloud.apihub.v1.SpecDetailsOrBuilder> + detailsBuilder_; + /** + * + * + *
+     * Output only. Details parsed from the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.SpecDetails details = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the details field is set. + */ + public boolean hasDetails() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Output only. Details parsed from the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.SpecDetails details = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The details. + */ + public com.google.cloud.apihub.v1.SpecDetails getDetails() { + if (detailsBuilder_ == null) { + return details_ == null + ? com.google.cloud.apihub.v1.SpecDetails.getDefaultInstance() + : details_; + } else { + return detailsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Details parsed from the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.SpecDetails details = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDetails(com.google.cloud.apihub.v1.SpecDetails value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + } else { + detailsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Details parsed from the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.SpecDetails details = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDetails(com.google.cloud.apihub.v1.SpecDetails.Builder builderForValue) { + if (detailsBuilder_ == null) { + details_ = builderForValue.build(); + } else { + detailsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Details parsed from the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.SpecDetails details = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeDetails(com.google.cloud.apihub.v1.SpecDetails value) { + if (detailsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && details_ != null + && details_ != com.google.cloud.apihub.v1.SpecDetails.getDefaultInstance()) { + getDetailsBuilder().mergeFrom(value); + } else { + details_ = value; + } + } else { + detailsBuilder_.mergeFrom(value); + } + if (details_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Details parsed from the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.SpecDetails details = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDetails() { + bitField0_ = (bitField0_ & ~0x00000010); + details_ = null; + if (detailsBuilder_ != null) { + detailsBuilder_.dispose(); + detailsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Details parsed from the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.SpecDetails details = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.apihub.v1.SpecDetails.Builder getDetailsBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getDetailsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Details parsed from the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.SpecDetails details = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.apihub.v1.SpecDetailsOrBuilder getDetailsOrBuilder() { + if (detailsBuilder_ != null) { + return detailsBuilder_.getMessageOrBuilder(); + } else { + return details_ == null + ? com.google.cloud.apihub.v1.SpecDetails.getDefaultInstance() + : details_; + } + } + /** + * + * + *
+     * Output only. Details parsed from the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.SpecDetails details = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.SpecDetails, + com.google.cloud.apihub.v1.SpecDetails.Builder, + com.google.cloud.apihub.v1.SpecDetailsOrBuilder> + getDetailsFieldBuilder() { + if (detailsBuilder_ == null) { + detailsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.SpecDetails, + com.google.cloud.apihub.v1.SpecDetails.Builder, + com.google.cloud.apihub.v1.SpecDetailsOrBuilder>( + getDetails(), getParentForChildren(), isClean()); + details_ = null; + } + return detailsBuilder_; + } + + private java.lang.Object sourceUri_ = ""; + /** + * + * + *
+     * Optional. The URI of the spec source in case file is uploaded
+     * from an external version control system.
+     * 
+ * + * string source_uri = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The sourceUri. + */ + public java.lang.String getSourceUri() { + java.lang.Object ref = sourceUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The URI of the spec source in case file is uploaded
+     * from an external version control system.
+     * 
+ * + * string source_uri = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for sourceUri. + */ + public com.google.protobuf.ByteString getSourceUriBytes() { + java.lang.Object ref = sourceUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The URI of the spec source in case file is uploaded
+     * from an external version control system.
+     * 
+ * + * string source_uri = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The sourceUri to set. + * @return This builder for chaining. + */ + public Builder setSourceUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceUri_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The URI of the spec source in case file is uploaded
+     * from an external version control system.
+     * 
+ * + * string source_uri = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearSourceUri() { + sourceUri_ = getDefaultInstance().getSourceUri(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The URI of the spec source in case file is uploaded
+     * from an external version control system.
+     * 
+ * + * string source_uri = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for sourceUri to set. + * @return This builder for chaining. + */ + public Builder setSourceUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceUri_ = value; + bitField0_ |= 0x00000020; + 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. The time at which the spec was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * Output only. The time at which the spec was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.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. The time at which the spec was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the spec was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the spec was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The time at which the spec was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000040); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the spec was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time at which the spec was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.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. The time at which the spec was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_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> + 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 time at which the spec was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+     * Output only. The time at which the spec was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.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 time at which the spec was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the spec was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the spec was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The time at which the spec was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000080); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the spec was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time at which the spec was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.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 time at which the spec was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_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> + 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.cloud.apihub.v1.LintResponse lintResponse_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.LintResponse, + com.google.cloud.apihub.v1.LintResponse.Builder, + com.google.cloud.apihub.v1.LintResponseOrBuilder> + lintResponseBuilder_; + /** + * + * + *
+     * Optional. The lint response for the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.LintResponse lint_response = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the lintResponse field is set. + */ + public boolean hasLintResponse() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * + * + *
+     * Optional. The lint response for the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.LintResponse lint_response = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The lintResponse. + */ + public com.google.cloud.apihub.v1.LintResponse getLintResponse() { + if (lintResponseBuilder_ == null) { + return lintResponse_ == null + ? com.google.cloud.apihub.v1.LintResponse.getDefaultInstance() + : lintResponse_; + } else { + return lintResponseBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The lint response for the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.LintResponse lint_response = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setLintResponse(com.google.cloud.apihub.v1.LintResponse value) { + if (lintResponseBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + lintResponse_ = value; + } else { + lintResponseBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The lint response for the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.LintResponse lint_response = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setLintResponse( + com.google.cloud.apihub.v1.LintResponse.Builder builderForValue) { + if (lintResponseBuilder_ == null) { + lintResponse_ = builderForValue.build(); + } else { + lintResponseBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The lint response for the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.LintResponse lint_response = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeLintResponse(com.google.cloud.apihub.v1.LintResponse value) { + if (lintResponseBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && lintResponse_ != null + && lintResponse_ != com.google.cloud.apihub.v1.LintResponse.getDefaultInstance()) { + getLintResponseBuilder().mergeFrom(value); + } else { + lintResponse_ = value; + } + } else { + lintResponseBuilder_.mergeFrom(value); + } + if (lintResponse_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. The lint response for the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.LintResponse lint_response = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearLintResponse() { + bitField0_ = (bitField0_ & ~0x00000100); + lintResponse_ = null; + if (lintResponseBuilder_ != null) { + lintResponseBuilder_.dispose(); + lintResponseBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The lint response for the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.LintResponse lint_response = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.LintResponse.Builder getLintResponseBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getLintResponseFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The lint response for the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.LintResponse lint_response = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.LintResponseOrBuilder getLintResponseOrBuilder() { + if (lintResponseBuilder_ != null) { + return lintResponseBuilder_.getMessageOrBuilder(); + } else { + return lintResponse_ == null + ? com.google.cloud.apihub.v1.LintResponse.getDefaultInstance() + : lintResponse_; + } + } + /** + * + * + *
+     * Optional. The lint response for the spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.LintResponse lint_response = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.LintResponse, + com.google.cloud.apihub.v1.LintResponse.Builder, + com.google.cloud.apihub.v1.LintResponseOrBuilder> + getLintResponseFieldBuilder() { + if (lintResponseBuilder_ == null) { + lintResponseBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.LintResponse, + com.google.cloud.apihub.v1.LintResponse.Builder, + com.google.cloud.apihub.v1.LintResponseOrBuilder>( + getLintResponse(), getParentForChildren(), isClean()); + lintResponse_ = null; + } + return lintResponseBuilder_; + } + + private static final class AttributesConverter + implements com.google.protobuf.MapFieldBuilder.Converter< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues> { + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues build( + com.google.cloud.apihub.v1.AttributeValuesOrBuilder val) { + if (val instanceof com.google.cloud.apihub.v1.AttributeValues) { + return (com.google.cloud.apihub.v1.AttributeValues) val; + } + return ((com.google.cloud.apihub.v1.AttributeValues.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.apihub.v1.AttributeValues> + defaultEntry() { + return AttributesDefaultEntryHolder.defaultEntry; + } + }; + + private static final AttributesConverter attributesConverter = new AttributesConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder> + attributes_; + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder> + internalGetAttributes() { + if (attributes_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(attributesConverter); + } + return attributes_; + } + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder> + internalGetMutableAttributes() { + if (attributes_ == null) { + attributes_ = new com.google.protobuf.MapFieldBuilder<>(attributesConverter); + } + bitField0_ |= 0x00000200; + onChanged(); + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().ensureBuilderMap().size(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the spec.
+     * The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().ensureBuilderMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the spec.
+     * The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getImmutableMap(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the spec.
+     * The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.apihub.v1.AttributeValues getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableAttributes().ensureBuilderMap(); + return map.containsKey(key) ? attributesConverter.build(map.get(key)) : defaultValue; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the spec.
+     * The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getAttributesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableAttributes().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return attributesConverter.build(map.get(key)); + } + + public Builder clearAttributes() { + bitField0_ = (bitField0_ & ~0x00000200); + internalGetMutableAttributes().clear(); + return this; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the spec.
+     * The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAttributes().ensureBuilderMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableAttributes() { + bitField0_ |= 0x00000200; + return internalGetMutableAttributes().ensureMessageMap(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the spec.
+     * The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAttributes( + java.lang.String key, com.google.cloud.apihub.v1.AttributeValues value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAttributes().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00000200; + return this; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the spec.
+     * The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllAttributes( + java.util.Map values) { + for (java.util.Map.Entry e : + values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableAttributes().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00000200; + return this; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the spec.
+     * The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.AttributeValues.Builder putAttributesBuilderIfAbsent( + java.lang.String key) { + java.util.Map + builderMap = internalGetMutableAttributes().ensureBuilderMap(); + com.google.cloud.apihub.v1.AttributeValuesOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = com.google.cloud.apihub.v1.AttributeValues.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.cloud.apihub.v1.AttributeValues) { + entry = ((com.google.cloud.apihub.v1.AttributeValues) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.cloud.apihub.v1.AttributeValues.Builder) entry; + } + + private com.google.cloud.apihub.v1.Documentation documentation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Documentation, + com.google.cloud.apihub.v1.Documentation.Builder, + com.google.cloud.apihub.v1.DocumentationOrBuilder> + documentationBuilder_; + /** + * + * + *
+     * Optional. The documentation of the spec.
+     * For OpenAPI spec, this will be populated from `externalDocs` in OpenAPI
+     * spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the documentation field is set. + */ + public boolean hasDocumentation() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + * + * + *
+     * Optional. The documentation of the spec.
+     * For OpenAPI spec, this will be populated from `externalDocs` in OpenAPI
+     * spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The documentation. + */ + public com.google.cloud.apihub.v1.Documentation getDocumentation() { + if (documentationBuilder_ == null) { + return documentation_ == null + ? com.google.cloud.apihub.v1.Documentation.getDefaultInstance() + : documentation_; + } else { + return documentationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The documentation of the spec.
+     * For OpenAPI spec, this will be populated from `externalDocs` in OpenAPI
+     * spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDocumentation(com.google.cloud.apihub.v1.Documentation value) { + if (documentationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + documentation_ = value; + } else { + documentationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The documentation of the spec.
+     * For OpenAPI spec, this will be populated from `externalDocs` in OpenAPI
+     * spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDocumentation( + com.google.cloud.apihub.v1.Documentation.Builder builderForValue) { + if (documentationBuilder_ == null) { + documentation_ = builderForValue.build(); + } else { + documentationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The documentation of the spec.
+     * For OpenAPI spec, this will be populated from `externalDocs` in OpenAPI
+     * spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeDocumentation(com.google.cloud.apihub.v1.Documentation value) { + if (documentationBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) + && documentation_ != null + && documentation_ != com.google.cloud.apihub.v1.Documentation.getDefaultInstance()) { + getDocumentationBuilder().mergeFrom(value); + } else { + documentation_ = value; + } + } else { + documentationBuilder_.mergeFrom(value); + } + if (documentation_ != null) { + bitField0_ |= 0x00000400; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. The documentation of the spec.
+     * For OpenAPI spec, this will be populated from `externalDocs` in OpenAPI
+     * spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearDocumentation() { + bitField0_ = (bitField0_ & ~0x00000400); + documentation_ = null; + if (documentationBuilder_ != null) { + documentationBuilder_.dispose(); + documentationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The documentation of the spec.
+     * For OpenAPI spec, this will be populated from `externalDocs` in OpenAPI
+     * spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.Documentation.Builder getDocumentationBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return getDocumentationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The documentation of the spec.
+     * For OpenAPI spec, this will be populated from `externalDocs` in OpenAPI
+     * spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.DocumentationOrBuilder getDocumentationOrBuilder() { + if (documentationBuilder_ != null) { + return documentationBuilder_.getMessageOrBuilder(); + } else { + return documentation_ == null + ? com.google.cloud.apihub.v1.Documentation.getDefaultInstance() + : documentation_; + } + } + /** + * + * + *
+     * Optional. The documentation of the spec.
+     * For OpenAPI spec, this will be populated from `externalDocs` in OpenAPI
+     * spec.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Documentation, + com.google.cloud.apihub.v1.Documentation.Builder, + com.google.cloud.apihub.v1.DocumentationOrBuilder> + getDocumentationFieldBuilder() { + if (documentationBuilder_ == null) { + documentationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Documentation, + com.google.cloud.apihub.v1.Documentation.Builder, + com.google.cloud.apihub.v1.DocumentationOrBuilder>( + getDocumentation(), getParentForChildren(), isClean()); + documentation_ = null; + } + return documentationBuilder_; + } + + private int parsingMode_ = 0; + /** + * + * + *
+     * Optional. Input only. Enum specifying the parsing mode for OpenAPI
+     * Specification (OAS) parsing.
+     * 
+ * + * + * .google.cloud.apihub.v1.Spec.ParsingMode parsing_mode = 12 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for parsingMode. + */ + @java.lang.Override + public int getParsingModeValue() { + return parsingMode_; + } + /** + * + * + *
+     * Optional. Input only. Enum specifying the parsing mode for OpenAPI
+     * Specification (OAS) parsing.
+     * 
+ * + * + * .google.cloud.apihub.v1.Spec.ParsingMode parsing_mode = 12 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for parsingMode to set. + * @return This builder for chaining. + */ + public Builder setParsingModeValue(int value) { + parsingMode_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Input only. Enum specifying the parsing mode for OpenAPI
+     * Specification (OAS) parsing.
+     * 
+ * + * + * .google.cloud.apihub.v1.Spec.ParsingMode parsing_mode = 12 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The parsingMode. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Spec.ParsingMode getParsingMode() { + com.google.cloud.apihub.v1.Spec.ParsingMode result = + com.google.cloud.apihub.v1.Spec.ParsingMode.forNumber(parsingMode_); + return result == null ? com.google.cloud.apihub.v1.Spec.ParsingMode.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Optional. Input only. Enum specifying the parsing mode for OpenAPI
+     * Specification (OAS) parsing.
+     * 
+ * + * + * .google.cloud.apihub.v1.Spec.ParsingMode parsing_mode = 12 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @param value The parsingMode to set. + * @return This builder for chaining. + */ + public Builder setParsingMode(com.google.cloud.apihub.v1.Spec.ParsingMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000800; + parsingMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Input only. Enum specifying the parsing mode for OpenAPI
+     * Specification (OAS) parsing.
+     * 
+ * + * + * .google.cloud.apihub.v1.Spec.ParsingMode parsing_mode = 12 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearParsingMode() { + bitField0_ = (bitField0_ & ~0x00000800); + parsingMode_ = 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.apihub.v1.Spec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.Spec) + private static final com.google.cloud.apihub.v1.Spec DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.Spec(); + } + + public static com.google.cloud.apihub.v1.Spec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Spec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.Spec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SpecContents.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SpecContents.java new file mode 100644 index 000000000000..c5aa627df7ad --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SpecContents.java @@ -0,0 +1,726 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The spec contents.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.SpecContents} + */ +public final class SpecContents extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.SpecContents) + SpecContentsOrBuilder { + private static final long serialVersionUID = 0L; + // Use SpecContents.newBuilder() to construct. + private SpecContents(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SpecContents() { + contents_ = com.google.protobuf.ByteString.EMPTY; + mimeType_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SpecContents(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_SpecContents_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_SpecContents_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.SpecContents.class, + com.google.cloud.apihub.v1.SpecContents.Builder.class); + } + + public static final int CONTENTS_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString contents_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+   * Required. The contents of the spec.
+   * 
+ * + * bytes contents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The contents. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContents() { + return contents_; + } + + public static final int MIME_TYPE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object mimeType_ = ""; + /** + * + * + *
+   * Required. The mime type of the content for example application/json,
+   * application/yaml, application/wsdl etc.
+   * 
+ * + * string mime_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The mimeType. + */ + @java.lang.Override + public java.lang.String getMimeType() { + java.lang.Object ref = mimeType_; + 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(); + mimeType_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The mime type of the content for example application/json,
+   * application/yaml, application/wsdl etc.
+   * 
+ * + * string mime_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for mimeType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMimeTypeBytes() { + java.lang.Object ref = mimeType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mimeType_ = 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 (!contents_.isEmpty()) { + output.writeBytes(1, contents_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mimeType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, mimeType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!contents_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, contents_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mimeType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, mimeType_); + } + size += getUnknownFields().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.apihub.v1.SpecContents)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.SpecContents other = (com.google.cloud.apihub.v1.SpecContents) obj; + + if (!getContents().equals(other.getContents())) return false; + if (!getMimeType().equals(other.getMimeType())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + CONTENTS_FIELD_NUMBER; + hash = (53 * hash) + getContents().hashCode(); + hash = (37 * hash) + MIME_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getMimeType().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.SpecContents parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.SpecContents 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.apihub.v1.SpecContents parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.SpecContents 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.apihub.v1.SpecContents parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.SpecContents parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.SpecContents parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.SpecContents 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.apihub.v1.SpecContents parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.SpecContents 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.apihub.v1.SpecContents parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.SpecContents 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.apihub.v1.SpecContents 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 spec contents.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.SpecContents} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.SpecContents) + com.google.cloud.apihub.v1.SpecContentsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_SpecContents_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_SpecContents_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.SpecContents.class, + com.google.cloud.apihub.v1.SpecContents.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.SpecContents.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + contents_ = com.google.protobuf.ByteString.EMPTY; + mimeType_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_SpecContents_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.SpecContents getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.SpecContents.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.SpecContents build() { + com.google.cloud.apihub.v1.SpecContents result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.SpecContents buildPartial() { + com.google.cloud.apihub.v1.SpecContents result = + new com.google.cloud.apihub.v1.SpecContents(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.SpecContents result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.contents_ = contents_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.mimeType_ = mimeType_; + } + } + + @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.apihub.v1.SpecContents) { + return mergeFrom((com.google.cloud.apihub.v1.SpecContents) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.SpecContents other) { + if (other == com.google.cloud.apihub.v1.SpecContents.getDefaultInstance()) return this; + if (other.getContents() != com.google.protobuf.ByteString.EMPTY) { + setContents(other.getContents()); + } + if (!other.getMimeType().isEmpty()) { + mimeType_ = other.mimeType_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + contents_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + mimeType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.ByteString contents_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * Required. The contents of the spec.
+     * 
+ * + * bytes contents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The contents. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContents() { + return contents_; + } + /** + * + * + *
+     * Required. The contents of the spec.
+     * 
+ * + * bytes contents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The contents to set. + * @return This builder for chaining. + */ + public Builder setContents(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + contents_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The contents of the spec.
+     * 
+ * + * bytes contents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearContents() { + bitField0_ = (bitField0_ & ~0x00000001); + contents_ = getDefaultInstance().getContents(); + onChanged(); + return this; + } + + private java.lang.Object mimeType_ = ""; + /** + * + * + *
+     * Required. The mime type of the content for example application/json,
+     * application/yaml, application/wsdl etc.
+     * 
+ * + * string mime_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The mimeType. + */ + public java.lang.String getMimeType() { + java.lang.Object ref = mimeType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mimeType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The mime type of the content for example application/json,
+     * application/yaml, application/wsdl etc.
+     * 
+ * + * string mime_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for mimeType. + */ + public com.google.protobuf.ByteString getMimeTypeBytes() { + java.lang.Object ref = mimeType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mimeType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The mime type of the content for example application/json,
+     * application/yaml, application/wsdl etc.
+     * 
+ * + * string mime_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The mimeType to set. + * @return This builder for chaining. + */ + public Builder setMimeType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + mimeType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The mime type of the content for example application/json,
+     * application/yaml, application/wsdl etc.
+     * 
+ * + * string mime_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearMimeType() { + mimeType_ = getDefaultInstance().getMimeType(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The mime type of the content for example application/json,
+     * application/yaml, application/wsdl etc.
+     * 
+ * + * string mime_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for mimeType to set. + * @return This builder for chaining. + */ + public Builder setMimeTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + mimeType_ = value; + bitField0_ |= 0x00000002; + 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.apihub.v1.SpecContents) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.SpecContents) + private static final com.google.cloud.apihub.v1.SpecContents DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.SpecContents(); + } + + public static com.google.cloud.apihub.v1.SpecContents getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SpecContents parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.SpecContents getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SpecContentsOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SpecContentsOrBuilder.java new file mode 100644 index 000000000000..4622206042d7 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SpecContentsOrBuilder.java @@ -0,0 +1,66 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface SpecContentsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.SpecContents) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The contents of the spec.
+   * 
+ * + * bytes contents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The contents. + */ + com.google.protobuf.ByteString getContents(); + + /** + * + * + *
+   * Required. The mime type of the content for example application/json,
+   * application/yaml, application/wsdl etc.
+   * 
+ * + * string mime_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The mimeType. + */ + java.lang.String getMimeType(); + /** + * + * + *
+   * Required. The mime type of the content for example application/json,
+   * application/yaml, application/wsdl etc.
+   * 
+ * + * string mime_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for mimeType. + */ + com.google.protobuf.ByteString getMimeTypeBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SpecDetails.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SpecDetails.java new file mode 100644 index 000000000000..58b047562e18 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SpecDetails.java @@ -0,0 +1,1073 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * SpecDetails contains the details parsed from supported
+ * spec types.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.SpecDetails} + */ +public final class SpecDetails extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.SpecDetails) + SpecDetailsOrBuilder { + private static final long serialVersionUID = 0L; + // Use SpecDetails.newBuilder() to construct. + private SpecDetails(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SpecDetails() { + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SpecDetails(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_SpecDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_SpecDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.SpecDetails.class, + com.google.cloud.apihub.v1.SpecDetails.Builder.class); + } + + private int detailsCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object details_; + + public enum DetailsCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + OPEN_API_SPEC_DETAILS(2), + DETAILS_NOT_SET(0); + private final int value; + + private DetailsCase(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 DetailsCase valueOf(int value) { + return forNumber(value); + } + + public static DetailsCase forNumber(int value) { + switch (value) { + case 2: + return OPEN_API_SPEC_DETAILS; + case 0: + return DETAILS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DetailsCase getDetailsCase() { + return DetailsCase.forNumber(detailsCase_); + } + + public static final int OPEN_API_SPEC_DETAILS_FIELD_NUMBER = 2; + /** + * + * + *
+   * Output only. Additional details apart from `OperationDetails` parsed from
+   * an OpenAPI spec. The OperationDetails parsed from the spec can be
+   * obtained by using
+   * [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
+   * method.
+   * 
+ * + * + * .google.cloud.apihub.v1.OpenApiSpecDetails open_api_spec_details = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the openApiSpecDetails field is set. + */ + @java.lang.Override + public boolean hasOpenApiSpecDetails() { + return detailsCase_ == 2; + } + /** + * + * + *
+   * Output only. Additional details apart from `OperationDetails` parsed from
+   * an OpenAPI spec. The OperationDetails parsed from the spec can be
+   * obtained by using
+   * [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
+   * method.
+   * 
+ * + * + * .google.cloud.apihub.v1.OpenApiSpecDetails open_api_spec_details = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The openApiSpecDetails. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.OpenApiSpecDetails getOpenApiSpecDetails() { + if (detailsCase_ == 2) { + return (com.google.cloud.apihub.v1.OpenApiSpecDetails) details_; + } + return com.google.cloud.apihub.v1.OpenApiSpecDetails.getDefaultInstance(); + } + /** + * + * + *
+   * Output only. Additional details apart from `OperationDetails` parsed from
+   * an OpenAPI spec. The OperationDetails parsed from the spec can be
+   * obtained by using
+   * [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
+   * method.
+   * 
+ * + * + * .google.cloud.apihub.v1.OpenApiSpecDetails open_api_spec_details = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.OpenApiSpecDetailsOrBuilder getOpenApiSpecDetailsOrBuilder() { + if (detailsCase_ == 2) { + return (com.google.cloud.apihub.v1.OpenApiSpecDetails) details_; + } + return com.google.cloud.apihub.v1.OpenApiSpecDetails.getDefaultInstance(); + } + + public static final int DESCRIPTION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * Output only. The description of the spec.
+   * 
+ * + * string description = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. The description of the spec.
+   * 
+ * + * string description = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, description_); + } + if (detailsCase_ == 2) { + output.writeMessage(2, (com.google.cloud.apihub.v1.OpenApiSpecDetails) details_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, description_); + } + if (detailsCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.apihub.v1.OpenApiSpecDetails) details_); + } + size += getUnknownFields().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.apihub.v1.SpecDetails)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.SpecDetails other = (com.google.cloud.apihub.v1.SpecDetails) obj; + + if (!getDescription().equals(other.getDescription())) return false; + if (!getDetailsCase().equals(other.getDetailsCase())) return false; + switch (detailsCase_) { + case 2: + if (!getOpenApiSpecDetails().equals(other.getOpenApiSpecDetails())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + switch (detailsCase_) { + case 2: + hash = (37 * hash) + OPEN_API_SPEC_DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getOpenApiSpecDetails().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.SpecDetails parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.SpecDetails 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.apihub.v1.SpecDetails parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.SpecDetails 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.apihub.v1.SpecDetails parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.SpecDetails parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.SpecDetails parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.SpecDetails 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.apihub.v1.SpecDetails parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.SpecDetails 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.apihub.v1.SpecDetails parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.SpecDetails 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.apihub.v1.SpecDetails 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; + } + /** + * + * + *
+   * SpecDetails contains the details parsed from supported
+   * spec types.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.SpecDetails} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.SpecDetails) + com.google.cloud.apihub.v1.SpecDetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_SpecDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_SpecDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.SpecDetails.class, + com.google.cloud.apihub.v1.SpecDetails.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.SpecDetails.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (openApiSpecDetailsBuilder_ != null) { + openApiSpecDetailsBuilder_.clear(); + } + description_ = ""; + detailsCase_ = 0; + details_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_SpecDetails_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.SpecDetails getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.SpecDetails.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.SpecDetails build() { + com.google.cloud.apihub.v1.SpecDetails result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.SpecDetails buildPartial() { + com.google.cloud.apihub.v1.SpecDetails result = + new com.google.cloud.apihub.v1.SpecDetails(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.SpecDetails result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.description_ = description_; + } + } + + private void buildPartialOneofs(com.google.cloud.apihub.v1.SpecDetails result) { + result.detailsCase_ = detailsCase_; + result.details_ = this.details_; + if (detailsCase_ == 2 && openApiSpecDetailsBuilder_ != null) { + result.details_ = openApiSpecDetailsBuilder_.build(); + } + } + + @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.apihub.v1.SpecDetails) { + return mergeFrom((com.google.cloud.apihub.v1.SpecDetails) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.SpecDetails other) { + if (other == com.google.cloud.apihub.v1.SpecDetails.getDefaultInstance()) return this; + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000002; + onChanged(); + } + switch (other.getDetailsCase()) { + case OPEN_API_SPEC_DETAILS: + { + mergeOpenApiSpecDetails(other.getOpenApiSpecDetails()); + break; + } + case DETAILS_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 10 + case 18: + { + input.readMessage( + getOpenApiSpecDetailsFieldBuilder().getBuilder(), extensionRegistry); + detailsCase_ = 2; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int detailsCase_ = 0; + private java.lang.Object details_; + + public DetailsCase getDetailsCase() { + return DetailsCase.forNumber(detailsCase_); + } + + public Builder clearDetails() { + detailsCase_ = 0; + details_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.OpenApiSpecDetails, + com.google.cloud.apihub.v1.OpenApiSpecDetails.Builder, + com.google.cloud.apihub.v1.OpenApiSpecDetailsOrBuilder> + openApiSpecDetailsBuilder_; + /** + * + * + *
+     * Output only. Additional details apart from `OperationDetails` parsed from
+     * an OpenAPI spec. The OperationDetails parsed from the spec can be
+     * obtained by using
+     * [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
+     * method.
+     * 
+ * + * + * .google.cloud.apihub.v1.OpenApiSpecDetails open_api_spec_details = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the openApiSpecDetails field is set. + */ + @java.lang.Override + public boolean hasOpenApiSpecDetails() { + return detailsCase_ == 2; + } + /** + * + * + *
+     * Output only. Additional details apart from `OperationDetails` parsed from
+     * an OpenAPI spec. The OperationDetails parsed from the spec can be
+     * obtained by using
+     * [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
+     * method.
+     * 
+ * + * + * .google.cloud.apihub.v1.OpenApiSpecDetails open_api_spec_details = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The openApiSpecDetails. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.OpenApiSpecDetails getOpenApiSpecDetails() { + if (openApiSpecDetailsBuilder_ == null) { + if (detailsCase_ == 2) { + return (com.google.cloud.apihub.v1.OpenApiSpecDetails) details_; + } + return com.google.cloud.apihub.v1.OpenApiSpecDetails.getDefaultInstance(); + } else { + if (detailsCase_ == 2) { + return openApiSpecDetailsBuilder_.getMessage(); + } + return com.google.cloud.apihub.v1.OpenApiSpecDetails.getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. Additional details apart from `OperationDetails` parsed from
+     * an OpenAPI spec. The OperationDetails parsed from the spec can be
+     * obtained by using
+     * [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
+     * method.
+     * 
+ * + * + * .google.cloud.apihub.v1.OpenApiSpecDetails open_api_spec_details = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setOpenApiSpecDetails(com.google.cloud.apihub.v1.OpenApiSpecDetails value) { + if (openApiSpecDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + onChanged(); + } else { + openApiSpecDetailsBuilder_.setMessage(value); + } + detailsCase_ = 2; + return this; + } + /** + * + * + *
+     * Output only. Additional details apart from `OperationDetails` parsed from
+     * an OpenAPI spec. The OperationDetails parsed from the spec can be
+     * obtained by using
+     * [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
+     * method.
+     * 
+ * + * + * .google.cloud.apihub.v1.OpenApiSpecDetails open_api_spec_details = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setOpenApiSpecDetails( + com.google.cloud.apihub.v1.OpenApiSpecDetails.Builder builderForValue) { + if (openApiSpecDetailsBuilder_ == null) { + details_ = builderForValue.build(); + onChanged(); + } else { + openApiSpecDetailsBuilder_.setMessage(builderForValue.build()); + } + detailsCase_ = 2; + return this; + } + /** + * + * + *
+     * Output only. Additional details apart from `OperationDetails` parsed from
+     * an OpenAPI spec. The OperationDetails parsed from the spec can be
+     * obtained by using
+     * [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
+     * method.
+     * 
+ * + * + * .google.cloud.apihub.v1.OpenApiSpecDetails open_api_spec_details = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeOpenApiSpecDetails(com.google.cloud.apihub.v1.OpenApiSpecDetails value) { + if (openApiSpecDetailsBuilder_ == null) { + if (detailsCase_ == 2 + && details_ != com.google.cloud.apihub.v1.OpenApiSpecDetails.getDefaultInstance()) { + details_ = + com.google.cloud.apihub.v1.OpenApiSpecDetails.newBuilder( + (com.google.cloud.apihub.v1.OpenApiSpecDetails) details_) + .mergeFrom(value) + .buildPartial(); + } else { + details_ = value; + } + onChanged(); + } else { + if (detailsCase_ == 2) { + openApiSpecDetailsBuilder_.mergeFrom(value); + } else { + openApiSpecDetailsBuilder_.setMessage(value); + } + } + detailsCase_ = 2; + return this; + } + /** + * + * + *
+     * Output only. Additional details apart from `OperationDetails` parsed from
+     * an OpenAPI spec. The OperationDetails parsed from the spec can be
+     * obtained by using
+     * [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
+     * method.
+     * 
+ * + * + * .google.cloud.apihub.v1.OpenApiSpecDetails open_api_spec_details = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearOpenApiSpecDetails() { + if (openApiSpecDetailsBuilder_ == null) { + if (detailsCase_ == 2) { + detailsCase_ = 0; + details_ = null; + onChanged(); + } + } else { + if (detailsCase_ == 2) { + detailsCase_ = 0; + details_ = null; + } + openApiSpecDetailsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Additional details apart from `OperationDetails` parsed from
+     * an OpenAPI spec. The OperationDetails parsed from the spec can be
+     * obtained by using
+     * [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
+     * method.
+     * 
+ * + * + * .google.cloud.apihub.v1.OpenApiSpecDetails open_api_spec_details = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.apihub.v1.OpenApiSpecDetails.Builder getOpenApiSpecDetailsBuilder() { + return getOpenApiSpecDetailsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Additional details apart from `OperationDetails` parsed from
+     * an OpenAPI spec. The OperationDetails parsed from the spec can be
+     * obtained by using
+     * [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
+     * method.
+     * 
+ * + * + * .google.cloud.apihub.v1.OpenApiSpecDetails open_api_spec_details = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.OpenApiSpecDetailsOrBuilder getOpenApiSpecDetailsOrBuilder() { + if ((detailsCase_ == 2) && (openApiSpecDetailsBuilder_ != null)) { + return openApiSpecDetailsBuilder_.getMessageOrBuilder(); + } else { + if (detailsCase_ == 2) { + return (com.google.cloud.apihub.v1.OpenApiSpecDetails) details_; + } + return com.google.cloud.apihub.v1.OpenApiSpecDetails.getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. Additional details apart from `OperationDetails` parsed from
+     * an OpenAPI spec. The OperationDetails parsed from the spec can be
+     * obtained by using
+     * [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
+     * method.
+     * 
+ * + * + * .google.cloud.apihub.v1.OpenApiSpecDetails open_api_spec_details = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.OpenApiSpecDetails, + com.google.cloud.apihub.v1.OpenApiSpecDetails.Builder, + com.google.cloud.apihub.v1.OpenApiSpecDetailsOrBuilder> + getOpenApiSpecDetailsFieldBuilder() { + if (openApiSpecDetailsBuilder_ == null) { + if (!(detailsCase_ == 2)) { + details_ = com.google.cloud.apihub.v1.OpenApiSpecDetails.getDefaultInstance(); + } + openApiSpecDetailsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.OpenApiSpecDetails, + com.google.cloud.apihub.v1.OpenApiSpecDetails.Builder, + com.google.cloud.apihub.v1.OpenApiSpecDetailsOrBuilder>( + (com.google.cloud.apihub.v1.OpenApiSpecDetails) details_, + getParentForChildren(), + isClean()); + details_ = null; + } + detailsCase_ = 2; + onChanged(); + return openApiSpecDetailsBuilder_; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Output only. The description of the spec.
+     * 
+ * + * string description = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The description of the spec.
+     * 
+ * + * string description = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The description of the spec.
+     * 
+ * + * string description = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The description of the spec.
+     * 
+ * + * string description = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The description of the spec.
+     * 
+ * + * string description = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000002; + 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.apihub.v1.SpecDetails) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.SpecDetails) + private static final com.google.cloud.apihub.v1.SpecDetails DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.SpecDetails(); + } + + public static com.google.cloud.apihub.v1.SpecDetails getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SpecDetails parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.SpecDetails getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SpecDetailsOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SpecDetailsOrBuilder.java new file mode 100644 index 000000000000..5f12dc7ebc80 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SpecDetailsOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface SpecDetailsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.SpecDetails) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Additional details apart from `OperationDetails` parsed from
+   * an OpenAPI spec. The OperationDetails parsed from the spec can be
+   * obtained by using
+   * [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
+   * method.
+   * 
+ * + * + * .google.cloud.apihub.v1.OpenApiSpecDetails open_api_spec_details = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the openApiSpecDetails field is set. + */ + boolean hasOpenApiSpecDetails(); + /** + * + * + *
+   * Output only. Additional details apart from `OperationDetails` parsed from
+   * an OpenAPI spec. The OperationDetails parsed from the spec can be
+   * obtained by using
+   * [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
+   * method.
+   * 
+ * + * + * .google.cloud.apihub.v1.OpenApiSpecDetails open_api_spec_details = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The openApiSpecDetails. + */ + com.google.cloud.apihub.v1.OpenApiSpecDetails getOpenApiSpecDetails(); + /** + * + * + *
+   * Output only. Additional details apart from `OperationDetails` parsed from
+   * an OpenAPI spec. The OperationDetails parsed from the spec can be
+   * obtained by using
+   * [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
+   * method.
+   * 
+ * + * + * .google.cloud.apihub.v1.OpenApiSpecDetails open_api_spec_details = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.apihub.v1.OpenApiSpecDetailsOrBuilder getOpenApiSpecDetailsOrBuilder(); + + /** + * + * + *
+   * Output only. The description of the spec.
+   * 
+ * + * string description = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Output only. The description of the spec.
+   * 
+ * + * string description = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + com.google.cloud.apihub.v1.SpecDetails.DetailsCase getDetailsCase(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SpecName.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SpecName.java new file mode 100644 index 000000000000..d8b7c93fc268 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SpecName.java @@ -0,0 +1,288 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +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 SpecName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_API_VERSION_SPEC = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String api; + private final String version; + private final String spec; + + @Deprecated + protected SpecName() { + project = null; + location = null; + api = null; + version = null; + spec = null; + } + + private SpecName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + api = Preconditions.checkNotNull(builder.getApi()); + version = Preconditions.checkNotNull(builder.getVersion()); + spec = Preconditions.checkNotNull(builder.getSpec()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getApi() { + return api; + } + + public String getVersion() { + return version; + } + + public String getSpec() { + return spec; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SpecName of( + String project, String location, String api, String version, String spec) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setApi(api) + .setVersion(version) + .setSpec(spec) + .build(); + } + + public static String format( + String project, String location, String api, String version, String spec) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setApi(api) + .setVersion(version) + .setSpec(spec) + .build() + .toString(); + } + + public static SpecName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_API_VERSION_SPEC.validatedMatch( + formattedString, "SpecName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("api"), + matchMap.get("version"), + matchMap.get("spec")); + } + + 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 (SpecName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_API_VERSION_SPEC.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); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (api != null) { + fieldMapBuilder.put("api", api); + } + if (version != null) { + fieldMapBuilder.put("version", version); + } + if (spec != null) { + fieldMapBuilder.put("spec", spec); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_API_VERSION_SPEC.instantiate( + "project", project, "location", location, "api", api, "version", version, "spec", spec); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + SpecName that = ((SpecName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.api, that.api) + && Objects.equals(this.version, that.version) + && Objects.equals(this.spec, that.spec); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(api); + h *= 1000003; + h ^= Objects.hashCode(version); + h *= 1000003; + h ^= Objects.hashCode(spec); + return h; + } + + /** + * Builder for projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}. + */ + public static class Builder { + private String project; + private String location; + private String api; + private String version; + private String spec; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getApi() { + return api; + } + + public String getVersion() { + return version; + } + + public String getSpec() { + return spec; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setApi(String api) { + this.api = api; + return this; + } + + public Builder setVersion(String version) { + this.version = version; + return this; + } + + public Builder setSpec(String spec) { + this.spec = spec; + return this; + } + + private Builder(SpecName specName) { + this.project = specName.project; + this.location = specName.location; + this.api = specName.api; + this.version = specName.version; + this.spec = specName.spec; + } + + public SpecName build() { + return new SpecName(this); + } + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SpecOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SpecOrBuilder.java new file mode 100644 index 000000000000..fa955993fc92 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/SpecOrBuilder.java @@ -0,0 +1,536 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface SpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.Spec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. The name of the spec.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. The name of the spec.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The display name of the spec.
+   * This can contain the file name of the spec.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. The display name of the spec.
+   * This can contain the file name of the spec.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Required. The type of spec.
+   * The value should be one of the allowed values defined for
+   * `projects/{project}/locations/{location}/attributes/system-spec-type`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API.
+   *
+   * Note, this field is mandatory if content is provided.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues spec_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the specType field is set. + */ + boolean hasSpecType(); + /** + * + * + *
+   * Required. The type of spec.
+   * The value should be one of the allowed values defined for
+   * `projects/{project}/locations/{location}/attributes/system-spec-type`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API.
+   *
+   * Note, this field is mandatory if content is provided.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues spec_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The specType. + */ + com.google.cloud.apihub.v1.AttributeValues getSpecType(); + /** + * + * + *
+   * Required. The type of spec.
+   * The value should be one of the allowed values defined for
+   * `projects/{project}/locations/{location}/attributes/system-spec-type`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API.
+   *
+   * Note, this field is mandatory if content is provided.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues spec_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.apihub.v1.AttributeValuesOrBuilder getSpecTypeOrBuilder(); + + /** + * + * + *
+   * Optional. Input only. The contents of the uploaded spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.SpecContents contents = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the contents field is set. + */ + boolean hasContents(); + /** + * + * + *
+   * Optional. Input only. The contents of the uploaded spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.SpecContents contents = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The contents. + */ + com.google.cloud.apihub.v1.SpecContents getContents(); + /** + * + * + *
+   * Optional. Input only. The contents of the uploaded spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.SpecContents contents = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + */ + com.google.cloud.apihub.v1.SpecContentsOrBuilder getContentsOrBuilder(); + + /** + * + * + *
+   * Output only. Details parsed from the spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.SpecDetails details = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the details field is set. + */ + boolean hasDetails(); + /** + * + * + *
+   * Output only. Details parsed from the spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.SpecDetails details = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The details. + */ + com.google.cloud.apihub.v1.SpecDetails getDetails(); + /** + * + * + *
+   * Output only. Details parsed from the spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.SpecDetails details = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.apihub.v1.SpecDetailsOrBuilder getDetailsOrBuilder(); + + /** + * + * + *
+   * Optional. The URI of the spec source in case file is uploaded
+   * from an external version control system.
+   * 
+ * + * string source_uri = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The sourceUri. + */ + java.lang.String getSourceUri(); + /** + * + * + *
+   * Optional. The URI of the spec source in case file is uploaded
+   * from an external version control system.
+   * 
+ * + * string source_uri = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for sourceUri. + */ + com.google.protobuf.ByteString getSourceUriBytes(); + + /** + * + * + *
+   * Output only. The time at which the spec was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time at which the spec was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time at which the spec was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time at which the spec was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The time at which the spec was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The time at which the spec was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Optional. The lint response for the spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.LintResponse lint_response = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the lintResponse field is set. + */ + boolean hasLintResponse(); + /** + * + * + *
+   * Optional. The lint response for the spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.LintResponse lint_response = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The lintResponse. + */ + com.google.cloud.apihub.v1.LintResponse getLintResponse(); + /** + * + * + *
+   * Optional. The lint response for the spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.LintResponse lint_response = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.LintResponseOrBuilder getLintResponseOrBuilder(); + + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the spec.
+   * The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getAttributesCount(); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the spec.
+   * The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsAttributes(java.lang.String key); + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAttributes(); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the spec.
+   * The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getAttributesMap(); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the spec.
+   * The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues defaultValue); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the spec.
+   * The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.AttributeValues getAttributesOrThrow(java.lang.String key); + + /** + * + * + *
+   * Optional. The documentation of the spec.
+   * For OpenAPI spec, this will be populated from `externalDocs` in OpenAPI
+   * spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the documentation field is set. + */ + boolean hasDocumentation(); + /** + * + * + *
+   * Optional. The documentation of the spec.
+   * For OpenAPI spec, this will be populated from `externalDocs` in OpenAPI
+   * spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The documentation. + */ + com.google.cloud.apihub.v1.Documentation getDocumentation(); + /** + * + * + *
+   * Optional. The documentation of the spec.
+   * For OpenAPI spec, this will be populated from `externalDocs` in OpenAPI
+   * spec.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.DocumentationOrBuilder getDocumentationOrBuilder(); + + /** + * + * + *
+   * Optional. Input only. Enum specifying the parsing mode for OpenAPI
+   * Specification (OAS) parsing.
+   * 
+ * + * + * .google.cloud.apihub.v1.Spec.ParsingMode parsing_mode = 12 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for parsingMode. + */ + int getParsingModeValue(); + /** + * + * + *
+   * Optional. Input only. Enum specifying the parsing mode for OpenAPI
+   * Specification (OAS) parsing.
+   * 
+ * + * + * .google.cloud.apihub.v1.Spec.ParsingMode parsing_mode = 12 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The parsingMode. + */ + com.google.cloud.apihub.v1.Spec.ParsingMode getParsingMode(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/StyleGuide.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/StyleGuide.java new file mode 100644 index 000000000000..1533321ffd37 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/StyleGuide.java @@ -0,0 +1,1103 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/linting_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * Represents a singleton style guide resource to be used for linting Open API
+ * specs.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.StyleGuide} + */ +public final class StyleGuide extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.StyleGuide) + StyleGuideOrBuilder { + private static final long serialVersionUID = 0L; + // Use StyleGuide.newBuilder() to construct. + private StyleGuide(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StyleGuide() { + name_ = ""; + linter_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StyleGuide(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_StyleGuide_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_StyleGuide_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.StyleGuide.class, + com.google.cloud.apihub.v1.StyleGuide.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. The name of the style guide.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+   * Identifier. The name of the style guide.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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 LINTER_FIELD_NUMBER = 2; + private int linter_ = 0; + /** + * + * + *
+   * Required. Target linter for the style guide.
+   * 
+ * + * .google.cloud.apihub.v1.Linter linter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for linter. + */ + @java.lang.Override + public int getLinterValue() { + return linter_; + } + /** + * + * + *
+   * Required. Target linter for the style guide.
+   * 
+ * + * .google.cloud.apihub.v1.Linter linter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The linter. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Linter getLinter() { + com.google.cloud.apihub.v1.Linter result = com.google.cloud.apihub.v1.Linter.forNumber(linter_); + return result == null ? com.google.cloud.apihub.v1.Linter.UNRECOGNIZED : result; + } + + public static final int CONTENTS_FIELD_NUMBER = 3; + private com.google.cloud.apihub.v1.StyleGuideContents contents_; + /** + * + * + *
+   * Required. Input only. The contents of the uploaded style guide.
+   * 
+ * + * + * .google.cloud.apihub.v1.StyleGuideContents contents = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the contents field is set. + */ + @java.lang.Override + public boolean hasContents() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. Input only. The contents of the uploaded style guide.
+   * 
+ * + * + * .google.cloud.apihub.v1.StyleGuideContents contents = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The contents. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.StyleGuideContents getContents() { + return contents_ == null + ? com.google.cloud.apihub.v1.StyleGuideContents.getDefaultInstance() + : contents_; + } + /** + * + * + *
+   * Required. Input only. The contents of the uploaded style guide.
+   * 
+ * + * + * .google.cloud.apihub.v1.StyleGuideContents contents = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.StyleGuideContentsOrBuilder getContentsOrBuilder() { + return contents_ == null + ? com.google.cloud.apihub.v1.StyleGuideContents.getDefaultInstance() + : contents_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (linter_ != com.google.cloud.apihub.v1.Linter.LINTER_UNSPECIFIED.getNumber()) { + output.writeEnum(2, linter_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getContents()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (linter_ != com.google.cloud.apihub.v1.Linter.LINTER_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, linter_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getContents()); + } + size += getUnknownFields().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.apihub.v1.StyleGuide)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.StyleGuide other = (com.google.cloud.apihub.v1.StyleGuide) obj; + + if (!getName().equals(other.getName())) return false; + if (linter_ != other.linter_) return false; + if (hasContents() != other.hasContents()) return false; + if (hasContents()) { + if (!getContents().equals(other.getContents())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + LINTER_FIELD_NUMBER; + hash = (53 * hash) + linter_; + if (hasContents()) { + hash = (37 * hash) + CONTENTS_FIELD_NUMBER; + hash = (53 * hash) + getContents().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.StyleGuide parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.StyleGuide 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.apihub.v1.StyleGuide parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.StyleGuide 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.apihub.v1.StyleGuide parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.StyleGuide parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.StyleGuide parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.StyleGuide 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.apihub.v1.StyleGuide parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.StyleGuide 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.apihub.v1.StyleGuide parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.StyleGuide 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.apihub.v1.StyleGuide 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; + } + /** + * + * + *
+   * Represents a singleton style guide resource to be used for linting Open API
+   * specs.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.StyleGuide} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.StyleGuide) + com.google.cloud.apihub.v1.StyleGuideOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_StyleGuide_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_StyleGuide_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.StyleGuide.class, + com.google.cloud.apihub.v1.StyleGuide.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.StyleGuide.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getContentsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + linter_ = 0; + contents_ = null; + if (contentsBuilder_ != null) { + contentsBuilder_.dispose(); + contentsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_StyleGuide_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.StyleGuide getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.StyleGuide.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.StyleGuide build() { + com.google.cloud.apihub.v1.StyleGuide result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.StyleGuide buildPartial() { + com.google.cloud.apihub.v1.StyleGuide result = + new com.google.cloud.apihub.v1.StyleGuide(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.StyleGuide result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.linter_ = linter_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.contents_ = contentsBuilder_ == null ? contents_ : contentsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.StyleGuide) { + return mergeFrom((com.google.cloud.apihub.v1.StyleGuide) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.StyleGuide other) { + if (other == com.google.cloud.apihub.v1.StyleGuide.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.linter_ != 0) { + setLinterValue(other.getLinterValue()); + } + if (other.hasContents()) { + mergeContents(other.getContents()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + linter_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + input.readMessage(getContentsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. The name of the style guide.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. The name of the style guide.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. The name of the style guide.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The name of the style guide.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The name of the style guide.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int linter_ = 0; + /** + * + * + *
+     * Required. Target linter for the style guide.
+     * 
+ * + * .google.cloud.apihub.v1.Linter linter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for linter. + */ + @java.lang.Override + public int getLinterValue() { + return linter_; + } + /** + * + * + *
+     * Required. Target linter for the style guide.
+     * 
+ * + * .google.cloud.apihub.v1.Linter linter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for linter to set. + * @return This builder for chaining. + */ + public Builder setLinterValue(int value) { + linter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Target linter for the style guide.
+     * 
+ * + * .google.cloud.apihub.v1.Linter linter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The linter. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Linter getLinter() { + com.google.cloud.apihub.v1.Linter result = + com.google.cloud.apihub.v1.Linter.forNumber(linter_); + return result == null ? com.google.cloud.apihub.v1.Linter.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Required. Target linter for the style guide.
+     * 
+ * + * .google.cloud.apihub.v1.Linter linter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The linter to set. + * @return This builder for chaining. + */ + public Builder setLinter(com.google.cloud.apihub.v1.Linter value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + linter_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Target linter for the style guide.
+     * 
+ * + * .google.cloud.apihub.v1.Linter linter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearLinter() { + bitField0_ = (bitField0_ & ~0x00000002); + linter_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.apihub.v1.StyleGuideContents contents_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.StyleGuideContents, + com.google.cloud.apihub.v1.StyleGuideContents.Builder, + com.google.cloud.apihub.v1.StyleGuideContentsOrBuilder> + contentsBuilder_; + /** + * + * + *
+     * Required. Input only. The contents of the uploaded style guide.
+     * 
+ * + * + * .google.cloud.apihub.v1.StyleGuideContents contents = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the contents field is set. + */ + public boolean hasContents() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. Input only. The contents of the uploaded style guide.
+     * 
+ * + * + * .google.cloud.apihub.v1.StyleGuideContents contents = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The contents. + */ + public com.google.cloud.apihub.v1.StyleGuideContents getContents() { + if (contentsBuilder_ == null) { + return contents_ == null + ? com.google.cloud.apihub.v1.StyleGuideContents.getDefaultInstance() + : contents_; + } else { + return contentsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Input only. The contents of the uploaded style guide.
+     * 
+ * + * + * .google.cloud.apihub.v1.StyleGuideContents contents = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder setContents(com.google.cloud.apihub.v1.StyleGuideContents value) { + if (contentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + contents_ = value; + } else { + contentsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Input only. The contents of the uploaded style guide.
+     * 
+ * + * + * .google.cloud.apihub.v1.StyleGuideContents contents = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder setContents( + com.google.cloud.apihub.v1.StyleGuideContents.Builder builderForValue) { + if (contentsBuilder_ == null) { + contents_ = builderForValue.build(); + } else { + contentsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Input only. The contents of the uploaded style guide.
+     * 
+ * + * + * .google.cloud.apihub.v1.StyleGuideContents contents = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder mergeContents(com.google.cloud.apihub.v1.StyleGuideContents value) { + if (contentsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && contents_ != null + && contents_ != com.google.cloud.apihub.v1.StyleGuideContents.getDefaultInstance()) { + getContentsBuilder().mergeFrom(value); + } else { + contents_ = value; + } + } else { + contentsBuilder_.mergeFrom(value); + } + if (contents_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. Input only. The contents of the uploaded style guide.
+     * 
+ * + * + * .google.cloud.apihub.v1.StyleGuideContents contents = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder clearContents() { + bitField0_ = (bitField0_ & ~0x00000004); + contents_ = null; + if (contentsBuilder_ != null) { + contentsBuilder_.dispose(); + contentsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Input only. The contents of the uploaded style guide.
+     * 
+ * + * + * .google.cloud.apihub.v1.StyleGuideContents contents = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public com.google.cloud.apihub.v1.StyleGuideContents.Builder getContentsBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getContentsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Input only. The contents of the uploaded style guide.
+     * 
+ * + * + * .google.cloud.apihub.v1.StyleGuideContents contents = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public com.google.cloud.apihub.v1.StyleGuideContentsOrBuilder getContentsOrBuilder() { + if (contentsBuilder_ != null) { + return contentsBuilder_.getMessageOrBuilder(); + } else { + return contents_ == null + ? com.google.cloud.apihub.v1.StyleGuideContents.getDefaultInstance() + : contents_; + } + } + /** + * + * + *
+     * Required. Input only. The contents of the uploaded style guide.
+     * 
+ * + * + * .google.cloud.apihub.v1.StyleGuideContents contents = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.StyleGuideContents, + com.google.cloud.apihub.v1.StyleGuideContents.Builder, + com.google.cloud.apihub.v1.StyleGuideContentsOrBuilder> + getContentsFieldBuilder() { + if (contentsBuilder_ == null) { + contentsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.StyleGuideContents, + com.google.cloud.apihub.v1.StyleGuideContents.Builder, + com.google.cloud.apihub.v1.StyleGuideContentsOrBuilder>( + getContents(), getParentForChildren(), isClean()); + contents_ = null; + } + return contentsBuilder_; + } + + @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.apihub.v1.StyleGuide) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.StyleGuide) + private static final com.google.cloud.apihub.v1.StyleGuide DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.StyleGuide(); + } + + public static com.google.cloud.apihub.v1.StyleGuide getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StyleGuide parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.StyleGuide getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/StyleGuideContents.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/StyleGuideContents.java new file mode 100644 index 000000000000..dc0235da4c8d --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/StyleGuideContents.java @@ -0,0 +1,720 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/linting_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The style guide contents.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.StyleGuideContents} + */ +public final class StyleGuideContents extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.StyleGuideContents) + StyleGuideContentsOrBuilder { + private static final long serialVersionUID = 0L; + // Use StyleGuideContents.newBuilder() to construct. + private StyleGuideContents(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StyleGuideContents() { + contents_ = com.google.protobuf.ByteString.EMPTY; + mimeType_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StyleGuideContents(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_StyleGuideContents_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_StyleGuideContents_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.StyleGuideContents.class, + com.google.cloud.apihub.v1.StyleGuideContents.Builder.class); + } + + public static final int CONTENTS_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString contents_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+   * Required. The contents of the style guide.
+   * 
+ * + * bytes contents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The contents. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContents() { + return contents_; + } + + public static final int MIME_TYPE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object mimeType_ = ""; + /** + * + * + *
+   * Required. The mime type of the content.
+   * 
+ * + * string mime_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The mimeType. + */ + @java.lang.Override + public java.lang.String getMimeType() { + java.lang.Object ref = mimeType_; + 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(); + mimeType_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The mime type of the content.
+   * 
+ * + * string mime_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for mimeType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMimeTypeBytes() { + java.lang.Object ref = mimeType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mimeType_ = 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 (!contents_.isEmpty()) { + output.writeBytes(1, contents_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mimeType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, mimeType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!contents_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, contents_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mimeType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, mimeType_); + } + size += getUnknownFields().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.apihub.v1.StyleGuideContents)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.StyleGuideContents other = + (com.google.cloud.apihub.v1.StyleGuideContents) obj; + + if (!getContents().equals(other.getContents())) return false; + if (!getMimeType().equals(other.getMimeType())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + CONTENTS_FIELD_NUMBER; + hash = (53 * hash) + getContents().hashCode(); + hash = (37 * hash) + MIME_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getMimeType().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.StyleGuideContents parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.StyleGuideContents 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.apihub.v1.StyleGuideContents parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.StyleGuideContents 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.apihub.v1.StyleGuideContents parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.StyleGuideContents parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.StyleGuideContents parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.StyleGuideContents 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.apihub.v1.StyleGuideContents parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.StyleGuideContents 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.apihub.v1.StyleGuideContents parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.StyleGuideContents 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.apihub.v1.StyleGuideContents 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 style guide contents.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.StyleGuideContents} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.StyleGuideContents) + com.google.cloud.apihub.v1.StyleGuideContentsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_StyleGuideContents_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_StyleGuideContents_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.StyleGuideContents.class, + com.google.cloud.apihub.v1.StyleGuideContents.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.StyleGuideContents.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + contents_ = com.google.protobuf.ByteString.EMPTY; + mimeType_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_StyleGuideContents_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.StyleGuideContents getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.StyleGuideContents.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.StyleGuideContents build() { + com.google.cloud.apihub.v1.StyleGuideContents result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.StyleGuideContents buildPartial() { + com.google.cloud.apihub.v1.StyleGuideContents result = + new com.google.cloud.apihub.v1.StyleGuideContents(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.StyleGuideContents result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.contents_ = contents_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.mimeType_ = mimeType_; + } + } + + @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.apihub.v1.StyleGuideContents) { + return mergeFrom((com.google.cloud.apihub.v1.StyleGuideContents) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.StyleGuideContents other) { + if (other == com.google.cloud.apihub.v1.StyleGuideContents.getDefaultInstance()) return this; + if (other.getContents() != com.google.protobuf.ByteString.EMPTY) { + setContents(other.getContents()); + } + if (!other.getMimeType().isEmpty()) { + mimeType_ = other.mimeType_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + contents_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + mimeType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.ByteString contents_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * Required. The contents of the style guide.
+     * 
+ * + * bytes contents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The contents. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContents() { + return contents_; + } + /** + * + * + *
+     * Required. The contents of the style guide.
+     * 
+ * + * bytes contents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The contents to set. + * @return This builder for chaining. + */ + public Builder setContents(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + contents_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The contents of the style guide.
+     * 
+ * + * bytes contents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearContents() { + bitField0_ = (bitField0_ & ~0x00000001); + contents_ = getDefaultInstance().getContents(); + onChanged(); + return this; + } + + private java.lang.Object mimeType_ = ""; + /** + * + * + *
+     * Required. The mime type of the content.
+     * 
+ * + * string mime_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The mimeType. + */ + public java.lang.String getMimeType() { + java.lang.Object ref = mimeType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mimeType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The mime type of the content.
+     * 
+ * + * string mime_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for mimeType. + */ + public com.google.protobuf.ByteString getMimeTypeBytes() { + java.lang.Object ref = mimeType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mimeType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The mime type of the content.
+     * 
+ * + * string mime_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The mimeType to set. + * @return This builder for chaining. + */ + public Builder setMimeType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + mimeType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The mime type of the content.
+     * 
+ * + * string mime_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearMimeType() { + mimeType_ = getDefaultInstance().getMimeType(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The mime type of the content.
+     * 
+ * + * string mime_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for mimeType to set. + * @return This builder for chaining. + */ + public Builder setMimeTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + mimeType_ = value; + bitField0_ |= 0x00000002; + 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.apihub.v1.StyleGuideContents) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.StyleGuideContents) + private static final com.google.cloud.apihub.v1.StyleGuideContents DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.StyleGuideContents(); + } + + public static com.google.cloud.apihub.v1.StyleGuideContents getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StyleGuideContents parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.StyleGuideContents getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/StyleGuideContentsOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/StyleGuideContentsOrBuilder.java new file mode 100644 index 000000000000..a9a7adc86509 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/StyleGuideContentsOrBuilder.java @@ -0,0 +1,64 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/linting_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface StyleGuideContentsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.StyleGuideContents) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The contents of the style guide.
+   * 
+ * + * bytes contents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The contents. + */ + com.google.protobuf.ByteString getContents(); + + /** + * + * + *
+   * Required. The mime type of the content.
+   * 
+ * + * string mime_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The mimeType. + */ + java.lang.String getMimeType(); + /** + * + * + *
+   * Required. The mime type of the content.
+   * 
+ * + * string mime_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for mimeType. + */ + com.google.protobuf.ByteString getMimeTypeBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/StyleGuideName.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/StyleGuideName.java new file mode 100644 index 000000000000..0728b2319b52 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/StyleGuideName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +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 StyleGuideName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_PLUGIN = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/plugins/{plugin}/styleGuide"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String plugin; + + @Deprecated + protected StyleGuideName() { + project = null; + location = null; + plugin = null; + } + + private StyleGuideName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + plugin = Preconditions.checkNotNull(builder.getPlugin()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getPlugin() { + return plugin; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static StyleGuideName of(String project, String location, String plugin) { + return newBuilder().setProject(project).setLocation(location).setPlugin(plugin).build(); + } + + public static String format(String project, String location, String plugin) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setPlugin(plugin) + .build() + .toString(); + } + + public static StyleGuideName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_PLUGIN.validatedMatch( + formattedString, "StyleGuideName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("plugin")); + } + + 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 (StyleGuideName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_PLUGIN.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); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (plugin != null) { + fieldMapBuilder.put("plugin", plugin); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_PLUGIN.instantiate( + "project", project, "location", location, "plugin", plugin); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + StyleGuideName that = ((StyleGuideName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.plugin, that.plugin); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(plugin); + return h; + } + + /** Builder for projects/{project}/locations/{location}/plugins/{plugin}/styleGuide. */ + public static class Builder { + private String project; + private String location; + private String plugin; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getPlugin() { + return plugin; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setPlugin(String plugin) { + this.plugin = plugin; + return this; + } + + private Builder(StyleGuideName styleGuideName) { + this.project = styleGuideName.project; + this.location = styleGuideName.location; + this.plugin = styleGuideName.plugin; + } + + public StyleGuideName build() { + return new StyleGuideName(this); + } + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/StyleGuideOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/StyleGuideOrBuilder.java new file mode 100644 index 000000000000..232504a5bea7 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/StyleGuideOrBuilder.java @@ -0,0 +1,125 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/linting_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface StyleGuideOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.StyleGuide) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. The name of the style guide.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. The name of the style guide.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. Target linter for the style guide.
+   * 
+ * + * .google.cloud.apihub.v1.Linter linter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for linter. + */ + int getLinterValue(); + /** + * + * + *
+   * Required. Target linter for the style guide.
+   * 
+ * + * .google.cloud.apihub.v1.Linter linter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The linter. + */ + com.google.cloud.apihub.v1.Linter getLinter(); + + /** + * + * + *
+   * Required. Input only. The contents of the uploaded style guide.
+   * 
+ * + * + * .google.cloud.apihub.v1.StyleGuideContents contents = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the contents field is set. + */ + boolean hasContents(); + /** + * + * + *
+   * Required. Input only. The contents of the uploaded style guide.
+   * 
+ * + * + * .google.cloud.apihub.v1.StyleGuideContents contents = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The contents. + */ + com.google.cloud.apihub.v1.StyleGuideContents getContents(); + /** + * + * + *
+   * Required. Input only. The contents of the uploaded style guide.
+   * 
+ * + * + * .google.cloud.apihub.v1.StyleGuideContents contents = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + * + */ + com.google.cloud.apihub.v1.StyleGuideContentsOrBuilder getContentsOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateApiRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateApiRequest.java new file mode 100644 index 000000000000..eeb1f5331603 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateApiRequest.java @@ -0,0 +1,1036 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [UpdateApi][google.cloud.apihub.v1.ApiHub.UpdateApi] method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.UpdateApiRequest} + */ +public final class UpdateApiRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.UpdateApiRequest) + UpdateApiRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateApiRequest.newBuilder() to construct. + private UpdateApiRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateApiRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateApiRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateApiRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateApiRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.UpdateApiRequest.class, + com.google.cloud.apihub.v1.UpdateApiRequest.Builder.class); + } + + private int bitField0_; + public static final int API_FIELD_NUMBER = 1; + private com.google.cloud.apihub.v1.Api api_; + /** + * + * + *
+   * Required. The API resource to update.
+   *
+   * The API resource's `name` field is used to identify the API resource to
+   * update.
+   * Format: `projects/{project}/locations/{location}/apis/{api}`
+   * 
+ * + * .google.cloud.apihub.v1.Api api = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the api field is set. + */ + @java.lang.Override + public boolean hasApi() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The API resource to update.
+   *
+   * The API resource's `name` field is used to identify the API resource to
+   * update.
+   * Format: `projects/{project}/locations/{location}/apis/{api}`
+   * 
+ * + * .google.cloud.apihub.v1.Api api = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The api. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Api getApi() { + return api_ == null ? com.google.cloud.apihub.v1.Api.getDefaultInstance() : api_; + } + /** + * + * + *
+   * Required. The API resource to update.
+   *
+   * The API resource's `name` field is used to identify the API resource to
+   * update.
+   * Format: `projects/{project}/locations/{location}/apis/{api}`
+   * 
+ * + * .google.cloud.apihub.v1.Api api = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.ApiOrBuilder getApiOrBuilder() { + return api_ == null ? com.google.cloud.apihub.v1.Api.getDefaultInstance() : api_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .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 ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .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. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getApi()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getApi()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += getUnknownFields().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.apihub.v1.UpdateApiRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.UpdateApiRequest other = + (com.google.cloud.apihub.v1.UpdateApiRequest) obj; + + if (hasApi() != other.hasApi()) return false; + if (hasApi()) { + if (!getApi().equals(other.getApi())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasApi()) { + hash = (37 * hash) + API_FIELD_NUMBER; + hash = (53 * hash) + getApi().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.UpdateApiRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.UpdateApiRequest 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.apihub.v1.UpdateApiRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.UpdateApiRequest 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.apihub.v1.UpdateApiRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.UpdateApiRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.UpdateApiRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.UpdateApiRequest 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.apihub.v1.UpdateApiRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.UpdateApiRequest 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.apihub.v1.UpdateApiRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.UpdateApiRequest 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.apihub.v1.UpdateApiRequest 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 [UpdateApi][google.cloud.apihub.v1.ApiHub.UpdateApi] method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.UpdateApiRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.UpdateApiRequest) + com.google.cloud.apihub.v1.UpdateApiRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateApiRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateApiRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.UpdateApiRequest.class, + com.google.cloud.apihub.v1.UpdateApiRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.UpdateApiRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getApiFieldBuilder(); + getUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + api_ = null; + if (apiBuilder_ != null) { + apiBuilder_.dispose(); + apiBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateApiRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.UpdateApiRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.UpdateApiRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.UpdateApiRequest build() { + com.google.cloud.apihub.v1.UpdateApiRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.UpdateApiRequest buildPartial() { + com.google.cloud.apihub.v1.UpdateApiRequest result = + new com.google.cloud.apihub.v1.UpdateApiRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.UpdateApiRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.api_ = apiBuilder_ == null ? api_ : apiBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.UpdateApiRequest) { + return mergeFrom((com.google.cloud.apihub.v1.UpdateApiRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.UpdateApiRequest other) { + if (other == com.google.cloud.apihub.v1.UpdateApiRequest.getDefaultInstance()) return this; + if (other.hasApi()) { + mergeApi(other.getApi()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getApiFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.apihub.v1.Api api_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Api, + com.google.cloud.apihub.v1.Api.Builder, + com.google.cloud.apihub.v1.ApiOrBuilder> + apiBuilder_; + /** + * + * + *
+     * Required. The API resource to update.
+     *
+     * The API resource's `name` field is used to identify the API resource to
+     * update.
+     * Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * .google.cloud.apihub.v1.Api api = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the api field is set. + */ + public boolean hasApi() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. The API resource to update.
+     *
+     * The API resource's `name` field is used to identify the API resource to
+     * update.
+     * Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * .google.cloud.apihub.v1.Api api = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The api. + */ + public com.google.cloud.apihub.v1.Api getApi() { + if (apiBuilder_ == null) { + return api_ == null ? com.google.cloud.apihub.v1.Api.getDefaultInstance() : api_; + } else { + return apiBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The API resource to update.
+     *
+     * The API resource's `name` field is used to identify the API resource to
+     * update.
+     * Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * .google.cloud.apihub.v1.Api api = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setApi(com.google.cloud.apihub.v1.Api value) { + if (apiBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + api_ = value; + } else { + apiBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The API resource to update.
+     *
+     * The API resource's `name` field is used to identify the API resource to
+     * update.
+     * Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * .google.cloud.apihub.v1.Api api = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setApi(com.google.cloud.apihub.v1.Api.Builder builderForValue) { + if (apiBuilder_ == null) { + api_ = builderForValue.build(); + } else { + apiBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The API resource to update.
+     *
+     * The API resource's `name` field is used to identify the API resource to
+     * update.
+     * Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * .google.cloud.apihub.v1.Api api = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeApi(com.google.cloud.apihub.v1.Api value) { + if (apiBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && api_ != null + && api_ != com.google.cloud.apihub.v1.Api.getDefaultInstance()) { + getApiBuilder().mergeFrom(value); + } else { + api_ = value; + } + } else { + apiBuilder_.mergeFrom(value); + } + if (api_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The API resource to update.
+     *
+     * The API resource's `name` field is used to identify the API resource to
+     * update.
+     * Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * .google.cloud.apihub.v1.Api api = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearApi() { + bitField0_ = (bitField0_ & ~0x00000001); + api_ = null; + if (apiBuilder_ != null) { + apiBuilder_.dispose(); + apiBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The API resource to update.
+     *
+     * The API resource's `name` field is used to identify the API resource to
+     * update.
+     * Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * .google.cloud.apihub.v1.Api api = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.apihub.v1.Api.Builder getApiBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getApiFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The API resource to update.
+     *
+     * The API resource's `name` field is used to identify the API resource to
+     * update.
+     * Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * .google.cloud.apihub.v1.Api api = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.apihub.v1.ApiOrBuilder getApiOrBuilder() { + if (apiBuilder_ != null) { + return apiBuilder_.getMessageOrBuilder(); + } else { + return api_ == null ? com.google.cloud.apihub.v1.Api.getDefaultInstance() : api_; + } + } + /** + * + * + *
+     * Required. The API resource to update.
+     *
+     * The API resource's `name` field is used to identify the API resource to
+     * update.
+     * Format: `projects/{project}/locations/{location}/apis/{api}`
+     * 
+ * + * .google.cloud.apihub.v1.Api api = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Api, + com.google.cloud.apihub.v1.Api.Builder, + com.google.cloud.apihub.v1.ApiOrBuilder> + getApiFieldBuilder() { + if (apiBuilder_ == null) { + apiBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Api, + com.google.cloud.apihub.v1.Api.Builder, + com.google.cloud.apihub.v1.ApiOrBuilder>( + getApi(), getParentForChildren(), isClean()); + api_ = null; + } + return apiBuilder_; + } + + 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. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .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. The list of fields to update.
+     * 
+ * + * .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; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .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(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .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. The list of fields to update.
+     * 
+ * + * .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.apihub.v1.UpdateApiRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.UpdateApiRequest) + private static final com.google.cloud.apihub.v1.UpdateApiRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.UpdateApiRequest(); + } + + public static com.google.cloud.apihub.v1.UpdateApiRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateApiRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.UpdateApiRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateApiRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateApiRequestOrBuilder.java new file mode 100644 index 000000000000..1f6919753edb --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateApiRequestOrBuilder.java @@ -0,0 +1,111 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface UpdateApiRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.UpdateApiRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The API resource to update.
+   *
+   * The API resource's `name` field is used to identify the API resource to
+   * update.
+   * Format: `projects/{project}/locations/{location}/apis/{api}`
+   * 
+ * + * .google.cloud.apihub.v1.Api api = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the api field is set. + */ + boolean hasApi(); + /** + * + * + *
+   * Required. The API resource to update.
+   *
+   * The API resource's `name` field is used to identify the API resource to
+   * update.
+   * Format: `projects/{project}/locations/{location}/apis/{api}`
+   * 
+ * + * .google.cloud.apihub.v1.Api api = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The api. + */ + com.google.cloud.apihub.v1.Api getApi(); + /** + * + * + *
+   * Required. The API resource to update.
+   *
+   * The API resource's `name` field is used to identify the API resource to
+   * update.
+   * Format: `projects/{project}/locations/{location}/apis/{api}`
+   * 
+ * + * .google.cloud.apihub.v1.Api api = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.apihub.v1.ApiOrBuilder getApiOrBuilder(); + + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateAttributeRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateAttributeRequest.java new file mode 100644 index 000000000000..c45f6e038c83 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateAttributeRequest.java @@ -0,0 +1,1071 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] method's
+ * request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.UpdateAttributeRequest} + */ +public final class UpdateAttributeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.UpdateAttributeRequest) + UpdateAttributeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateAttributeRequest.newBuilder() to construct. + private UpdateAttributeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateAttributeRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateAttributeRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateAttributeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateAttributeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.UpdateAttributeRequest.class, + com.google.cloud.apihub.v1.UpdateAttributeRequest.Builder.class); + } + + private int bitField0_; + public static final int ATTRIBUTE_FIELD_NUMBER = 1; + private com.google.cloud.apihub.v1.Attribute attribute_; + /** + * + * + *
+   * Required. The attribute to update.
+   *
+   * The attribute's `name` field is used to identify the attribute to update.
+   * Format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`
+   * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the attribute field is set. + */ + @java.lang.Override + public boolean hasAttribute() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The attribute to update.
+   *
+   * The attribute's `name` field is used to identify the attribute to update.
+   * Format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`
+   * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The attribute. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Attribute getAttribute() { + return attribute_ == null + ? com.google.cloud.apihub.v1.Attribute.getDefaultInstance() + : attribute_; + } + /** + * + * + *
+   * Required. The attribute to update.
+   *
+   * The attribute's `name` field is used to identify the attribute to update.
+   * Format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`
+   * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeOrBuilder getAttributeOrBuilder() { + return attribute_ == null + ? com.google.cloud.apihub.v1.Attribute.getDefaultInstance() + : attribute_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .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 ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .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. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getAttribute()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getAttribute()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += getUnknownFields().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.apihub.v1.UpdateAttributeRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.UpdateAttributeRequest other = + (com.google.cloud.apihub.v1.UpdateAttributeRequest) obj; + + if (hasAttribute() != other.hasAttribute()) return false; + if (hasAttribute()) { + if (!getAttribute().equals(other.getAttribute())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasAttribute()) { + hash = (37 * hash) + ATTRIBUTE_FIELD_NUMBER; + hash = (53 * hash) + getAttribute().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.UpdateAttributeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.UpdateAttributeRequest 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.apihub.v1.UpdateAttributeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.UpdateAttributeRequest 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.apihub.v1.UpdateAttributeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.UpdateAttributeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.UpdateAttributeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.UpdateAttributeRequest 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.apihub.v1.UpdateAttributeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.UpdateAttributeRequest 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.apihub.v1.UpdateAttributeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.UpdateAttributeRequest 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.apihub.v1.UpdateAttributeRequest 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 [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] method's
+   * request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.UpdateAttributeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.UpdateAttributeRequest) + com.google.cloud.apihub.v1.UpdateAttributeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateAttributeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateAttributeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.UpdateAttributeRequest.class, + com.google.cloud.apihub.v1.UpdateAttributeRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.UpdateAttributeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAttributeFieldBuilder(); + getUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + attribute_ = null; + if (attributeBuilder_ != null) { + attributeBuilder_.dispose(); + attributeBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateAttributeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.UpdateAttributeRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.UpdateAttributeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.UpdateAttributeRequest build() { + com.google.cloud.apihub.v1.UpdateAttributeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.UpdateAttributeRequest buildPartial() { + com.google.cloud.apihub.v1.UpdateAttributeRequest result = + new com.google.cloud.apihub.v1.UpdateAttributeRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.UpdateAttributeRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.attribute_ = attributeBuilder_ == null ? attribute_ : attributeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.UpdateAttributeRequest) { + return mergeFrom((com.google.cloud.apihub.v1.UpdateAttributeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.UpdateAttributeRequest other) { + if (other == com.google.cloud.apihub.v1.UpdateAttributeRequest.getDefaultInstance()) + return this; + if (other.hasAttribute()) { + mergeAttribute(other.getAttribute()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getAttributeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.apihub.v1.Attribute attribute_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Attribute, + com.google.cloud.apihub.v1.Attribute.Builder, + com.google.cloud.apihub.v1.AttributeOrBuilder> + attributeBuilder_; + /** + * + * + *
+     * Required. The attribute to update.
+     *
+     * The attribute's `name` field is used to identify the attribute to update.
+     * Format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the attribute field is set. + */ + public boolean hasAttribute() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. The attribute to update.
+     *
+     * The attribute's `name` field is used to identify the attribute to update.
+     * Format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The attribute. + */ + public com.google.cloud.apihub.v1.Attribute getAttribute() { + if (attributeBuilder_ == null) { + return attribute_ == null + ? com.google.cloud.apihub.v1.Attribute.getDefaultInstance() + : attribute_; + } else { + return attributeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The attribute to update.
+     *
+     * The attribute's `name` field is used to identify the attribute to update.
+     * Format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAttribute(com.google.cloud.apihub.v1.Attribute value) { + if (attributeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attribute_ = value; + } else { + attributeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The attribute to update.
+     *
+     * The attribute's `name` field is used to identify the attribute to update.
+     * Format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAttribute(com.google.cloud.apihub.v1.Attribute.Builder builderForValue) { + if (attributeBuilder_ == null) { + attribute_ = builderForValue.build(); + } else { + attributeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The attribute to update.
+     *
+     * The attribute's `name` field is used to identify the attribute to update.
+     * Format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeAttribute(com.google.cloud.apihub.v1.Attribute value) { + if (attributeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && attribute_ != null + && attribute_ != com.google.cloud.apihub.v1.Attribute.getDefaultInstance()) { + getAttributeBuilder().mergeFrom(value); + } else { + attribute_ = value; + } + } else { + attributeBuilder_.mergeFrom(value); + } + if (attribute_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The attribute to update.
+     *
+     * The attribute's `name` field is used to identify the attribute to update.
+     * Format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearAttribute() { + bitField0_ = (bitField0_ & ~0x00000001); + attribute_ = null; + if (attributeBuilder_ != null) { + attributeBuilder_.dispose(); + attributeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The attribute to update.
+     *
+     * The attribute's `name` field is used to identify the attribute to update.
+     * Format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.Attribute.Builder getAttributeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getAttributeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The attribute to update.
+     *
+     * The attribute's `name` field is used to identify the attribute to update.
+     * Format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.AttributeOrBuilder getAttributeOrBuilder() { + if (attributeBuilder_ != null) { + return attributeBuilder_.getMessageOrBuilder(); + } else { + return attribute_ == null + ? com.google.cloud.apihub.v1.Attribute.getDefaultInstance() + : attribute_; + } + } + /** + * + * + *
+     * Required. The attribute to update.
+     *
+     * The attribute's `name` field is used to identify the attribute to update.
+     * Format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`
+     * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Attribute, + com.google.cloud.apihub.v1.Attribute.Builder, + com.google.cloud.apihub.v1.AttributeOrBuilder> + getAttributeFieldBuilder() { + if (attributeBuilder_ == null) { + attributeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Attribute, + com.google.cloud.apihub.v1.Attribute.Builder, + com.google.cloud.apihub.v1.AttributeOrBuilder>( + getAttribute(), getParentForChildren(), isClean()); + attribute_ = null; + } + return attributeBuilder_; + } + + 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. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .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. The list of fields to update.
+     * 
+ * + * .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; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .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(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .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. The list of fields to update.
+     * 
+ * + * .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.apihub.v1.UpdateAttributeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.UpdateAttributeRequest) + private static final com.google.cloud.apihub.v1.UpdateAttributeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.UpdateAttributeRequest(); + } + + public static com.google.cloud.apihub.v1.UpdateAttributeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateAttributeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.UpdateAttributeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateAttributeRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateAttributeRequestOrBuilder.java new file mode 100644 index 000000000000..344099d2814d --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateAttributeRequestOrBuilder.java @@ -0,0 +1,117 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface UpdateAttributeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.UpdateAttributeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The attribute to update.
+   *
+   * The attribute's `name` field is used to identify the attribute to update.
+   * Format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`
+   * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the attribute field is set. + */ + boolean hasAttribute(); + /** + * + * + *
+   * Required. The attribute to update.
+   *
+   * The attribute's `name` field is used to identify the attribute to update.
+   * Format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`
+   * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The attribute. + */ + com.google.cloud.apihub.v1.Attribute getAttribute(); + /** + * + * + *
+   * Required. The attribute to update.
+   *
+   * The attribute's `name` field is used to identify the attribute to update.
+   * Format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`
+   * 
+ * + * + * .google.cloud.apihub.v1.Attribute attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.apihub.v1.AttributeOrBuilder getAttributeOrBuilder(); + + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateDependencyRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateDependencyRequest.java new file mode 100644 index 000000000000..458382076a44 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateDependencyRequest.java @@ -0,0 +1,1061 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The
+ * [UpdateDependency][google.cloud.apihub.v1.ApiHubDependencies.UpdateDependency]
+ * method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.UpdateDependencyRequest} + */ +public final class UpdateDependencyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.UpdateDependencyRequest) + UpdateDependencyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateDependencyRequest.newBuilder() to construct. + private UpdateDependencyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateDependencyRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateDependencyRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateDependencyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateDependencyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.UpdateDependencyRequest.class, + com.google.cloud.apihub.v1.UpdateDependencyRequest.Builder.class); + } + + private int bitField0_; + public static final int DEPENDENCY_FIELD_NUMBER = 1; + private com.google.cloud.apihub.v1.Dependency dependency_; + /** + * + * + *
+   * Required. The dependency resource to update.
+   *
+   * The dependency's `name` field is used to identify the dependency to update.
+   * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+   * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dependency field is set. + */ + @java.lang.Override + public boolean hasDependency() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The dependency resource to update.
+   *
+   * The dependency's `name` field is used to identify the dependency to update.
+   * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+   * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dependency. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Dependency getDependency() { + return dependency_ == null + ? com.google.cloud.apihub.v1.Dependency.getDefaultInstance() + : dependency_; + } + /** + * + * + *
+   * Required. The dependency resource to update.
+   *
+   * The dependency's `name` field is used to identify the dependency to update.
+   * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+   * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.DependencyOrBuilder getDependencyOrBuilder() { + return dependency_ == null + ? com.google.cloud.apihub.v1.Dependency.getDefaultInstance() + : dependency_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .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 ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .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. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getDependency()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDependency()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += getUnknownFields().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.apihub.v1.UpdateDependencyRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.UpdateDependencyRequest other = + (com.google.cloud.apihub.v1.UpdateDependencyRequest) obj; + + if (hasDependency() != other.hasDependency()) return false; + if (hasDependency()) { + if (!getDependency().equals(other.getDependency())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasDependency()) { + hash = (37 * hash) + DEPENDENCY_FIELD_NUMBER; + hash = (53 * hash) + getDependency().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.UpdateDependencyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.UpdateDependencyRequest 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.apihub.v1.UpdateDependencyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.UpdateDependencyRequest 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.apihub.v1.UpdateDependencyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.UpdateDependencyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.UpdateDependencyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.UpdateDependencyRequest 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.apihub.v1.UpdateDependencyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.UpdateDependencyRequest 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.apihub.v1.UpdateDependencyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.UpdateDependencyRequest 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.apihub.v1.UpdateDependencyRequest 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
+   * [UpdateDependency][google.cloud.apihub.v1.ApiHubDependencies.UpdateDependency]
+   * method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.UpdateDependencyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.UpdateDependencyRequest) + com.google.cloud.apihub.v1.UpdateDependencyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateDependencyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateDependencyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.UpdateDependencyRequest.class, + com.google.cloud.apihub.v1.UpdateDependencyRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.UpdateDependencyRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getDependencyFieldBuilder(); + getUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + dependency_ = null; + if (dependencyBuilder_ != null) { + dependencyBuilder_.dispose(); + dependencyBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateDependencyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.UpdateDependencyRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.UpdateDependencyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.UpdateDependencyRequest build() { + com.google.cloud.apihub.v1.UpdateDependencyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.UpdateDependencyRequest buildPartial() { + com.google.cloud.apihub.v1.UpdateDependencyRequest result = + new com.google.cloud.apihub.v1.UpdateDependencyRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.UpdateDependencyRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.dependency_ = dependencyBuilder_ == null ? dependency_ : dependencyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.UpdateDependencyRequest) { + return mergeFrom((com.google.cloud.apihub.v1.UpdateDependencyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.UpdateDependencyRequest other) { + if (other == com.google.cloud.apihub.v1.UpdateDependencyRequest.getDefaultInstance()) + return this; + if (other.hasDependency()) { + mergeDependency(other.getDependency()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getDependencyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.apihub.v1.Dependency dependency_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Dependency, + com.google.cloud.apihub.v1.Dependency.Builder, + com.google.cloud.apihub.v1.DependencyOrBuilder> + dependencyBuilder_; + /** + * + * + *
+     * Required. The dependency resource to update.
+     *
+     * The dependency's `name` field is used to identify the dependency to update.
+     * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+     * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dependency field is set. + */ + public boolean hasDependency() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. The dependency resource to update.
+     *
+     * The dependency's `name` field is used to identify the dependency to update.
+     * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+     * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dependency. + */ + public com.google.cloud.apihub.v1.Dependency getDependency() { + if (dependencyBuilder_ == null) { + return dependency_ == null + ? com.google.cloud.apihub.v1.Dependency.getDefaultInstance() + : dependency_; + } else { + return dependencyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The dependency resource to update.
+     *
+     * The dependency's `name` field is used to identify the dependency to update.
+     * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+     * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDependency(com.google.cloud.apihub.v1.Dependency value) { + if (dependencyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dependency_ = value; + } else { + dependencyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The dependency resource to update.
+     *
+     * The dependency's `name` field is used to identify the dependency to update.
+     * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+     * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDependency(com.google.cloud.apihub.v1.Dependency.Builder builderForValue) { + if (dependencyBuilder_ == null) { + dependency_ = builderForValue.build(); + } else { + dependencyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The dependency resource to update.
+     *
+     * The dependency's `name` field is used to identify the dependency to update.
+     * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+     * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDependency(com.google.cloud.apihub.v1.Dependency value) { + if (dependencyBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && dependency_ != null + && dependency_ != com.google.cloud.apihub.v1.Dependency.getDefaultInstance()) { + getDependencyBuilder().mergeFrom(value); + } else { + dependency_ = value; + } + } else { + dependencyBuilder_.mergeFrom(value); + } + if (dependency_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The dependency resource to update.
+     *
+     * The dependency's `name` field is used to identify the dependency to update.
+     * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+     * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDependency() { + bitField0_ = (bitField0_ & ~0x00000001); + dependency_ = null; + if (dependencyBuilder_ != null) { + dependencyBuilder_.dispose(); + dependencyBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The dependency resource to update.
+     *
+     * The dependency's `name` field is used to identify the dependency to update.
+     * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+     * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.Dependency.Builder getDependencyBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getDependencyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The dependency resource to update.
+     *
+     * The dependency's `name` field is used to identify the dependency to update.
+     * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+     * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.DependencyOrBuilder getDependencyOrBuilder() { + if (dependencyBuilder_ != null) { + return dependencyBuilder_.getMessageOrBuilder(); + } else { + return dependency_ == null + ? com.google.cloud.apihub.v1.Dependency.getDefaultInstance() + : dependency_; + } + } + /** + * + * + *
+     * Required. The dependency resource to update.
+     *
+     * The dependency's `name` field is used to identify the dependency to update.
+     * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+     * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Dependency, + com.google.cloud.apihub.v1.Dependency.Builder, + com.google.cloud.apihub.v1.DependencyOrBuilder> + getDependencyFieldBuilder() { + if (dependencyBuilder_ == null) { + dependencyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Dependency, + com.google.cloud.apihub.v1.Dependency.Builder, + com.google.cloud.apihub.v1.DependencyOrBuilder>( + getDependency(), getParentForChildren(), isClean()); + dependency_ = null; + } + return dependencyBuilder_; + } + + 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. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .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. The list of fields to update.
+     * 
+ * + * .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; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .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(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .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. The list of fields to update.
+     * 
+ * + * .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.apihub.v1.UpdateDependencyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.UpdateDependencyRequest) + private static final com.google.cloud.apihub.v1.UpdateDependencyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.UpdateDependencyRequest(); + } + + public static com.google.cloud.apihub.v1.UpdateDependencyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateDependencyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.UpdateDependencyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateDependencyRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateDependencyRequestOrBuilder.java new file mode 100644 index 000000000000..c571f0f07164 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateDependencyRequestOrBuilder.java @@ -0,0 +1,114 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface UpdateDependencyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.UpdateDependencyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The dependency resource to update.
+   *
+   * The dependency's `name` field is used to identify the dependency to update.
+   * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+   * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dependency field is set. + */ + boolean hasDependency(); + /** + * + * + *
+   * Required. The dependency resource to update.
+   *
+   * The dependency's `name` field is used to identify the dependency to update.
+   * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+   * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dependency. + */ + com.google.cloud.apihub.v1.Dependency getDependency(); + /** + * + * + *
+   * Required. The dependency resource to update.
+   *
+   * The dependency's `name` field is used to identify the dependency to update.
+   * Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
+   * 
+ * + * + * .google.cloud.apihub.v1.Dependency dependency = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.apihub.v1.DependencyOrBuilder getDependencyOrBuilder(); + + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateDeploymentRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateDeploymentRequest.java new file mode 100644 index 000000000000..8090039b73fd --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateDeploymentRequest.java @@ -0,0 +1,1071 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [UpdateDeployment][google.cloud.apihub.v1.ApiHub.UpdateDeployment]
+ * method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.UpdateDeploymentRequest} + */ +public final class UpdateDeploymentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.UpdateDeploymentRequest) + UpdateDeploymentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateDeploymentRequest.newBuilder() to construct. + private UpdateDeploymentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateDeploymentRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateDeploymentRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateDeploymentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateDeploymentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.UpdateDeploymentRequest.class, + com.google.cloud.apihub.v1.UpdateDeploymentRequest.Builder.class); + } + + private int bitField0_; + public static final int DEPLOYMENT_FIELD_NUMBER = 1; + private com.google.cloud.apihub.v1.Deployment deployment_; + /** + * + * + *
+   * Required. The deployment resource to update.
+   *
+   * The deployment resource's `name` field is used to identify the deployment
+   * resource to update.
+   * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the deployment field is set. + */ + @java.lang.Override + public boolean hasDeployment() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The deployment resource to update.
+   *
+   * The deployment resource's `name` field is used to identify the deployment
+   * resource to update.
+   * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The deployment. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Deployment getDeployment() { + return deployment_ == null + ? com.google.cloud.apihub.v1.Deployment.getDefaultInstance() + : deployment_; + } + /** + * + * + *
+   * Required. The deployment resource to update.
+   *
+   * The deployment resource's `name` field is used to identify the deployment
+   * resource to update.
+   * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.DeploymentOrBuilder getDeploymentOrBuilder() { + return deployment_ == null + ? com.google.cloud.apihub.v1.Deployment.getDefaultInstance() + : deployment_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .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 ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .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. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getDeployment()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDeployment()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += getUnknownFields().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.apihub.v1.UpdateDeploymentRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.UpdateDeploymentRequest other = + (com.google.cloud.apihub.v1.UpdateDeploymentRequest) obj; + + if (hasDeployment() != other.hasDeployment()) return false; + if (hasDeployment()) { + if (!getDeployment().equals(other.getDeployment())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasDeployment()) { + hash = (37 * hash) + DEPLOYMENT_FIELD_NUMBER; + hash = (53 * hash) + getDeployment().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.UpdateDeploymentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.UpdateDeploymentRequest 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.apihub.v1.UpdateDeploymentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.UpdateDeploymentRequest 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.apihub.v1.UpdateDeploymentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.UpdateDeploymentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.UpdateDeploymentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.UpdateDeploymentRequest 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.apihub.v1.UpdateDeploymentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.UpdateDeploymentRequest 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.apihub.v1.UpdateDeploymentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.UpdateDeploymentRequest 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.apihub.v1.UpdateDeploymentRequest 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 [UpdateDeployment][google.cloud.apihub.v1.ApiHub.UpdateDeployment]
+   * method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.UpdateDeploymentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.UpdateDeploymentRequest) + com.google.cloud.apihub.v1.UpdateDeploymentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateDeploymentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateDeploymentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.UpdateDeploymentRequest.class, + com.google.cloud.apihub.v1.UpdateDeploymentRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.UpdateDeploymentRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getDeploymentFieldBuilder(); + getUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + deployment_ = null; + if (deploymentBuilder_ != null) { + deploymentBuilder_.dispose(); + deploymentBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateDeploymentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.UpdateDeploymentRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.UpdateDeploymentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.UpdateDeploymentRequest build() { + com.google.cloud.apihub.v1.UpdateDeploymentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.UpdateDeploymentRequest buildPartial() { + com.google.cloud.apihub.v1.UpdateDeploymentRequest result = + new com.google.cloud.apihub.v1.UpdateDeploymentRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.UpdateDeploymentRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.deployment_ = deploymentBuilder_ == null ? deployment_ : deploymentBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.UpdateDeploymentRequest) { + return mergeFrom((com.google.cloud.apihub.v1.UpdateDeploymentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.UpdateDeploymentRequest other) { + if (other == com.google.cloud.apihub.v1.UpdateDeploymentRequest.getDefaultInstance()) + return this; + if (other.hasDeployment()) { + mergeDeployment(other.getDeployment()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getDeploymentFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.apihub.v1.Deployment deployment_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Deployment, + com.google.cloud.apihub.v1.Deployment.Builder, + com.google.cloud.apihub.v1.DeploymentOrBuilder> + deploymentBuilder_; + /** + * + * + *
+     * Required. The deployment resource to update.
+     *
+     * The deployment resource's `name` field is used to identify the deployment
+     * resource to update.
+     * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the deployment field is set. + */ + public boolean hasDeployment() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. The deployment resource to update.
+     *
+     * The deployment resource's `name` field is used to identify the deployment
+     * resource to update.
+     * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The deployment. + */ + public com.google.cloud.apihub.v1.Deployment getDeployment() { + if (deploymentBuilder_ == null) { + return deployment_ == null + ? com.google.cloud.apihub.v1.Deployment.getDefaultInstance() + : deployment_; + } else { + return deploymentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The deployment resource to update.
+     *
+     * The deployment resource's `name` field is used to identify the deployment
+     * resource to update.
+     * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDeployment(com.google.cloud.apihub.v1.Deployment value) { + if (deploymentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deployment_ = value; + } else { + deploymentBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The deployment resource to update.
+     *
+     * The deployment resource's `name` field is used to identify the deployment
+     * resource to update.
+     * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDeployment(com.google.cloud.apihub.v1.Deployment.Builder builderForValue) { + if (deploymentBuilder_ == null) { + deployment_ = builderForValue.build(); + } else { + deploymentBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The deployment resource to update.
+     *
+     * The deployment resource's `name` field is used to identify the deployment
+     * resource to update.
+     * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDeployment(com.google.cloud.apihub.v1.Deployment value) { + if (deploymentBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && deployment_ != null + && deployment_ != com.google.cloud.apihub.v1.Deployment.getDefaultInstance()) { + getDeploymentBuilder().mergeFrom(value); + } else { + deployment_ = value; + } + } else { + deploymentBuilder_.mergeFrom(value); + } + if (deployment_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The deployment resource to update.
+     *
+     * The deployment resource's `name` field is used to identify the deployment
+     * resource to update.
+     * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDeployment() { + bitField0_ = (bitField0_ & ~0x00000001); + deployment_ = null; + if (deploymentBuilder_ != null) { + deploymentBuilder_.dispose(); + deploymentBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The deployment resource to update.
+     *
+     * The deployment resource's `name` field is used to identify the deployment
+     * resource to update.
+     * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.Deployment.Builder getDeploymentBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getDeploymentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The deployment resource to update.
+     *
+     * The deployment resource's `name` field is used to identify the deployment
+     * resource to update.
+     * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.DeploymentOrBuilder getDeploymentOrBuilder() { + if (deploymentBuilder_ != null) { + return deploymentBuilder_.getMessageOrBuilder(); + } else { + return deployment_ == null + ? com.google.cloud.apihub.v1.Deployment.getDefaultInstance() + : deployment_; + } + } + /** + * + * + *
+     * Required. The deployment resource to update.
+     *
+     * The deployment resource's `name` field is used to identify the deployment
+     * resource to update.
+     * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Deployment, + com.google.cloud.apihub.v1.Deployment.Builder, + com.google.cloud.apihub.v1.DeploymentOrBuilder> + getDeploymentFieldBuilder() { + if (deploymentBuilder_ == null) { + deploymentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Deployment, + com.google.cloud.apihub.v1.Deployment.Builder, + com.google.cloud.apihub.v1.DeploymentOrBuilder>( + getDeployment(), getParentForChildren(), isClean()); + deployment_ = null; + } + return deploymentBuilder_; + } + + 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. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .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. The list of fields to update.
+     * 
+ * + * .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; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .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(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .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. The list of fields to update.
+     * 
+ * + * .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.apihub.v1.UpdateDeploymentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.UpdateDeploymentRequest) + private static final com.google.cloud.apihub.v1.UpdateDeploymentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.UpdateDeploymentRequest(); + } + + public static com.google.cloud.apihub.v1.UpdateDeploymentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateDeploymentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.UpdateDeploymentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateDeploymentRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateDeploymentRequestOrBuilder.java new file mode 100644 index 000000000000..1b8874ae2470 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateDeploymentRequestOrBuilder.java @@ -0,0 +1,117 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface UpdateDeploymentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.UpdateDeploymentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The deployment resource to update.
+   *
+   * The deployment resource's `name` field is used to identify the deployment
+   * resource to update.
+   * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the deployment field is set. + */ + boolean hasDeployment(); + /** + * + * + *
+   * Required. The deployment resource to update.
+   *
+   * The deployment resource's `name` field is used to identify the deployment
+   * resource to update.
+   * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The deployment. + */ + com.google.cloud.apihub.v1.Deployment getDeployment(); + /** + * + * + *
+   * Required. The deployment resource to update.
+   *
+   * The deployment resource's `name` field is used to identify the deployment
+   * resource to update.
+   * Format: `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * + * .google.cloud.apihub.v1.Deployment deployment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.apihub.v1.DeploymentOrBuilder getDeploymentOrBuilder(); + + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateExternalApiRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateExternalApiRequest.java new file mode 100644 index 000000000000..f76b9ecc0f01 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateExternalApiRequest.java @@ -0,0 +1,1072 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [UpdateExternalApi][google.cloud.apihub.v1.ApiHub.UpdateExternalApi]
+ * method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.UpdateExternalApiRequest} + */ +public final class UpdateExternalApiRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.UpdateExternalApiRequest) + UpdateExternalApiRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateExternalApiRequest.newBuilder() to construct. + private UpdateExternalApiRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateExternalApiRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateExternalApiRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateExternalApiRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateExternalApiRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.UpdateExternalApiRequest.class, + com.google.cloud.apihub.v1.UpdateExternalApiRequest.Builder.class); + } + + private int bitField0_; + public static final int EXTERNAL_API_FIELD_NUMBER = 1; + private com.google.cloud.apihub.v1.ExternalApi externalApi_; + /** + * + * + *
+   * Required. The External API resource to update.
+   *
+   * The External API resource's `name` field is used to identify the External
+   * API resource to update. Format:
+   * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+   * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the externalApi field is set. + */ + @java.lang.Override + public boolean hasExternalApi() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The External API resource to update.
+   *
+   * The External API resource's `name` field is used to identify the External
+   * API resource to update. Format:
+   * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+   * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The externalApi. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.ExternalApi getExternalApi() { + return externalApi_ == null + ? com.google.cloud.apihub.v1.ExternalApi.getDefaultInstance() + : externalApi_; + } + /** + * + * + *
+   * Required. The External API resource to update.
+   *
+   * The External API resource's `name` field is used to identify the External
+   * API resource to update. Format:
+   * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+   * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.ExternalApiOrBuilder getExternalApiOrBuilder() { + return externalApi_ == null + ? com.google.cloud.apihub.v1.ExternalApi.getDefaultInstance() + : externalApi_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .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 ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .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. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getExternalApi()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getExternalApi()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += getUnknownFields().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.apihub.v1.UpdateExternalApiRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.UpdateExternalApiRequest other = + (com.google.cloud.apihub.v1.UpdateExternalApiRequest) obj; + + if (hasExternalApi() != other.hasExternalApi()) return false; + if (hasExternalApi()) { + if (!getExternalApi().equals(other.getExternalApi())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasExternalApi()) { + hash = (37 * hash) + EXTERNAL_API_FIELD_NUMBER; + hash = (53 * hash) + getExternalApi().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.UpdateExternalApiRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.UpdateExternalApiRequest 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.apihub.v1.UpdateExternalApiRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.UpdateExternalApiRequest 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.apihub.v1.UpdateExternalApiRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.UpdateExternalApiRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.UpdateExternalApiRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.UpdateExternalApiRequest 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.apihub.v1.UpdateExternalApiRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.UpdateExternalApiRequest 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.apihub.v1.UpdateExternalApiRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.UpdateExternalApiRequest 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.apihub.v1.UpdateExternalApiRequest 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 [UpdateExternalApi][google.cloud.apihub.v1.ApiHub.UpdateExternalApi]
+   * method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.UpdateExternalApiRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.UpdateExternalApiRequest) + com.google.cloud.apihub.v1.UpdateExternalApiRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateExternalApiRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateExternalApiRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.UpdateExternalApiRequest.class, + com.google.cloud.apihub.v1.UpdateExternalApiRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.UpdateExternalApiRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getExternalApiFieldBuilder(); + getUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + externalApi_ = null; + if (externalApiBuilder_ != null) { + externalApiBuilder_.dispose(); + externalApiBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateExternalApiRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.UpdateExternalApiRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.UpdateExternalApiRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.UpdateExternalApiRequest build() { + com.google.cloud.apihub.v1.UpdateExternalApiRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.UpdateExternalApiRequest buildPartial() { + com.google.cloud.apihub.v1.UpdateExternalApiRequest result = + new com.google.cloud.apihub.v1.UpdateExternalApiRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.UpdateExternalApiRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.externalApi_ = + externalApiBuilder_ == null ? externalApi_ : externalApiBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.UpdateExternalApiRequest) { + return mergeFrom((com.google.cloud.apihub.v1.UpdateExternalApiRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.UpdateExternalApiRequest other) { + if (other == com.google.cloud.apihub.v1.UpdateExternalApiRequest.getDefaultInstance()) + return this; + if (other.hasExternalApi()) { + mergeExternalApi(other.getExternalApi()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getExternalApiFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.apihub.v1.ExternalApi externalApi_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.ExternalApi, + com.google.cloud.apihub.v1.ExternalApi.Builder, + com.google.cloud.apihub.v1.ExternalApiOrBuilder> + externalApiBuilder_; + /** + * + * + *
+     * Required. The External API resource to update.
+     *
+     * The External API resource's `name` field is used to identify the External
+     * API resource to update. Format:
+     * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+     * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the externalApi field is set. + */ + public boolean hasExternalApi() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. The External API resource to update.
+     *
+     * The External API resource's `name` field is used to identify the External
+     * API resource to update. Format:
+     * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+     * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The externalApi. + */ + public com.google.cloud.apihub.v1.ExternalApi getExternalApi() { + if (externalApiBuilder_ == null) { + return externalApi_ == null + ? com.google.cloud.apihub.v1.ExternalApi.getDefaultInstance() + : externalApi_; + } else { + return externalApiBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The External API resource to update.
+     *
+     * The External API resource's `name` field is used to identify the External
+     * API resource to update. Format:
+     * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+     * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setExternalApi(com.google.cloud.apihub.v1.ExternalApi value) { + if (externalApiBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + externalApi_ = value; + } else { + externalApiBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The External API resource to update.
+     *
+     * The External API resource's `name` field is used to identify the External
+     * API resource to update. Format:
+     * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+     * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setExternalApi(com.google.cloud.apihub.v1.ExternalApi.Builder builderForValue) { + if (externalApiBuilder_ == null) { + externalApi_ = builderForValue.build(); + } else { + externalApiBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The External API resource to update.
+     *
+     * The External API resource's `name` field is used to identify the External
+     * API resource to update. Format:
+     * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+     * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeExternalApi(com.google.cloud.apihub.v1.ExternalApi value) { + if (externalApiBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && externalApi_ != null + && externalApi_ != com.google.cloud.apihub.v1.ExternalApi.getDefaultInstance()) { + getExternalApiBuilder().mergeFrom(value); + } else { + externalApi_ = value; + } + } else { + externalApiBuilder_.mergeFrom(value); + } + if (externalApi_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The External API resource to update.
+     *
+     * The External API resource's `name` field is used to identify the External
+     * API resource to update. Format:
+     * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+     * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearExternalApi() { + bitField0_ = (bitField0_ & ~0x00000001); + externalApi_ = null; + if (externalApiBuilder_ != null) { + externalApiBuilder_.dispose(); + externalApiBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The External API resource to update.
+     *
+     * The External API resource's `name` field is used to identify the External
+     * API resource to update. Format:
+     * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+     * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.ExternalApi.Builder getExternalApiBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getExternalApiFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The External API resource to update.
+     *
+     * The External API resource's `name` field is used to identify the External
+     * API resource to update. Format:
+     * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+     * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.ExternalApiOrBuilder getExternalApiOrBuilder() { + if (externalApiBuilder_ != null) { + return externalApiBuilder_.getMessageOrBuilder(); + } else { + return externalApi_ == null + ? com.google.cloud.apihub.v1.ExternalApi.getDefaultInstance() + : externalApi_; + } + } + /** + * + * + *
+     * Required. The External API resource to update.
+     *
+     * The External API resource's `name` field is used to identify the External
+     * API resource to update. Format:
+     * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+     * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.ExternalApi, + com.google.cloud.apihub.v1.ExternalApi.Builder, + com.google.cloud.apihub.v1.ExternalApiOrBuilder> + getExternalApiFieldBuilder() { + if (externalApiBuilder_ == null) { + externalApiBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.ExternalApi, + com.google.cloud.apihub.v1.ExternalApi.Builder, + com.google.cloud.apihub.v1.ExternalApiOrBuilder>( + getExternalApi(), getParentForChildren(), isClean()); + externalApi_ = null; + } + return externalApiBuilder_; + } + + 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. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .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. The list of fields to update.
+     * 
+ * + * .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; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .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(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .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. The list of fields to update.
+     * 
+ * + * .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.apihub.v1.UpdateExternalApiRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.UpdateExternalApiRequest) + private static final com.google.cloud.apihub.v1.UpdateExternalApiRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.UpdateExternalApiRequest(); + } + + public static com.google.cloud.apihub.v1.UpdateExternalApiRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateExternalApiRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.UpdateExternalApiRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateExternalApiRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateExternalApiRequestOrBuilder.java new file mode 100644 index 000000000000..0888169b2412 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateExternalApiRequestOrBuilder.java @@ -0,0 +1,117 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface UpdateExternalApiRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.UpdateExternalApiRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The External API resource to update.
+   *
+   * The External API resource's `name` field is used to identify the External
+   * API resource to update. Format:
+   * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+   * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the externalApi field is set. + */ + boolean hasExternalApi(); + /** + * + * + *
+   * Required. The External API resource to update.
+   *
+   * The External API resource's `name` field is used to identify the External
+   * API resource to update. Format:
+   * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+   * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The externalApi. + */ + com.google.cloud.apihub.v1.ExternalApi getExternalApi(); + /** + * + * + *
+   * Required. The External API resource to update.
+   *
+   * The External API resource's `name` field is used to identify the External
+   * API resource to update. Format:
+   * `projects/{project}/locations/{location}/externalApis/{externalApi}`
+   * 
+ * + * + * .google.cloud.apihub.v1.ExternalApi external_api = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.apihub.v1.ExternalApiOrBuilder getExternalApiOrBuilder(); + + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateSpecRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateSpecRequest.java new file mode 100644 index 000000000000..401df05315e0 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateSpecRequest.java @@ -0,0 +1,1036 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [UpdateSpec][google.cloud.apihub.v1.ApiHub.UpdateSpec] method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.UpdateSpecRequest} + */ +public final class UpdateSpecRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.UpdateSpecRequest) + UpdateSpecRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateSpecRequest.newBuilder() to construct. + private UpdateSpecRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateSpecRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateSpecRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateSpecRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateSpecRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.UpdateSpecRequest.class, + com.google.cloud.apihub.v1.UpdateSpecRequest.Builder.class); + } + + private int bitField0_; + public static final int SPEC_FIELD_NUMBER = 1; + private com.google.cloud.apihub.v1.Spec spec_; + /** + * + * + *
+   * Required. The spec to update.
+   *
+   * The spec's `name` field is used to identify the spec to
+   * update. Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * .google.cloud.apihub.v1.Spec spec = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the spec field is set. + */ + @java.lang.Override + public boolean hasSpec() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The spec to update.
+   *
+   * The spec's `name` field is used to identify the spec to
+   * update. Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * .google.cloud.apihub.v1.Spec spec = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The spec. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Spec getSpec() { + return spec_ == null ? com.google.cloud.apihub.v1.Spec.getDefaultInstance() : spec_; + } + /** + * + * + *
+   * Required. The spec to update.
+   *
+   * The spec's `name` field is used to identify the spec to
+   * update. Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * .google.cloud.apihub.v1.Spec spec = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.apihub.v1.SpecOrBuilder getSpecOrBuilder() { + return spec_ == null ? com.google.cloud.apihub.v1.Spec.getDefaultInstance() : spec_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .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 ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .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. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getSpec()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSpec()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += getUnknownFields().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.apihub.v1.UpdateSpecRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.UpdateSpecRequest other = + (com.google.cloud.apihub.v1.UpdateSpecRequest) obj; + + if (hasSpec() != other.hasSpec()) return false; + if (hasSpec()) { + if (!getSpec().equals(other.getSpec())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSpec()) { + hash = (37 * hash) + SPEC_FIELD_NUMBER; + hash = (53 * hash) + getSpec().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.UpdateSpecRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.UpdateSpecRequest 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.apihub.v1.UpdateSpecRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.UpdateSpecRequest 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.apihub.v1.UpdateSpecRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.UpdateSpecRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.UpdateSpecRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.UpdateSpecRequest 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.apihub.v1.UpdateSpecRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.UpdateSpecRequest 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.apihub.v1.UpdateSpecRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.UpdateSpecRequest 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.apihub.v1.UpdateSpecRequest 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 [UpdateSpec][google.cloud.apihub.v1.ApiHub.UpdateSpec] method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.UpdateSpecRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.UpdateSpecRequest) + com.google.cloud.apihub.v1.UpdateSpecRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateSpecRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateSpecRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.UpdateSpecRequest.class, + com.google.cloud.apihub.v1.UpdateSpecRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.UpdateSpecRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSpecFieldBuilder(); + getUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + spec_ = null; + if (specBuilder_ != null) { + specBuilder_.dispose(); + specBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateSpecRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.UpdateSpecRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.UpdateSpecRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.UpdateSpecRequest build() { + com.google.cloud.apihub.v1.UpdateSpecRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.UpdateSpecRequest buildPartial() { + com.google.cloud.apihub.v1.UpdateSpecRequest result = + new com.google.cloud.apihub.v1.UpdateSpecRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.UpdateSpecRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.spec_ = specBuilder_ == null ? spec_ : specBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.UpdateSpecRequest) { + return mergeFrom((com.google.cloud.apihub.v1.UpdateSpecRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.UpdateSpecRequest other) { + if (other == com.google.cloud.apihub.v1.UpdateSpecRequest.getDefaultInstance()) return this; + if (other.hasSpec()) { + mergeSpec(other.getSpec()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getSpecFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.apihub.v1.Spec spec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Spec, + com.google.cloud.apihub.v1.Spec.Builder, + com.google.cloud.apihub.v1.SpecOrBuilder> + specBuilder_; + /** + * + * + *
+     * Required. The spec to update.
+     *
+     * The spec's `name` field is used to identify the spec to
+     * update. Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * .google.cloud.apihub.v1.Spec spec = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the spec field is set. + */ + public boolean hasSpec() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. The spec to update.
+     *
+     * The spec's `name` field is used to identify the spec to
+     * update. Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * .google.cloud.apihub.v1.Spec spec = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The spec. + */ + public com.google.cloud.apihub.v1.Spec getSpec() { + if (specBuilder_ == null) { + return spec_ == null ? com.google.cloud.apihub.v1.Spec.getDefaultInstance() : spec_; + } else { + return specBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The spec to update.
+     *
+     * The spec's `name` field is used to identify the spec to
+     * update. Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * .google.cloud.apihub.v1.Spec spec = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setSpec(com.google.cloud.apihub.v1.Spec value) { + if (specBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + spec_ = value; + } else { + specBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The spec to update.
+     *
+     * The spec's `name` field is used to identify the spec to
+     * update. Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * .google.cloud.apihub.v1.Spec spec = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setSpec(com.google.cloud.apihub.v1.Spec.Builder builderForValue) { + if (specBuilder_ == null) { + spec_ = builderForValue.build(); + } else { + specBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The spec to update.
+     *
+     * The spec's `name` field is used to identify the spec to
+     * update. Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * .google.cloud.apihub.v1.Spec spec = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeSpec(com.google.cloud.apihub.v1.Spec value) { + if (specBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && spec_ != null + && spec_ != com.google.cloud.apihub.v1.Spec.getDefaultInstance()) { + getSpecBuilder().mergeFrom(value); + } else { + spec_ = value; + } + } else { + specBuilder_.mergeFrom(value); + } + if (spec_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The spec to update.
+     *
+     * The spec's `name` field is used to identify the spec to
+     * update. Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * .google.cloud.apihub.v1.Spec spec = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearSpec() { + bitField0_ = (bitField0_ & ~0x00000001); + spec_ = null; + if (specBuilder_ != null) { + specBuilder_.dispose(); + specBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The spec to update.
+     *
+     * The spec's `name` field is used to identify the spec to
+     * update. Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * .google.cloud.apihub.v1.Spec spec = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.apihub.v1.Spec.Builder getSpecBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The spec to update.
+     *
+     * The spec's `name` field is used to identify the spec to
+     * update. Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * .google.cloud.apihub.v1.Spec spec = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.apihub.v1.SpecOrBuilder getSpecOrBuilder() { + if (specBuilder_ != null) { + return specBuilder_.getMessageOrBuilder(); + } else { + return spec_ == null ? com.google.cloud.apihub.v1.Spec.getDefaultInstance() : spec_; + } + } + /** + * + * + *
+     * Required. The spec to update.
+     *
+     * The spec's `name` field is used to identify the spec to
+     * update. Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * .google.cloud.apihub.v1.Spec spec = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Spec, + com.google.cloud.apihub.v1.Spec.Builder, + com.google.cloud.apihub.v1.SpecOrBuilder> + getSpecFieldBuilder() { + if (specBuilder_ == null) { + specBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Spec, + com.google.cloud.apihub.v1.Spec.Builder, + com.google.cloud.apihub.v1.SpecOrBuilder>( + getSpec(), getParentForChildren(), isClean()); + spec_ = null; + } + return specBuilder_; + } + + 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. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .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. The list of fields to update.
+     * 
+ * + * .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; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .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(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .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. The list of fields to update.
+     * 
+ * + * .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.apihub.v1.UpdateSpecRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.UpdateSpecRequest) + private static final com.google.cloud.apihub.v1.UpdateSpecRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.UpdateSpecRequest(); + } + + public static com.google.cloud.apihub.v1.UpdateSpecRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateSpecRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.UpdateSpecRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateSpecRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateSpecRequestOrBuilder.java new file mode 100644 index 000000000000..f5a15f9c0a53 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateSpecRequestOrBuilder.java @@ -0,0 +1,111 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface UpdateSpecRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.UpdateSpecRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The spec to update.
+   *
+   * The spec's `name` field is used to identify the spec to
+   * update. Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * .google.cloud.apihub.v1.Spec spec = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the spec field is set. + */ + boolean hasSpec(); + /** + * + * + *
+   * Required. The spec to update.
+   *
+   * The spec's `name` field is used to identify the spec to
+   * update. Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * .google.cloud.apihub.v1.Spec spec = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The spec. + */ + com.google.cloud.apihub.v1.Spec getSpec(); + /** + * + * + *
+   * Required. The spec to update.
+   *
+   * The spec's `name` field is used to identify the spec to
+   * update. Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * .google.cloud.apihub.v1.Spec spec = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.apihub.v1.SpecOrBuilder getSpecOrBuilder(); + + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateStyleGuideRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateStyleGuideRequest.java new file mode 100644 index 000000000000..4b91974e67cc --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateStyleGuideRequest.java @@ -0,0 +1,1021 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/linting_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [UpdateStyleGuide][ApiHub.UpdateStyleGuide] method's request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.UpdateStyleGuideRequest} + */ +public final class UpdateStyleGuideRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.UpdateStyleGuideRequest) + UpdateStyleGuideRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateStyleGuideRequest.newBuilder() to construct. + private UpdateStyleGuideRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateStyleGuideRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateStyleGuideRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_UpdateStyleGuideRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_UpdateStyleGuideRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.UpdateStyleGuideRequest.class, + com.google.cloud.apihub.v1.UpdateStyleGuideRequest.Builder.class); + } + + private int bitField0_; + public static final int STYLE_GUIDE_FIELD_NUMBER = 1; + private com.google.cloud.apihub.v1.StyleGuide styleGuide_; + /** + * + * + *
+   * Required. The Style guide resource to update.
+   * 
+ * + * + * .google.cloud.apihub.v1.StyleGuide style_guide = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the styleGuide field is set. + */ + @java.lang.Override + public boolean hasStyleGuide() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The Style guide resource to update.
+   * 
+ * + * + * .google.cloud.apihub.v1.StyleGuide style_guide = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The styleGuide. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.StyleGuide getStyleGuide() { + return styleGuide_ == null + ? com.google.cloud.apihub.v1.StyleGuide.getDefaultInstance() + : styleGuide_; + } + /** + * + * + *
+   * Required. The Style guide resource to update.
+   * 
+ * + * + * .google.cloud.apihub.v1.StyleGuide style_guide = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.StyleGuideOrBuilder getStyleGuideOrBuilder() { + return styleGuide_ == null + ? com.google.cloud.apihub.v1.StyleGuide.getDefaultInstance() + : styleGuide_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Optional. The list of fields to update.
+   * 
+ * + * .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 ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Optional. The list of fields to update.
+   * 
+ * + * .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. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getStyleGuide()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getStyleGuide()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += getUnknownFields().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.apihub.v1.UpdateStyleGuideRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.UpdateStyleGuideRequest other = + (com.google.cloud.apihub.v1.UpdateStyleGuideRequest) obj; + + if (hasStyleGuide() != other.hasStyleGuide()) return false; + if (hasStyleGuide()) { + if (!getStyleGuide().equals(other.getStyleGuide())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasStyleGuide()) { + hash = (37 * hash) + STYLE_GUIDE_FIELD_NUMBER; + hash = (53 * hash) + getStyleGuide().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.UpdateStyleGuideRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.UpdateStyleGuideRequest 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.apihub.v1.UpdateStyleGuideRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.UpdateStyleGuideRequest 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.apihub.v1.UpdateStyleGuideRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.UpdateStyleGuideRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.UpdateStyleGuideRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.UpdateStyleGuideRequest 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.apihub.v1.UpdateStyleGuideRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.UpdateStyleGuideRequest 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.apihub.v1.UpdateStyleGuideRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.UpdateStyleGuideRequest 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.apihub.v1.UpdateStyleGuideRequest 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 [UpdateStyleGuide][ApiHub.UpdateStyleGuide] method's request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.UpdateStyleGuideRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.UpdateStyleGuideRequest) + com.google.cloud.apihub.v1.UpdateStyleGuideRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_UpdateStyleGuideRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_UpdateStyleGuideRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.UpdateStyleGuideRequest.class, + com.google.cloud.apihub.v1.UpdateStyleGuideRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.UpdateStyleGuideRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStyleGuideFieldBuilder(); + getUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + styleGuide_ = null; + if (styleGuideBuilder_ != null) { + styleGuideBuilder_.dispose(); + styleGuideBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.LintingServiceProto + .internal_static_google_cloud_apihub_v1_UpdateStyleGuideRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.UpdateStyleGuideRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.UpdateStyleGuideRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.UpdateStyleGuideRequest build() { + com.google.cloud.apihub.v1.UpdateStyleGuideRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.UpdateStyleGuideRequest buildPartial() { + com.google.cloud.apihub.v1.UpdateStyleGuideRequest result = + new com.google.cloud.apihub.v1.UpdateStyleGuideRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.UpdateStyleGuideRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.styleGuide_ = styleGuideBuilder_ == null ? styleGuide_ : styleGuideBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.UpdateStyleGuideRequest) { + return mergeFrom((com.google.cloud.apihub.v1.UpdateStyleGuideRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.UpdateStyleGuideRequest other) { + if (other == com.google.cloud.apihub.v1.UpdateStyleGuideRequest.getDefaultInstance()) + return this; + if (other.hasStyleGuide()) { + mergeStyleGuide(other.getStyleGuide()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getStyleGuideFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.apihub.v1.StyleGuide styleGuide_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.StyleGuide, + com.google.cloud.apihub.v1.StyleGuide.Builder, + com.google.cloud.apihub.v1.StyleGuideOrBuilder> + styleGuideBuilder_; + /** + * + * + *
+     * Required. The Style guide resource to update.
+     * 
+ * + * + * .google.cloud.apihub.v1.StyleGuide style_guide = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the styleGuide field is set. + */ + public boolean hasStyleGuide() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. The Style guide resource to update.
+     * 
+ * + * + * .google.cloud.apihub.v1.StyleGuide style_guide = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The styleGuide. + */ + public com.google.cloud.apihub.v1.StyleGuide getStyleGuide() { + if (styleGuideBuilder_ == null) { + return styleGuide_ == null + ? com.google.cloud.apihub.v1.StyleGuide.getDefaultInstance() + : styleGuide_; + } else { + return styleGuideBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The Style guide resource to update.
+     * 
+ * + * + * .google.cloud.apihub.v1.StyleGuide style_guide = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setStyleGuide(com.google.cloud.apihub.v1.StyleGuide value) { + if (styleGuideBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + styleGuide_ = value; + } else { + styleGuideBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Style guide resource to update.
+     * 
+ * + * + * .google.cloud.apihub.v1.StyleGuide style_guide = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setStyleGuide(com.google.cloud.apihub.v1.StyleGuide.Builder builderForValue) { + if (styleGuideBuilder_ == null) { + styleGuide_ = builderForValue.build(); + } else { + styleGuideBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Style guide resource to update.
+     * 
+ * + * + * .google.cloud.apihub.v1.StyleGuide style_guide = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeStyleGuide(com.google.cloud.apihub.v1.StyleGuide value) { + if (styleGuideBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && styleGuide_ != null + && styleGuide_ != com.google.cloud.apihub.v1.StyleGuide.getDefaultInstance()) { + getStyleGuideBuilder().mergeFrom(value); + } else { + styleGuide_ = value; + } + } else { + styleGuideBuilder_.mergeFrom(value); + } + if (styleGuide_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The Style guide resource to update.
+     * 
+ * + * + * .google.cloud.apihub.v1.StyleGuide style_guide = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearStyleGuide() { + bitField0_ = (bitField0_ & ~0x00000001); + styleGuide_ = null; + if (styleGuideBuilder_ != null) { + styleGuideBuilder_.dispose(); + styleGuideBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Style guide resource to update.
+     * 
+ * + * + * .google.cloud.apihub.v1.StyleGuide style_guide = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.StyleGuide.Builder getStyleGuideBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getStyleGuideFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The Style guide resource to update.
+     * 
+ * + * + * .google.cloud.apihub.v1.StyleGuide style_guide = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.StyleGuideOrBuilder getStyleGuideOrBuilder() { + if (styleGuideBuilder_ != null) { + return styleGuideBuilder_.getMessageOrBuilder(); + } else { + return styleGuide_ == null + ? com.google.cloud.apihub.v1.StyleGuide.getDefaultInstance() + : styleGuide_; + } + } + /** + * + * + *
+     * Required. The Style guide resource to update.
+     * 
+ * + * + * .google.cloud.apihub.v1.StyleGuide style_guide = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.StyleGuide, + com.google.cloud.apihub.v1.StyleGuide.Builder, + com.google.cloud.apihub.v1.StyleGuideOrBuilder> + getStyleGuideFieldBuilder() { + if (styleGuideBuilder_ == null) { + styleGuideBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.StyleGuide, + com.google.cloud.apihub.v1.StyleGuide.Builder, + com.google.cloud.apihub.v1.StyleGuideOrBuilder>( + getStyleGuide(), getParentForChildren(), isClean()); + styleGuide_ = null; + } + return styleGuideBuilder_; + } + + 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. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .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. The list of fields to update.
+     * 
+ * + * .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; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .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(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .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. The list of fields to update.
+     * 
+ * + * .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.apihub.v1.UpdateStyleGuideRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.UpdateStyleGuideRequest) + private static final com.google.cloud.apihub.v1.UpdateStyleGuideRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.UpdateStyleGuideRequest(); + } + + public static com.google.cloud.apihub.v1.UpdateStyleGuideRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateStyleGuideRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.UpdateStyleGuideRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateStyleGuideRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateStyleGuideRequestOrBuilder.java new file mode 100644 index 000000000000..67c7641459d0 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateStyleGuideRequestOrBuilder.java @@ -0,0 +1,105 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/linting_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface UpdateStyleGuideRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.UpdateStyleGuideRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The Style guide resource to update.
+   * 
+ * + * + * .google.cloud.apihub.v1.StyleGuide style_guide = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the styleGuide field is set. + */ + boolean hasStyleGuide(); + /** + * + * + *
+   * Required. The Style guide resource to update.
+   * 
+ * + * + * .google.cloud.apihub.v1.StyleGuide style_guide = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The styleGuide. + */ + com.google.cloud.apihub.v1.StyleGuide getStyleGuide(); + /** + * + * + *
+   * Required. The Style guide resource to update.
+   * 
+ * + * + * .google.cloud.apihub.v1.StyleGuide style_guide = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.apihub.v1.StyleGuideOrBuilder getStyleGuideOrBuilder(); + + /** + * + * + *
+   * Optional. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Optional. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Optional. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateVersionRequest.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateVersionRequest.java new file mode 100644 index 000000000000..433916ced713 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateVersionRequest.java @@ -0,0 +1,1055 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * The [UpdateVersion][google.cloud.apihub.v1.ApiHub.UpdateVersion] method's
+ * request.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.UpdateVersionRequest} + */ +public final class UpdateVersionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.UpdateVersionRequest) + UpdateVersionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateVersionRequest.newBuilder() to construct. + private UpdateVersionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateVersionRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateVersionRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.UpdateVersionRequest.class, + com.google.cloud.apihub.v1.UpdateVersionRequest.Builder.class); + } + + private int bitField0_; + public static final int VERSION_FIELD_NUMBER = 1; + private com.google.cloud.apihub.v1.Version version_; + /** + * + * + *
+   * Required. The API version to update.
+   *
+   * The version's `name` field is used to identify the API version to update.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * .google.cloud.apihub.v1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the version field is set. + */ + @java.lang.Override + public boolean hasVersion() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The API version to update.
+   *
+   * The version's `name` field is used to identify the API version to update.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * .google.cloud.apihub.v1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The version. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Version getVersion() { + return version_ == null ? com.google.cloud.apihub.v1.Version.getDefaultInstance() : version_; + } + /** + * + * + *
+   * Required. The API version to update.
+   *
+   * The version's `name` field is used to identify the API version to update.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * .google.cloud.apihub.v1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.VersionOrBuilder getVersionOrBuilder() { + return version_ == null ? com.google.cloud.apihub.v1.Version.getDefaultInstance() : version_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .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 ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .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. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getVersion()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getVersion()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += getUnknownFields().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.apihub.v1.UpdateVersionRequest)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.UpdateVersionRequest other = + (com.google.cloud.apihub.v1.UpdateVersionRequest) obj; + + if (hasVersion() != other.hasVersion()) return false; + if (hasVersion()) { + if (!getVersion().equals(other.getVersion())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVersion()) { + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.UpdateVersionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.UpdateVersionRequest 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.apihub.v1.UpdateVersionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.UpdateVersionRequest 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.apihub.v1.UpdateVersionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.UpdateVersionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.UpdateVersionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.UpdateVersionRequest 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.apihub.v1.UpdateVersionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.UpdateVersionRequest 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.apihub.v1.UpdateVersionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.UpdateVersionRequest 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.apihub.v1.UpdateVersionRequest 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 [UpdateVersion][google.cloud.apihub.v1.ApiHub.UpdateVersion] method's
+   * request.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.UpdateVersionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.UpdateVersionRequest) + com.google.cloud.apihub.v1.UpdateVersionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.UpdateVersionRequest.class, + com.google.cloud.apihub.v1.UpdateVersionRequest.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.UpdateVersionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getVersionFieldBuilder(); + getUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + version_ = null; + if (versionBuilder_ != null) { + versionBuilder_.dispose(); + versionBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.ApiHubServiceProto + .internal_static_google_cloud_apihub_v1_UpdateVersionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.UpdateVersionRequest getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.UpdateVersionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.UpdateVersionRequest build() { + com.google.cloud.apihub.v1.UpdateVersionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.UpdateVersionRequest buildPartial() { + com.google.cloud.apihub.v1.UpdateVersionRequest result = + new com.google.cloud.apihub.v1.UpdateVersionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.UpdateVersionRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.version_ = versionBuilder_ == null ? version_ : versionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.UpdateVersionRequest) { + return mergeFrom((com.google.cloud.apihub.v1.UpdateVersionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.UpdateVersionRequest other) { + if (other == com.google.cloud.apihub.v1.UpdateVersionRequest.getDefaultInstance()) + return this; + if (other.hasVersion()) { + mergeVersion(other.getVersion()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getVersionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.apihub.v1.Version version_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Version, + com.google.cloud.apihub.v1.Version.Builder, + com.google.cloud.apihub.v1.VersionOrBuilder> + versionBuilder_; + /** + * + * + *
+     * Required. The API version to update.
+     *
+     * The version's `name` field is used to identify the API version to update.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * .google.cloud.apihub.v1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the version field is set. + */ + public boolean hasVersion() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. The API version to update.
+     *
+     * The version's `name` field is used to identify the API version to update.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * .google.cloud.apihub.v1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The version. + */ + public com.google.cloud.apihub.v1.Version getVersion() { + if (versionBuilder_ == null) { + return version_ == null + ? com.google.cloud.apihub.v1.Version.getDefaultInstance() + : version_; + } else { + return versionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The API version to update.
+     *
+     * The version's `name` field is used to identify the API version to update.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * .google.cloud.apihub.v1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setVersion(com.google.cloud.apihub.v1.Version value) { + if (versionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + version_ = value; + } else { + versionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The API version to update.
+     *
+     * The version's `name` field is used to identify the API version to update.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * .google.cloud.apihub.v1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setVersion(com.google.cloud.apihub.v1.Version.Builder builderForValue) { + if (versionBuilder_ == null) { + version_ = builderForValue.build(); + } else { + versionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The API version to update.
+     *
+     * The version's `name` field is used to identify the API version to update.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * .google.cloud.apihub.v1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeVersion(com.google.cloud.apihub.v1.Version value) { + if (versionBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && version_ != null + && version_ != com.google.cloud.apihub.v1.Version.getDefaultInstance()) { + getVersionBuilder().mergeFrom(value); + } else { + version_ = value; + } + } else { + versionBuilder_.mergeFrom(value); + } + if (version_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The API version to update.
+     *
+     * The version's `name` field is used to identify the API version to update.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * .google.cloud.apihub.v1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearVersion() { + bitField0_ = (bitField0_ & ~0x00000001); + version_ = null; + if (versionBuilder_ != null) { + versionBuilder_.dispose(); + versionBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The API version to update.
+     *
+     * The version's `name` field is used to identify the API version to update.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * .google.cloud.apihub.v1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.Version.Builder getVersionBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getVersionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The API version to update.
+     *
+     * The version's `name` field is used to identify the API version to update.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * .google.cloud.apihub.v1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.apihub.v1.VersionOrBuilder getVersionOrBuilder() { + if (versionBuilder_ != null) { + return versionBuilder_.getMessageOrBuilder(); + } else { + return version_ == null + ? com.google.cloud.apihub.v1.Version.getDefaultInstance() + : version_; + } + } + /** + * + * + *
+     * Required. The API version to update.
+     *
+     * The version's `name` field is used to identify the API version to update.
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * .google.cloud.apihub.v1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Version, + com.google.cloud.apihub.v1.Version.Builder, + com.google.cloud.apihub.v1.VersionOrBuilder> + getVersionFieldBuilder() { + if (versionBuilder_ == null) { + versionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Version, + com.google.cloud.apihub.v1.Version.Builder, + com.google.cloud.apihub.v1.VersionOrBuilder>( + getVersion(), getParentForChildren(), isClean()); + version_ = null; + } + return versionBuilder_; + } + + 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. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .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. The list of fields to update.
+     * 
+ * + * .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; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .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(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The list of fields to update.
+     * 
+ * + * .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. The list of fields to update.
+     * 
+ * + * .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.apihub.v1.UpdateVersionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.UpdateVersionRequest) + private static final com.google.cloud.apihub.v1.UpdateVersionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.UpdateVersionRequest(); + } + + public static com.google.cloud.apihub.v1.UpdateVersionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateVersionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.UpdateVersionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateVersionRequestOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateVersionRequestOrBuilder.java new file mode 100644 index 000000000000..ed06f976cb46 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/UpdateVersionRequestOrBuilder.java @@ -0,0 +1,114 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/apihub_service.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface UpdateVersionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.UpdateVersionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The API version to update.
+   *
+   * The version's `name` field is used to identify the API version to update.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * .google.cloud.apihub.v1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the version field is set. + */ + boolean hasVersion(); + /** + * + * + *
+   * Required. The API version to update.
+   *
+   * The version's `name` field is used to identify the API version to update.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * .google.cloud.apihub.v1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The version. + */ + com.google.cloud.apihub.v1.Version getVersion(); + /** + * + * + *
+   * Required. The API version to update.
+   *
+   * The version's `name` field is used to identify the API version to update.
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * .google.cloud.apihub.v1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.apihub.v1.VersionOrBuilder getVersionOrBuilder(); + + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Version.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Version.java new file mode 100644 index 000000000000..794ff1617472 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/Version.java @@ -0,0 +1,5099 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +/** + * + * + *
+ * Represents a version of the API resource in API hub. This is also referred
+ * to as the API version.
+ * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Version} + */ +public final class Version extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apihub.v1.Version) + VersionOrBuilder { + private static final long serialVersionUID = 0L; + // Use Version.newBuilder() to construct. + private Version(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Version() { + name_ = ""; + displayName_ = ""; + description_ = ""; + specs_ = com.google.protobuf.LazyStringArrayList.emptyList(); + apiOperations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + definitions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + deployments_ = com.google.protobuf.LazyStringArrayList.emptyList(); + selectedDeployment_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Version(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Version_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 14: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Version_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Version.class, + com.google.cloud.apihub.v1.Version.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. The name of the version.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+   * Identifier. The name of the version.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * Required. The display name of the version.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+   * Required. The display name of the version.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 DESCRIPTION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * Optional. The description of the version.
+   * 
+ * + * string description = 3 [(.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. The description of the version.
+   * 
+ * + * string description = 3 [(.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 DOCUMENTATION_FIELD_NUMBER = 4; + private com.google.cloud.apihub.v1.Documentation documentation_; + /** + * + * + *
+   * Optional. The documentation of the version.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the documentation field is set. + */ + @java.lang.Override + public boolean hasDocumentation() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Optional. The documentation of the version.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The documentation. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.Documentation getDocumentation() { + return documentation_ == null + ? com.google.cloud.apihub.v1.Documentation.getDefaultInstance() + : documentation_; + } + /** + * + * + *
+   * Optional. The documentation of the version.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.DocumentationOrBuilder getDocumentationOrBuilder() { + return documentation_ == null + ? com.google.cloud.apihub.v1.Documentation.getDefaultInstance() + : documentation_; + } + + public static final int SPECS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList specs_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Output only. The specs associated with this version.
+   * Note that an API version can be associated with multiple specs.
+   * Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * repeated string specs = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the specs. + */ + public com.google.protobuf.ProtocolStringList getSpecsList() { + return specs_; + } + /** + * + * + *
+   * Output only. The specs associated with this version.
+   * Note that an API version can be associated with multiple specs.
+   * Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * repeated string specs = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The count of specs. + */ + public int getSpecsCount() { + return specs_.size(); + } + /** + * + * + *
+   * Output only. The specs associated with this version.
+   * Note that an API version can be associated with multiple specs.
+   * Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * repeated string specs = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The specs at the given index. + */ + public java.lang.String getSpecs(int index) { + return specs_.get(index); + } + /** + * + * + *
+   * Output only. The specs associated with this version.
+   * Note that an API version can be associated with multiple specs.
+   * Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * repeated string specs = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the specs at the given index. + */ + public com.google.protobuf.ByteString getSpecsBytes(int index) { + return specs_.getByteString(index); + } + + public static final int API_OPERATIONS_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList apiOperations_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Output only. The operations contained in the API version.
+   * These operations will be added to the version when a new spec is
+   * added or when an existing spec is updated. Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+   * 
+ * + * + * repeated string api_operations = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the apiOperations. + */ + public com.google.protobuf.ProtocolStringList getApiOperationsList() { + return apiOperations_; + } + /** + * + * + *
+   * Output only. The operations contained in the API version.
+   * These operations will be added to the version when a new spec is
+   * added or when an existing spec is updated. Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+   * 
+ * + * + * repeated string api_operations = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The count of apiOperations. + */ + public int getApiOperationsCount() { + return apiOperations_.size(); + } + /** + * + * + *
+   * Output only. The operations contained in the API version.
+   * These operations will be added to the version when a new spec is
+   * added or when an existing spec is updated. Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+   * 
+ * + * + * repeated string api_operations = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The apiOperations at the given index. + */ + public java.lang.String getApiOperations(int index) { + return apiOperations_.get(index); + } + /** + * + * + *
+   * Output only. The operations contained in the API version.
+   * These operations will be added to the version when a new spec is
+   * added or when an existing spec is updated. Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+   * 
+ * + * + * repeated string api_operations = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the apiOperations at the given index. + */ + public com.google.protobuf.ByteString getApiOperationsBytes(int index) { + return apiOperations_.getByteString(index); + } + + public static final int DEFINITIONS_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList definitions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Output only. The definitions contained in the API version.
+   * These definitions will be added to the version when a new spec is
+   * added or when an existing spec is updated. Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+   * 
+ * + * + * repeated string definitions = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the definitions. + */ + public com.google.protobuf.ProtocolStringList getDefinitionsList() { + return definitions_; + } + /** + * + * + *
+   * Output only. The definitions contained in the API version.
+   * These definitions will be added to the version when a new spec is
+   * added or when an existing spec is updated. Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+   * 
+ * + * + * repeated string definitions = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The count of definitions. + */ + public int getDefinitionsCount() { + return definitions_.size(); + } + /** + * + * + *
+   * Output only. The definitions contained in the API version.
+   * These definitions will be added to the version when a new spec is
+   * added or when an existing spec is updated. Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+   * 
+ * + * + * repeated string definitions = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The definitions at the given index. + */ + public java.lang.String getDefinitions(int index) { + return definitions_.get(index); + } + /** + * + * + *
+   * Output only. The definitions contained in the API version.
+   * These definitions will be added to the version when a new spec is
+   * added or when an existing spec is updated. Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+   * 
+ * + * + * repeated string definitions = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the definitions at the given index. + */ + public com.google.protobuf.ByteString getDefinitionsBytes(int index) { + return definitions_.getByteString(index); + } + + public static final int DEPLOYMENTS_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList deployments_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Optional. The deployments linked to this API version.
+   * Note: A particular API version could be deployed to multiple deployments
+   * (for dev deployment, UAT deployment, etc)
+   * Format is
+   * `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * + * repeated string deployments = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the deployments. + */ + public com.google.protobuf.ProtocolStringList getDeploymentsList() { + return deployments_; + } + /** + * + * + *
+   * Optional. The deployments linked to this API version.
+   * Note: A particular API version could be deployed to multiple deployments
+   * (for dev deployment, UAT deployment, etc)
+   * Format is
+   * `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * + * repeated string deployments = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The count of deployments. + */ + public int getDeploymentsCount() { + return deployments_.size(); + } + /** + * + * + *
+   * Optional. The deployments linked to this API version.
+   * Note: A particular API version could be deployed to multiple deployments
+   * (for dev deployment, UAT deployment, etc)
+   * Format is
+   * `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * + * repeated string deployments = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The deployments at the given index. + */ + public java.lang.String getDeployments(int index) { + return deployments_.get(index); + } + /** + * + * + *
+   * Optional. The deployments linked to this API version.
+   * Note: A particular API version could be deployed to multiple deployments
+   * (for dev deployment, UAT deployment, etc)
+   * Format is
+   * `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * + * repeated string deployments = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the deployments at the given index. + */ + public com.google.protobuf.ByteString getDeploymentsBytes(int index) { + return deployments_.getByteString(index); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 9; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time at which the version was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Output only. The time at which the version was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.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. The time at which the version was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 10; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The time at which the version was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Output only. The time at which the version was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.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 time at which the version was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int LIFECYCLE_FIELD_NUMBER = 11; + private com.google.cloud.apihub.v1.AttributeValues lifecycle_; + /** + * + * + *
+   * Optional. The lifecycle of the API version.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-lifecycle`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues lifecycle = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the lifecycle field is set. + */ + @java.lang.Override + public boolean hasLifecycle() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+   * Optional. The lifecycle of the API version.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-lifecycle`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues lifecycle = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The lifecycle. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getLifecycle() { + return lifecycle_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : lifecycle_; + } + /** + * + * + *
+   * Optional. The lifecycle of the API version.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-lifecycle`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues lifecycle = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValuesOrBuilder getLifecycleOrBuilder() { + return lifecycle_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : lifecycle_; + } + + public static final int COMPLIANCE_FIELD_NUMBER = 12; + private com.google.cloud.apihub.v1.AttributeValues compliance_; + /** + * + * + *
+   * Optional. The compliance associated with the API version.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-compliance`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues compliance = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the compliance field is set. + */ + @java.lang.Override + public boolean hasCompliance() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+   * Optional. The compliance associated with the API version.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-compliance`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues compliance = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The compliance. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getCompliance() { + return compliance_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : compliance_; + } + /** + * + * + *
+   * Optional. The compliance associated with the API version.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-compliance`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues compliance = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValuesOrBuilder getComplianceOrBuilder() { + return compliance_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : compliance_; + } + + public static final int ACCREDITATION_FIELD_NUMBER = 13; + private com.google.cloud.apihub.v1.AttributeValues accreditation_; + /** + * + * + *
+   * Optional. The accreditations associated with the API version.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-accreditation`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues accreditation = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the accreditation field is set. + */ + @java.lang.Override + public boolean hasAccreditation() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+   * Optional. The accreditations associated with the API version.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-accreditation`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues accreditation = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The accreditation. + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getAccreditation() { + return accreditation_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : accreditation_; + } + /** + * + * + *
+   * Optional. The accreditations associated with the API version.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-accreditation`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues accreditation = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValuesOrBuilder getAccreditationOrBuilder() { + return accreditation_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : accreditation_; + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 14; + + private static final class AttributesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.apihub.v1.AttributeValues> + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Version_AttributesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField + attributes_; + + private com.google.protobuf.MapField + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField(AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the Version
+   * resource. The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().getMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the Version
+   * resource. The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the Version
+   * resource. The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.apihub.v1.AttributeValues getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the Version
+   * resource. The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getAttributesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int SELECTED_DEPLOYMENT_FIELD_NUMBER = 16; + + @SuppressWarnings("serial") + private volatile java.lang.Object selectedDeployment_ = ""; + /** + * + * + *
+   * Optional. The selected deployment for a Version resource.
+   * This can be used when special handling is needed on client side for a
+   * particular deployment linked to the version.
+   * Format is
+   * `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * + * string selected_deployment = 16 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The selectedDeployment. + */ + @java.lang.Override + public java.lang.String getSelectedDeployment() { + java.lang.Object ref = selectedDeployment_; + 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(); + selectedDeployment_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The selected deployment for a Version resource.
+   * This can be used when special handling is needed on client side for a
+   * particular deployment linked to the version.
+   * Format is
+   * `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * + * string selected_deployment = 16 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for selectedDeployment. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSelectedDeploymentBytes() { + java.lang.Object ref = selectedDeployment_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selectedDeployment_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getDocumentation()); + } + for (int i = 0; i < specs_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, specs_.getRaw(i)); + } + for (int i = 0; i < apiOperations_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, apiOperations_.getRaw(i)); + } + for (int i = 0; i < definitions_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, definitions_.getRaw(i)); + } + for (int i = 0; i < deployments_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, deployments_.getRaw(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(9, getCreateTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(10, getUpdateTime()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(11, getLifecycle()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(12, getCompliance()); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(13, getAccreditation()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAttributes(), AttributesDefaultEntryHolder.defaultEntry, 14); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selectedDeployment_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 16, selectedDeployment_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getDocumentation()); + } + { + int dataSize = 0; + for (int i = 0; i < specs_.size(); i++) { + dataSize += computeStringSizeNoTag(specs_.getRaw(i)); + } + size += dataSize; + size += 1 * getSpecsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < apiOperations_.size(); i++) { + dataSize += computeStringSizeNoTag(apiOperations_.getRaw(i)); + } + size += dataSize; + size += 1 * getApiOperationsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < definitions_.size(); i++) { + dataSize += computeStringSizeNoTag(definitions_.getRaw(i)); + } + size += dataSize; + size += 1 * getDefinitionsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < deployments_.size(); i++) { + dataSize += computeStringSizeNoTag(deployments_.getRaw(i)); + } + size += dataSize; + size += 1 * getDeploymentsList().size(); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getCreateTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getUpdateTime()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getLifecycle()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getCompliance()); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getAccreditation()); + } + for (java.util.Map.Entry entry : + internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry + attributes__ = + AttributesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, attributes__); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selectedDeployment_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(16, selectedDeployment_); + } + size += getUnknownFields().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.apihub.v1.Version)) { + return super.equals(obj); + } + com.google.cloud.apihub.v1.Version other = (com.google.cloud.apihub.v1.Version) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (hasDocumentation() != other.hasDocumentation()) return false; + if (hasDocumentation()) { + if (!getDocumentation().equals(other.getDocumentation())) return false; + } + if (!getSpecsList().equals(other.getSpecsList())) return false; + if (!getApiOperationsList().equals(other.getApiOperationsList())) return false; + if (!getDefinitionsList().equals(other.getDefinitionsList())) return false; + if (!getDeploymentsList().equals(other.getDeploymentsList())) 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 (hasLifecycle() != other.hasLifecycle()) return false; + if (hasLifecycle()) { + if (!getLifecycle().equals(other.getLifecycle())) return false; + } + if (hasCompliance() != other.hasCompliance()) return false; + if (hasCompliance()) { + if (!getCompliance().equals(other.getCompliance())) return false; + } + if (hasAccreditation() != other.hasAccreditation()) return false; + if (hasAccreditation()) { + if (!getAccreditation().equals(other.getAccreditation())) return false; + } + if (!internalGetAttributes().equals(other.internalGetAttributes())) return false; + if (!getSelectedDeployment().equals(other.getSelectedDeployment())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasDocumentation()) { + hash = (37 * hash) + DOCUMENTATION_FIELD_NUMBER; + hash = (53 * hash) + getDocumentation().hashCode(); + } + if (getSpecsCount() > 0) { + hash = (37 * hash) + SPECS_FIELD_NUMBER; + hash = (53 * hash) + getSpecsList().hashCode(); + } + if (getApiOperationsCount() > 0) { + hash = (37 * hash) + API_OPERATIONS_FIELD_NUMBER; + hash = (53 * hash) + getApiOperationsList().hashCode(); + } + if (getDefinitionsCount() > 0) { + hash = (37 * hash) + DEFINITIONS_FIELD_NUMBER; + hash = (53 * hash) + getDefinitionsList().hashCode(); + } + if (getDeploymentsCount() > 0) { + hash = (37 * hash) + DEPLOYMENTS_FIELD_NUMBER; + hash = (53 * hash) + getDeploymentsList().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 (hasLifecycle()) { + hash = (37 * hash) + LIFECYCLE_FIELD_NUMBER; + hash = (53 * hash) + getLifecycle().hashCode(); + } + if (hasCompliance()) { + hash = (37 * hash) + COMPLIANCE_FIELD_NUMBER; + hash = (53 * hash) + getCompliance().hashCode(); + } + if (hasAccreditation()) { + hash = (37 * hash) + ACCREDITATION_FIELD_NUMBER; + hash = (53 * hash) + getAccreditation().hashCode(); + } + if (!internalGetAttributes().getMap().isEmpty()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttributes().hashCode(); + } + hash = (37 * hash) + SELECTED_DEPLOYMENT_FIELD_NUMBER; + hash = (53 * hash) + getSelectedDeployment().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apihub.v1.Version parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Version 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.apihub.v1.Version parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Version 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.apihub.v1.Version parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apihub.v1.Version parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apihub.v1.Version parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Version 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.apihub.v1.Version parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Version 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.apihub.v1.Version parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apihub.v1.Version 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.apihub.v1.Version 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; + } + /** + * + * + *
+   * Represents a version of the API resource in API hub. This is also referred
+   * to as the API version.
+   * 
+ * + * Protobuf type {@code google.cloud.apihub.v1.Version} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apihub.v1.Version) + com.google.cloud.apihub.v1.VersionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Version_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 14: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 14: + return internalGetMutableAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Version_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apihub.v1.Version.class, + com.google.cloud.apihub.v1.Version.Builder.class); + } + + // Construct using com.google.cloud.apihub.v1.Version.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getDocumentationFieldBuilder(); + getCreateTimeFieldBuilder(); + getUpdateTimeFieldBuilder(); + getLifecycleFieldBuilder(); + getComplianceFieldBuilder(); + getAccreditationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + description_ = ""; + documentation_ = null; + if (documentationBuilder_ != null) { + documentationBuilder_.dispose(); + documentationBuilder_ = null; + } + specs_ = com.google.protobuf.LazyStringArrayList.emptyList(); + apiOperations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + definitions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + deployments_ = com.google.protobuf.LazyStringArrayList.emptyList(); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + lifecycle_ = null; + if (lifecycleBuilder_ != null) { + lifecycleBuilder_.dispose(); + lifecycleBuilder_ = null; + } + compliance_ = null; + if (complianceBuilder_ != null) { + complianceBuilder_.dispose(); + complianceBuilder_ = null; + } + accreditation_ = null; + if (accreditationBuilder_ != null) { + accreditationBuilder_.dispose(); + accreditationBuilder_ = null; + } + internalGetMutableAttributes().clear(); + selectedDeployment_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apihub.v1.CommonFieldsProto + .internal_static_google_cloud_apihub_v1_Version_descriptor; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Version getDefaultInstanceForType() { + return com.google.cloud.apihub.v1.Version.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Version build() { + com.google.cloud.apihub.v1.Version result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apihub.v1.Version buildPartial() { + com.google.cloud.apihub.v1.Version result = new com.google.cloud.apihub.v1.Version(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apihub.v1.Version result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.documentation_ = + documentationBuilder_ == null ? documentation_ : documentationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + specs_.makeImmutable(); + result.specs_ = specs_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + apiOperations_.makeImmutable(); + result.apiOperations_ = apiOperations_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + definitions_.makeImmutable(); + result.definitions_ = definitions_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + deployments_.makeImmutable(); + result.deployments_ = deployments_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.lifecycle_ = lifecycleBuilder_ == null ? lifecycle_ : lifecycleBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.compliance_ = complianceBuilder_ == null ? compliance_ : complianceBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.accreditation_ = + accreditationBuilder_ == null ? accreditation_ : accreditationBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.attributes_ = + internalGetAttributes().build(AttributesDefaultEntryHolder.defaultEntry); + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.selectedDeployment_ = selectedDeployment_; + } + result.bitField0_ |= to_bitField0_; + } + + @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.apihub.v1.Version) { + return mergeFrom((com.google.cloud.apihub.v1.Version) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apihub.v1.Version other) { + if (other == com.google.cloud.apihub.v1.Version.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasDocumentation()) { + mergeDocumentation(other.getDocumentation()); + } + if (!other.specs_.isEmpty()) { + if (specs_.isEmpty()) { + specs_ = other.specs_; + bitField0_ |= 0x00000010; + } else { + ensureSpecsIsMutable(); + specs_.addAll(other.specs_); + } + onChanged(); + } + if (!other.apiOperations_.isEmpty()) { + if (apiOperations_.isEmpty()) { + apiOperations_ = other.apiOperations_; + bitField0_ |= 0x00000020; + } else { + ensureApiOperationsIsMutable(); + apiOperations_.addAll(other.apiOperations_); + } + onChanged(); + } + if (!other.definitions_.isEmpty()) { + if (definitions_.isEmpty()) { + definitions_ = other.definitions_; + bitField0_ |= 0x00000040; + } else { + ensureDefinitionsIsMutable(); + definitions_.addAll(other.definitions_); + } + onChanged(); + } + if (!other.deployments_.isEmpty()) { + if (deployments_.isEmpty()) { + deployments_ = other.deployments_; + bitField0_ |= 0x00000080; + } else { + ensureDeploymentsIsMutable(); + deployments_.addAll(other.deployments_); + } + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasLifecycle()) { + mergeLifecycle(other.getLifecycle()); + } + if (other.hasCompliance()) { + mergeCompliance(other.getCompliance()); + } + if (other.hasAccreditation()) { + mergeAccreditation(other.getAccreditation()); + } + internalGetMutableAttributes().mergeFrom(other.internalGetAttributes()); + bitField0_ |= 0x00002000; + if (!other.getSelectedDeployment().isEmpty()) { + selectedDeployment_ = other.selectedDeployment_; + bitField0_ |= 0x00004000; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getDocumentationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureSpecsIsMutable(); + specs_.add(s); + break; + } // case 42 + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureApiOperationsIsMutable(); + apiOperations_.add(s); + break; + } // case 50 + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDefinitionsIsMutable(); + definitions_.add(s); + break; + } // case 58 + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDeploymentsIsMutable(); + deployments_.add(s); + break; + } // case 66 + case 74: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 82: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 90: + { + input.readMessage(getLifecycleFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 90 + case 98: + { + input.readMessage(getComplianceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 98 + case 106: + { + input.readMessage(getAccreditationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00001000; + break; + } // case 106 + case 114: + { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.apihub.v1.AttributeValues> + attributes__ = + input.readMessage( + AttributesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAttributes() + .ensureBuilderMap() + .put(attributes__.getKey(), attributes__.getValue()); + bitField0_ |= 0x00002000; + break; + } // case 114 + case 130: + { + selectedDeployment_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00004000; + break; + } // case 130 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. The name of the version.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. The name of the version.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. The name of the version.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The name of the version.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The name of the version.
+     *
+     * Format:
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Required. The display name of the version.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. The display name of the version.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. The display name of the version.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The display name of the version.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The display name of the version.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Optional. The description of the version.
+     * 
+ * + * string description = 3 [(.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. The description of the version.
+     * 
+ * + * string description = 3 [(.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. The description of the version.
+     * 
+ * + * string description = 3 [(.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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The description of the version.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The description of the version.
+     * 
+ * + * string description = 3 [(.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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.cloud.apihub.v1.Documentation documentation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Documentation, + com.google.cloud.apihub.v1.Documentation.Builder, + com.google.cloud.apihub.v1.DocumentationOrBuilder> + documentationBuilder_; + /** + * + * + *
+     * Optional. The documentation of the version.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the documentation field is set. + */ + public boolean hasDocumentation() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Optional. The documentation of the version.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The documentation. + */ + public com.google.cloud.apihub.v1.Documentation getDocumentation() { + if (documentationBuilder_ == null) { + return documentation_ == null + ? com.google.cloud.apihub.v1.Documentation.getDefaultInstance() + : documentation_; + } else { + return documentationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The documentation of the version.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDocumentation(com.google.cloud.apihub.v1.Documentation value) { + if (documentationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + documentation_ = value; + } else { + documentationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The documentation of the version.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDocumentation( + com.google.cloud.apihub.v1.Documentation.Builder builderForValue) { + if (documentationBuilder_ == null) { + documentation_ = builderForValue.build(); + } else { + documentationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The documentation of the version.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeDocumentation(com.google.cloud.apihub.v1.Documentation value) { + if (documentationBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && documentation_ != null + && documentation_ != com.google.cloud.apihub.v1.Documentation.getDefaultInstance()) { + getDocumentationBuilder().mergeFrom(value); + } else { + documentation_ = value; + } + } else { + documentationBuilder_.mergeFrom(value); + } + if (documentation_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. The documentation of the version.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearDocumentation() { + bitField0_ = (bitField0_ & ~0x00000008); + documentation_ = null; + if (documentationBuilder_ != null) { + documentationBuilder_.dispose(); + documentationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The documentation of the version.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.Documentation.Builder getDocumentationBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getDocumentationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The documentation of the version.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.DocumentationOrBuilder getDocumentationOrBuilder() { + if (documentationBuilder_ != null) { + return documentationBuilder_.getMessageOrBuilder(); + } else { + return documentation_ == null + ? com.google.cloud.apihub.v1.Documentation.getDefaultInstance() + : documentation_; + } + } + /** + * + * + *
+     * Optional. The documentation of the version.
+     * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Documentation, + com.google.cloud.apihub.v1.Documentation.Builder, + com.google.cloud.apihub.v1.DocumentationOrBuilder> + getDocumentationFieldBuilder() { + if (documentationBuilder_ == null) { + documentationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.Documentation, + com.google.cloud.apihub.v1.Documentation.Builder, + com.google.cloud.apihub.v1.DocumentationOrBuilder>( + getDocumentation(), getParentForChildren(), isClean()); + documentation_ = null; + } + return documentationBuilder_; + } + + private com.google.protobuf.LazyStringArrayList specs_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureSpecsIsMutable() { + if (!specs_.isModifiable()) { + specs_ = new com.google.protobuf.LazyStringArrayList(specs_); + } + bitField0_ |= 0x00000010; + } + /** + * + * + *
+     * Output only. The specs associated with this version.
+     * Note that an API version can be associated with multiple specs.
+     * Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * repeated string specs = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the specs. + */ + public com.google.protobuf.ProtocolStringList getSpecsList() { + specs_.makeImmutable(); + return specs_; + } + /** + * + * + *
+     * Output only. The specs associated with this version.
+     * Note that an API version can be associated with multiple specs.
+     * Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * repeated string specs = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The count of specs. + */ + public int getSpecsCount() { + return specs_.size(); + } + /** + * + * + *
+     * Output only. The specs associated with this version.
+     * Note that an API version can be associated with multiple specs.
+     * Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * repeated string specs = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The specs at the given index. + */ + public java.lang.String getSpecs(int index) { + return specs_.get(index); + } + /** + * + * + *
+     * Output only. The specs associated with this version.
+     * Note that an API version can be associated with multiple specs.
+     * Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * repeated string specs = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the specs at the given index. + */ + public com.google.protobuf.ByteString getSpecsBytes(int index) { + return specs_.getByteString(index); + } + /** + * + * + *
+     * Output only. The specs associated with this version.
+     * Note that an API version can be associated with multiple specs.
+     * Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * repeated string specs = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index to set the value at. + * @param value The specs to set. + * @return This builder for chaining. + */ + public Builder setSpecs(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpecsIsMutable(); + specs_.set(index, value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The specs associated with this version.
+     * Note that an API version can be associated with multiple specs.
+     * Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * repeated string specs = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The specs to add. + * @return This builder for chaining. + */ + public Builder addSpecs(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpecsIsMutable(); + specs_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The specs associated with this version.
+     * Note that an API version can be associated with multiple specs.
+     * Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * repeated string specs = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param values The specs to add. + * @return This builder for chaining. + */ + public Builder addAllSpecs(java.lang.Iterable values) { + ensureSpecsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, specs_); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The specs associated with this version.
+     * Note that an API version can be associated with multiple specs.
+     * Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * repeated string specs = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearSpecs() { + specs_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The specs associated with this version.
+     * Note that an API version can be associated with multiple specs.
+     * Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+     * 
+ * + * + * repeated string specs = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes of the specs to add. + * @return This builder for chaining. + */ + public Builder addSpecsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureSpecsIsMutable(); + specs_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList apiOperations_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureApiOperationsIsMutable() { + if (!apiOperations_.isModifiable()) { + apiOperations_ = new com.google.protobuf.LazyStringArrayList(apiOperations_); + } + bitField0_ |= 0x00000020; + } + /** + * + * + *
+     * Output only. The operations contained in the API version.
+     * These operations will be added to the version when a new spec is
+     * added or when an existing spec is updated. Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+     * 
+ * + * + * repeated string api_operations = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the apiOperations. + */ + public com.google.protobuf.ProtocolStringList getApiOperationsList() { + apiOperations_.makeImmutable(); + return apiOperations_; + } + /** + * + * + *
+     * Output only. The operations contained in the API version.
+     * These operations will be added to the version when a new spec is
+     * added or when an existing spec is updated. Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+     * 
+ * + * + * repeated string api_operations = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The count of apiOperations. + */ + public int getApiOperationsCount() { + return apiOperations_.size(); + } + /** + * + * + *
+     * Output only. The operations contained in the API version.
+     * These operations will be added to the version when a new spec is
+     * added or when an existing spec is updated. Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+     * 
+ * + * + * repeated string api_operations = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The apiOperations at the given index. + */ + public java.lang.String getApiOperations(int index) { + return apiOperations_.get(index); + } + /** + * + * + *
+     * Output only. The operations contained in the API version.
+     * These operations will be added to the version when a new spec is
+     * added or when an existing spec is updated. Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+     * 
+ * + * + * repeated string api_operations = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the apiOperations at the given index. + */ + public com.google.protobuf.ByteString getApiOperationsBytes(int index) { + return apiOperations_.getByteString(index); + } + /** + * + * + *
+     * Output only. The operations contained in the API version.
+     * These operations will be added to the version when a new spec is
+     * added or when an existing spec is updated. Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+     * 
+ * + * + * repeated string api_operations = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index to set the value at. + * @param value The apiOperations to set. + * @return This builder for chaining. + */ + public Builder setApiOperations(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureApiOperationsIsMutable(); + apiOperations_.set(index, value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The operations contained in the API version.
+     * These operations will be added to the version when a new spec is
+     * added or when an existing spec is updated. Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+     * 
+ * + * + * repeated string api_operations = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The apiOperations to add. + * @return This builder for chaining. + */ + public Builder addApiOperations(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureApiOperationsIsMutable(); + apiOperations_.add(value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The operations contained in the API version.
+     * These operations will be added to the version when a new spec is
+     * added or when an existing spec is updated. Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+     * 
+ * + * + * repeated string api_operations = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param values The apiOperations to add. + * @return This builder for chaining. + */ + public Builder addAllApiOperations(java.lang.Iterable values) { + ensureApiOperationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, apiOperations_); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The operations contained in the API version.
+     * These operations will be added to the version when a new spec is
+     * added or when an existing spec is updated. Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+     * 
+ * + * + * repeated string api_operations = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearApiOperations() { + apiOperations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The operations contained in the API version.
+     * These operations will be added to the version when a new spec is
+     * added or when an existing spec is updated. Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+     * 
+ * + * + * repeated string api_operations = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes of the apiOperations to add. + * @return This builder for chaining. + */ + public Builder addApiOperationsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureApiOperationsIsMutable(); + apiOperations_.add(value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList definitions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureDefinitionsIsMutable() { + if (!definitions_.isModifiable()) { + definitions_ = new com.google.protobuf.LazyStringArrayList(definitions_); + } + bitField0_ |= 0x00000040; + } + /** + * + * + *
+     * Output only. The definitions contained in the API version.
+     * These definitions will be added to the version when a new spec is
+     * added or when an existing spec is updated. Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+     * 
+ * + * + * repeated string definitions = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the definitions. + */ + public com.google.protobuf.ProtocolStringList getDefinitionsList() { + definitions_.makeImmutable(); + return definitions_; + } + /** + * + * + *
+     * Output only. The definitions contained in the API version.
+     * These definitions will be added to the version when a new spec is
+     * added or when an existing spec is updated. Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+     * 
+ * + * + * repeated string definitions = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The count of definitions. + */ + public int getDefinitionsCount() { + return definitions_.size(); + } + /** + * + * + *
+     * Output only. The definitions contained in the API version.
+     * These definitions will be added to the version when a new spec is
+     * added or when an existing spec is updated. Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+     * 
+ * + * + * repeated string definitions = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The definitions at the given index. + */ + public java.lang.String getDefinitions(int index) { + return definitions_.get(index); + } + /** + * + * + *
+     * Output only. The definitions contained in the API version.
+     * These definitions will be added to the version when a new spec is
+     * added or when an existing spec is updated. Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+     * 
+ * + * + * repeated string definitions = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the definitions at the given index. + */ + public com.google.protobuf.ByteString getDefinitionsBytes(int index) { + return definitions_.getByteString(index); + } + /** + * + * + *
+     * Output only. The definitions contained in the API version.
+     * These definitions will be added to the version when a new spec is
+     * added or when an existing spec is updated. Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+     * 
+ * + * + * repeated string definitions = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index to set the value at. + * @param value The definitions to set. + * @return This builder for chaining. + */ + public Builder setDefinitions(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDefinitionsIsMutable(); + definitions_.set(index, value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The definitions contained in the API version.
+     * These definitions will be added to the version when a new spec is
+     * added or when an existing spec is updated. Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+     * 
+ * + * + * repeated string definitions = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The definitions to add. + * @return This builder for chaining. + */ + public Builder addDefinitions(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDefinitionsIsMutable(); + definitions_.add(value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The definitions contained in the API version.
+     * These definitions will be added to the version when a new spec is
+     * added or when an existing spec is updated. Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+     * 
+ * + * + * repeated string definitions = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param values The definitions to add. + * @return This builder for chaining. + */ + public Builder addAllDefinitions(java.lang.Iterable values) { + ensureDefinitionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, definitions_); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The definitions contained in the API version.
+     * These definitions will be added to the version when a new spec is
+     * added or when an existing spec is updated. Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+     * 
+ * + * + * repeated string definitions = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearDefinitions() { + definitions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The definitions contained in the API version.
+     * These definitions will be added to the version when a new spec is
+     * added or when an existing spec is updated. Format is
+     * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+     * 
+ * + * + * repeated string definitions = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes of the definitions to add. + * @return This builder for chaining. + */ + public Builder addDefinitionsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDefinitionsIsMutable(); + definitions_.add(value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList deployments_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureDeploymentsIsMutable() { + if (!deployments_.isModifiable()) { + deployments_ = new com.google.protobuf.LazyStringArrayList(deployments_); + } + bitField0_ |= 0x00000080; + } + /** + * + * + *
+     * Optional. The deployments linked to this API version.
+     * Note: A particular API version could be deployed to multiple deployments
+     * (for dev deployment, UAT deployment, etc)
+     * Format is
+     * `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * repeated string deployments = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the deployments. + */ + public com.google.protobuf.ProtocolStringList getDeploymentsList() { + deployments_.makeImmutable(); + return deployments_; + } + /** + * + * + *
+     * Optional. The deployments linked to this API version.
+     * Note: A particular API version could be deployed to multiple deployments
+     * (for dev deployment, UAT deployment, etc)
+     * Format is
+     * `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * repeated string deployments = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The count of deployments. + */ + public int getDeploymentsCount() { + return deployments_.size(); + } + /** + * + * + *
+     * Optional. The deployments linked to this API version.
+     * Note: A particular API version could be deployed to multiple deployments
+     * (for dev deployment, UAT deployment, etc)
+     * Format is
+     * `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * repeated string deployments = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The deployments at the given index. + */ + public java.lang.String getDeployments(int index) { + return deployments_.get(index); + } + /** + * + * + *
+     * Optional. The deployments linked to this API version.
+     * Note: A particular API version could be deployed to multiple deployments
+     * (for dev deployment, UAT deployment, etc)
+     * Format is
+     * `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * repeated string deployments = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the deployments at the given index. + */ + public com.google.protobuf.ByteString getDeploymentsBytes(int index) { + return deployments_.getByteString(index); + } + /** + * + * + *
+     * Optional. The deployments linked to this API version.
+     * Note: A particular API version could be deployed to multiple deployments
+     * (for dev deployment, UAT deployment, etc)
+     * Format is
+     * `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * repeated string deployments = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param index The index to set the value at. + * @param value The deployments to set. + * @return This builder for chaining. + */ + public Builder setDeployments(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeploymentsIsMutable(); + deployments_.set(index, value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The deployments linked to this API version.
+     * Note: A particular API version could be deployed to multiple deployments
+     * (for dev deployment, UAT deployment, etc)
+     * Format is
+     * `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * repeated string deployments = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The deployments to add. + * @return This builder for chaining. + */ + public Builder addDeployments(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeploymentsIsMutable(); + deployments_.add(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The deployments linked to this API version.
+     * Note: A particular API version could be deployed to multiple deployments
+     * (for dev deployment, UAT deployment, etc)
+     * Format is
+     * `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * repeated string deployments = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param values The deployments to add. + * @return This builder for chaining. + */ + public Builder addAllDeployments(java.lang.Iterable values) { + ensureDeploymentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, deployments_); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The deployments linked to this API version.
+     * Note: A particular API version could be deployed to multiple deployments
+     * (for dev deployment, UAT deployment, etc)
+     * Format is
+     * `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * repeated string deployments = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearDeployments() { + deployments_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The deployments linked to this API version.
+     * Note: A particular API version could be deployed to multiple deployments
+     * (for dev deployment, UAT deployment, etc)
+     * Format is
+     * `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * repeated string deployments = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes of the deployments to add. + * @return This builder for chaining. + */ + public Builder addDeploymentsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDeploymentsIsMutable(); + deployments_.add(value); + bitField0_ |= 0x00000080; + 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. The time at which the version was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * + * + *
+     * Output only. The time at which the version was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.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. The time at which the version was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the version was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the version was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The time at which the version was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000100); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the version was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time at which the version was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.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. The time at which the version was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.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 time at which the version was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * + * + *
+     * Output only. The time at which the version was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.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 time at which the version was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the version was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the version was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The time at which the version was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000200); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which the version was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time at which the version was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.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 time at which the version was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.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.cloud.apihub.v1.AttributeValues lifecycle_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder> + lifecycleBuilder_; + /** + * + * + *
+     * Optional. The lifecycle of the API version.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-lifecycle`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues lifecycle = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the lifecycle field is set. + */ + public boolean hasLifecycle() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + * + * + *
+     * Optional. The lifecycle of the API version.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-lifecycle`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues lifecycle = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The lifecycle. + */ + public com.google.cloud.apihub.v1.AttributeValues getLifecycle() { + if (lifecycleBuilder_ == null) { + return lifecycle_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : lifecycle_; + } else { + return lifecycleBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The lifecycle of the API version.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-lifecycle`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues lifecycle = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setLifecycle(com.google.cloud.apihub.v1.AttributeValues value) { + if (lifecycleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + lifecycle_ = value; + } else { + lifecycleBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The lifecycle of the API version.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-lifecycle`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues lifecycle = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setLifecycle( + com.google.cloud.apihub.v1.AttributeValues.Builder builderForValue) { + if (lifecycleBuilder_ == null) { + lifecycle_ = builderForValue.build(); + } else { + lifecycleBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The lifecycle of the API version.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-lifecycle`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues lifecycle = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeLifecycle(com.google.cloud.apihub.v1.AttributeValues value) { + if (lifecycleBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) + && lifecycle_ != null + && lifecycle_ != com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance()) { + getLifecycleBuilder().mergeFrom(value); + } else { + lifecycle_ = value; + } + } else { + lifecycleBuilder_.mergeFrom(value); + } + if (lifecycle_ != null) { + bitField0_ |= 0x00000400; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. The lifecycle of the API version.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-lifecycle`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues lifecycle = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearLifecycle() { + bitField0_ = (bitField0_ & ~0x00000400); + lifecycle_ = null; + if (lifecycleBuilder_ != null) { + lifecycleBuilder_.dispose(); + lifecycleBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The lifecycle of the API version.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-lifecycle`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues lifecycle = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.AttributeValues.Builder getLifecycleBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return getLifecycleFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The lifecycle of the API version.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-lifecycle`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues lifecycle = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.AttributeValuesOrBuilder getLifecycleOrBuilder() { + if (lifecycleBuilder_ != null) { + return lifecycleBuilder_.getMessageOrBuilder(); + } else { + return lifecycle_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : lifecycle_; + } + } + /** + * + * + *
+     * Optional. The lifecycle of the API version.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-lifecycle`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues lifecycle = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder> + getLifecycleFieldBuilder() { + if (lifecycleBuilder_ == null) { + lifecycleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder>( + getLifecycle(), getParentForChildren(), isClean()); + lifecycle_ = null; + } + return lifecycleBuilder_; + } + + private com.google.cloud.apihub.v1.AttributeValues compliance_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder> + complianceBuilder_; + /** + * + * + *
+     * Optional. The compliance associated with the API version.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-compliance`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues compliance = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the compliance field is set. + */ + public boolean hasCompliance() { + return ((bitField0_ & 0x00000800) != 0); + } + /** + * + * + *
+     * Optional. The compliance associated with the API version.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-compliance`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues compliance = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The compliance. + */ + public com.google.cloud.apihub.v1.AttributeValues getCompliance() { + if (complianceBuilder_ == null) { + return compliance_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : compliance_; + } else { + return complianceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The compliance associated with the API version.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-compliance`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues compliance = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setCompliance(com.google.cloud.apihub.v1.AttributeValues value) { + if (complianceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + compliance_ = value; + } else { + complianceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The compliance associated with the API version.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-compliance`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues compliance = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setCompliance( + com.google.cloud.apihub.v1.AttributeValues.Builder builderForValue) { + if (complianceBuilder_ == null) { + compliance_ = builderForValue.build(); + } else { + complianceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The compliance associated with the API version.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-compliance`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues compliance = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeCompliance(com.google.cloud.apihub.v1.AttributeValues value) { + if (complianceBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) + && compliance_ != null + && compliance_ != com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance()) { + getComplianceBuilder().mergeFrom(value); + } else { + compliance_ = value; + } + } else { + complianceBuilder_.mergeFrom(value); + } + if (compliance_ != null) { + bitField0_ |= 0x00000800; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. The compliance associated with the API version.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-compliance`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues compliance = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearCompliance() { + bitField0_ = (bitField0_ & ~0x00000800); + compliance_ = null; + if (complianceBuilder_ != null) { + complianceBuilder_.dispose(); + complianceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The compliance associated with the API version.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-compliance`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues compliance = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.AttributeValues.Builder getComplianceBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return getComplianceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The compliance associated with the API version.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-compliance`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues compliance = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.AttributeValuesOrBuilder getComplianceOrBuilder() { + if (complianceBuilder_ != null) { + return complianceBuilder_.getMessageOrBuilder(); + } else { + return compliance_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : compliance_; + } + } + /** + * + * + *
+     * Optional. The compliance associated with the API version.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-compliance`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues compliance = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder> + getComplianceFieldBuilder() { + if (complianceBuilder_ == null) { + complianceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder>( + getCompliance(), getParentForChildren(), isClean()); + compliance_ = null; + } + return complianceBuilder_; + } + + private com.google.cloud.apihub.v1.AttributeValues accreditation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder> + accreditationBuilder_; + /** + * + * + *
+     * Optional. The accreditations associated with the API version.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-accreditation`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues accreditation = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the accreditation field is set. + */ + public boolean hasAccreditation() { + return ((bitField0_ & 0x00001000) != 0); + } + /** + * + * + *
+     * Optional. The accreditations associated with the API version.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-accreditation`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues accreditation = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The accreditation. + */ + public com.google.cloud.apihub.v1.AttributeValues getAccreditation() { + if (accreditationBuilder_ == null) { + return accreditation_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : accreditation_; + } else { + return accreditationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The accreditations associated with the API version.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-accreditation`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues accreditation = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setAccreditation(com.google.cloud.apihub.v1.AttributeValues value) { + if (accreditationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + accreditation_ = value; + } else { + accreditationBuilder_.setMessage(value); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The accreditations associated with the API version.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-accreditation`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues accreditation = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setAccreditation( + com.google.cloud.apihub.v1.AttributeValues.Builder builderForValue) { + if (accreditationBuilder_ == null) { + accreditation_ = builderForValue.build(); + } else { + accreditationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The accreditations associated with the API version.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-accreditation`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues accreditation = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeAccreditation(com.google.cloud.apihub.v1.AttributeValues value) { + if (accreditationBuilder_ == null) { + if (((bitField0_ & 0x00001000) != 0) + && accreditation_ != null + && accreditation_ != com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance()) { + getAccreditationBuilder().mergeFrom(value); + } else { + accreditation_ = value; + } + } else { + accreditationBuilder_.mergeFrom(value); + } + if (accreditation_ != null) { + bitField0_ |= 0x00001000; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. The accreditations associated with the API version.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-accreditation`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues accreditation = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearAccreditation() { + bitField0_ = (bitField0_ & ~0x00001000); + accreditation_ = null; + if (accreditationBuilder_ != null) { + accreditationBuilder_.dispose(); + accreditationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The accreditations associated with the API version.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-accreditation`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues accreditation = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.AttributeValues.Builder getAccreditationBuilder() { + bitField0_ |= 0x00001000; + onChanged(); + return getAccreditationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The accreditations associated with the API version.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-accreditation`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues accreditation = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.AttributeValuesOrBuilder getAccreditationOrBuilder() { + if (accreditationBuilder_ != null) { + return accreditationBuilder_.getMessageOrBuilder(); + } else { + return accreditation_ == null + ? com.google.cloud.apihub.v1.AttributeValues.getDefaultInstance() + : accreditation_; + } + } + /** + * + * + *
+     * Optional. The accreditations associated with the API version.
+     * This maps to the following system defined attribute:
+     * `projects/{project}/locations/{location}/attributes/system-accreditation`
+     * attribute.
+     * The number of values for this attribute will be based on the
+     * cardinality of the attribute. The same can be retrieved via GetAttribute
+     * API. All values should be from the list of allowed values defined for the
+     * attribute.
+     * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues accreditation = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder> + getAccreditationFieldBuilder() { + if (accreditationBuilder_ == null) { + accreditationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder>( + getAccreditation(), getParentForChildren(), isClean()); + accreditation_ = null; + } + return accreditationBuilder_; + } + + private static final class AttributesConverter + implements com.google.protobuf.MapFieldBuilder.Converter< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues> { + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues build( + com.google.cloud.apihub.v1.AttributeValuesOrBuilder val) { + if (val instanceof com.google.cloud.apihub.v1.AttributeValues) { + return (com.google.cloud.apihub.v1.AttributeValues) val; + } + return ((com.google.cloud.apihub.v1.AttributeValues.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.apihub.v1.AttributeValues> + defaultEntry() { + return AttributesDefaultEntryHolder.defaultEntry; + } + }; + + private static final AttributesConverter attributesConverter = new AttributesConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder> + attributes_; + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder> + internalGetAttributes() { + if (attributes_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(attributesConverter); + } + return attributes_; + } + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.cloud.apihub.v1.AttributeValuesOrBuilder, + com.google.cloud.apihub.v1.AttributeValues, + com.google.cloud.apihub.v1.AttributeValues.Builder> + internalGetMutableAttributes() { + if (attributes_ == null) { + attributes_ = new com.google.protobuf.MapFieldBuilder<>(attributesConverter); + } + bitField0_ |= 0x00002000; + onChanged(); + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().ensureBuilderMap().size(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the Version
+     * resource. The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().ensureBuilderMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the Version
+     * resource. The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getImmutableMap(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the Version
+     * resource. The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.apihub.v1.AttributeValues getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableAttributes().ensureBuilderMap(); + return map.containsKey(key) ? attributesConverter.build(map.get(key)) : defaultValue; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the Version
+     * resource. The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.apihub.v1.AttributeValues getAttributesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableAttributes().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return attributesConverter.build(map.get(key)); + } + + public Builder clearAttributes() { + bitField0_ = (bitField0_ & ~0x00002000); + internalGetMutableAttributes().clear(); + return this; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the Version
+     * resource. The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAttributes().ensureBuilderMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableAttributes() { + bitField0_ |= 0x00002000; + return internalGetMutableAttributes().ensureMessageMap(); + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the Version
+     * resource. The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAttributes( + java.lang.String key, com.google.cloud.apihub.v1.AttributeValues value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAttributes().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00002000; + return this; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the Version
+     * resource. The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllAttributes( + java.util.Map values) { + for (java.util.Map.Entry e : + values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableAttributes().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00002000; + return this; + } + /** + * + * + *
+     * Optional. The list of user defined attributes associated with the Version
+     * resource. The key is the attribute name. It will be of the format:
+     * `projects/{project}/locations/{location}/attributes/{attribute}`.
+     * The value is the attribute values associated with the resource.
+     * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.apihub.v1.AttributeValues.Builder putAttributesBuilderIfAbsent( + java.lang.String key) { + java.util.Map + builderMap = internalGetMutableAttributes().ensureBuilderMap(); + com.google.cloud.apihub.v1.AttributeValuesOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = com.google.cloud.apihub.v1.AttributeValues.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.cloud.apihub.v1.AttributeValues) { + entry = ((com.google.cloud.apihub.v1.AttributeValues) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.cloud.apihub.v1.AttributeValues.Builder) entry; + } + + private java.lang.Object selectedDeployment_ = ""; + /** + * + * + *
+     * Optional. The selected deployment for a Version resource.
+     * This can be used when special handling is needed on client side for a
+     * particular deployment linked to the version.
+     * Format is
+     * `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * string selected_deployment = 16 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The selectedDeployment. + */ + public java.lang.String getSelectedDeployment() { + java.lang.Object ref = selectedDeployment_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selectedDeployment_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The selected deployment for a Version resource.
+     * This can be used when special handling is needed on client side for a
+     * particular deployment linked to the version.
+     * Format is
+     * `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * string selected_deployment = 16 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for selectedDeployment. + */ + public com.google.protobuf.ByteString getSelectedDeploymentBytes() { + java.lang.Object ref = selectedDeployment_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selectedDeployment_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The selected deployment for a Version resource.
+     * This can be used when special handling is needed on client side for a
+     * particular deployment linked to the version.
+     * Format is
+     * `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * string selected_deployment = 16 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The selectedDeployment to set. + * @return This builder for chaining. + */ + public Builder setSelectedDeployment(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + selectedDeployment_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The selected deployment for a Version resource.
+     * This can be used when special handling is needed on client side for a
+     * particular deployment linked to the version.
+     * Format is
+     * `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * string selected_deployment = 16 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearSelectedDeployment() { + selectedDeployment_ = getDefaultInstance().getSelectedDeployment(); + bitField0_ = (bitField0_ & ~0x00004000); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The selected deployment for a Version resource.
+     * This can be used when special handling is needed on client side for a
+     * particular deployment linked to the version.
+     * Format is
+     * `projects/{project}/locations/{location}/deployments/{deployment}`
+     * 
+ * + * + * string selected_deployment = 16 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for selectedDeployment to set. + * @return This builder for chaining. + */ + public Builder setSelectedDeploymentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + selectedDeployment_ = value; + bitField0_ |= 0x00004000; + 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.apihub.v1.Version) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apihub.v1.Version) + private static final com.google.cloud.apihub.v1.Version DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apihub.v1.Version(); + } + + public static com.google.cloud.apihub.v1.Version getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Version parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.apihub.v1.Version getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/VersionName.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/VersionName.java new file mode 100644 index 000000000000..dbe88eb906c9 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/VersionName.java @@ -0,0 +1,257 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1; + +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 VersionName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_API_VERSION = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/apis/{api}/versions/{version}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String api; + private final String version; + + @Deprecated + protected VersionName() { + project = null; + location = null; + api = null; + version = null; + } + + private VersionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + api = Preconditions.checkNotNull(builder.getApi()); + version = Preconditions.checkNotNull(builder.getVersion()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getApi() { + return api; + } + + public String getVersion() { + return version; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static VersionName of(String project, String location, String api, String version) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setApi(api) + .setVersion(version) + .build(); + } + + public static String format(String project, String location, String api, String version) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setApi(api) + .setVersion(version) + .build() + .toString(); + } + + public static VersionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_API_VERSION.validatedMatch( + formattedString, "VersionName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("api"), + matchMap.get("version")); + } + + 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 (VersionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_API_VERSION.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); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (api != null) { + fieldMapBuilder.put("api", api); + } + if (version != null) { + fieldMapBuilder.put("version", version); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_API_VERSION.instantiate( + "project", project, "location", location, "api", api, "version", version); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + VersionName that = ((VersionName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.api, that.api) + && Objects.equals(this.version, that.version); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(api); + h *= 1000003; + h ^= Objects.hashCode(version); + return h; + } + + /** Builder for projects/{project}/locations/{location}/apis/{api}/versions/{version}. */ + public static class Builder { + private String project; + private String location; + private String api; + private String version; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getApi() { + return api; + } + + public String getVersion() { + return version; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setApi(String api) { + this.api = api; + return this; + } + + public Builder setVersion(String version) { + this.version = version; + return this; + } + + private Builder(VersionName versionName) { + this.project = versionName.project; + this.location = versionName.location; + this.api = versionName.api; + this.version = versionName.version; + } + + public VersionName build() { + return new VersionName(this); + } + } +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/VersionOrBuilder.java b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/VersionOrBuilder.java new file mode 100644 index 000000000000..edb83408db24 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/java/com/google/cloud/apihub/v1/VersionOrBuilder.java @@ -0,0 +1,818 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/apihub/v1/common_fields.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.apihub.v1; + +public interface VersionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apihub.v1.Version) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. The name of the version.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. The name of the version.
+   *
+   * Format:
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The display name of the version.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. The display name of the version.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Optional. The description of the version.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Optional. The description of the version.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Optional. The documentation of the version.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the documentation field is set. + */ + boolean hasDocumentation(); + /** + * + * + *
+   * Optional. The documentation of the version.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The documentation. + */ + com.google.cloud.apihub.v1.Documentation getDocumentation(); + /** + * + * + *
+   * Optional. The documentation of the version.
+   * 
+ * + * + * .google.cloud.apihub.v1.Documentation documentation = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.DocumentationOrBuilder getDocumentationOrBuilder(); + + /** + * + * + *
+   * Output only. The specs associated with this version.
+   * Note that an API version can be associated with multiple specs.
+   * Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * repeated string specs = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the specs. + */ + java.util.List getSpecsList(); + /** + * + * + *
+   * Output only. The specs associated with this version.
+   * Note that an API version can be associated with multiple specs.
+   * Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * repeated string specs = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The count of specs. + */ + int getSpecsCount(); + /** + * + * + *
+   * Output only. The specs associated with this version.
+   * Note that an API version can be associated with multiple specs.
+   * Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * repeated string specs = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The specs at the given index. + */ + java.lang.String getSpecs(int index); + /** + * + * + *
+   * Output only. The specs associated with this version.
+   * Note that an API version can be associated with multiple specs.
+   * Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
+   * 
+ * + * + * repeated string specs = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the specs at the given index. + */ + com.google.protobuf.ByteString getSpecsBytes(int index); + + /** + * + * + *
+   * Output only. The operations contained in the API version.
+   * These operations will be added to the version when a new spec is
+   * added or when an existing spec is updated. Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+   * 
+ * + * + * repeated string api_operations = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the apiOperations. + */ + java.util.List getApiOperationsList(); + /** + * + * + *
+   * Output only. The operations contained in the API version.
+   * These operations will be added to the version when a new spec is
+   * added or when an existing spec is updated. Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+   * 
+ * + * + * repeated string api_operations = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The count of apiOperations. + */ + int getApiOperationsCount(); + /** + * + * + *
+   * Output only. The operations contained in the API version.
+   * These operations will be added to the version when a new spec is
+   * added or when an existing spec is updated. Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+   * 
+ * + * + * repeated string api_operations = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The apiOperations at the given index. + */ + java.lang.String getApiOperations(int index); + /** + * + * + *
+   * Output only. The operations contained in the API version.
+   * These operations will be added to the version when a new spec is
+   * added or when an existing spec is updated. Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
+   * 
+ * + * + * repeated string api_operations = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the apiOperations at the given index. + */ + com.google.protobuf.ByteString getApiOperationsBytes(int index); + + /** + * + * + *
+   * Output only. The definitions contained in the API version.
+   * These definitions will be added to the version when a new spec is
+   * added or when an existing spec is updated. Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+   * 
+ * + * + * repeated string definitions = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the definitions. + */ + java.util.List getDefinitionsList(); + /** + * + * + *
+   * Output only. The definitions contained in the API version.
+   * These definitions will be added to the version when a new spec is
+   * added or when an existing spec is updated. Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+   * 
+ * + * + * repeated string definitions = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The count of definitions. + */ + int getDefinitionsCount(); + /** + * + * + *
+   * Output only. The definitions contained in the API version.
+   * These definitions will be added to the version when a new spec is
+   * added or when an existing spec is updated. Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+   * 
+ * + * + * repeated string definitions = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The definitions at the given index. + */ + java.lang.String getDefinitions(int index); + /** + * + * + *
+   * Output only. The definitions contained in the API version.
+   * These definitions will be added to the version when a new spec is
+   * added or when an existing spec is updated. Format is
+   * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
+   * 
+ * + * + * repeated string definitions = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the definitions at the given index. + */ + com.google.protobuf.ByteString getDefinitionsBytes(int index); + + /** + * + * + *
+   * Optional. The deployments linked to this API version.
+   * Note: A particular API version could be deployed to multiple deployments
+   * (for dev deployment, UAT deployment, etc)
+   * Format is
+   * `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * + * repeated string deployments = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the deployments. + */ + java.util.List getDeploymentsList(); + /** + * + * + *
+   * Optional. The deployments linked to this API version.
+   * Note: A particular API version could be deployed to multiple deployments
+   * (for dev deployment, UAT deployment, etc)
+   * Format is
+   * `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * + * repeated string deployments = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The count of deployments. + */ + int getDeploymentsCount(); + /** + * + * + *
+   * Optional. The deployments linked to this API version.
+   * Note: A particular API version could be deployed to multiple deployments
+   * (for dev deployment, UAT deployment, etc)
+   * Format is
+   * `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * + * repeated string deployments = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The deployments at the given index. + */ + java.lang.String getDeployments(int index); + /** + * + * + *
+   * Optional. The deployments linked to this API version.
+   * Note: A particular API version could be deployed to multiple deployments
+   * (for dev deployment, UAT deployment, etc)
+   * Format is
+   * `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * + * repeated string deployments = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the deployments at the given index. + */ + com.google.protobuf.ByteString getDeploymentsBytes(int index); + + /** + * + * + *
+   * Output only. The time at which the version was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time at which the version was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time at which the version was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time at which the version was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The time at which the version was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The time at which the version was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Optional. The lifecycle of the API version.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-lifecycle`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues lifecycle = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the lifecycle field is set. + */ + boolean hasLifecycle(); + /** + * + * + *
+   * Optional. The lifecycle of the API version.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-lifecycle`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues lifecycle = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The lifecycle. + */ + com.google.cloud.apihub.v1.AttributeValues getLifecycle(); + /** + * + * + *
+   * Optional. The lifecycle of the API version.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-lifecycle`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues lifecycle = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.AttributeValuesOrBuilder getLifecycleOrBuilder(); + + /** + * + * + *
+   * Optional. The compliance associated with the API version.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-compliance`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues compliance = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the compliance field is set. + */ + boolean hasCompliance(); + /** + * + * + *
+   * Optional. The compliance associated with the API version.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-compliance`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues compliance = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The compliance. + */ + com.google.cloud.apihub.v1.AttributeValues getCompliance(); + /** + * + * + *
+   * Optional. The compliance associated with the API version.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-compliance`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues compliance = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.AttributeValuesOrBuilder getComplianceOrBuilder(); + + /** + * + * + *
+   * Optional. The accreditations associated with the API version.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-accreditation`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues accreditation = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the accreditation field is set. + */ + boolean hasAccreditation(); + /** + * + * + *
+   * Optional. The accreditations associated with the API version.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-accreditation`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues accreditation = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The accreditation. + */ + com.google.cloud.apihub.v1.AttributeValues getAccreditation(); + /** + * + * + *
+   * Optional. The accreditations associated with the API version.
+   * This maps to the following system defined attribute:
+   * `projects/{project}/locations/{location}/attributes/system-accreditation`
+   * attribute.
+   * The number of values for this attribute will be based on the
+   * cardinality of the attribute. The same can be retrieved via GetAttribute
+   * API. All values should be from the list of allowed values defined for the
+   * attribute.
+   * 
+ * + * + * .google.cloud.apihub.v1.AttributeValues accreditation = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.AttributeValuesOrBuilder getAccreditationOrBuilder(); + + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the Version
+   * resource. The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getAttributesCount(); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the Version
+   * resource. The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsAttributes(java.lang.String key); + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAttributes(); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the Version
+   * resource. The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getAttributesMap(); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the Version
+   * resource. The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.apihub.v1.AttributeValues defaultValue); + /** + * + * + *
+   * Optional. The list of user defined attributes associated with the Version
+   * resource. The key is the attribute name. It will be of the format:
+   * `projects/{project}/locations/{location}/attributes/{attribute}`.
+   * The value is the attribute values associated with the resource.
+   * 
+ * + * + * map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.apihub.v1.AttributeValues getAttributesOrThrow(java.lang.String key); + + /** + * + * + *
+   * Optional. The selected deployment for a Version resource.
+   * This can be used when special handling is needed on client side for a
+   * particular deployment linked to the version.
+   * Format is
+   * `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * + * string selected_deployment = 16 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The selectedDeployment. + */ + java.lang.String getSelectedDeployment(); + /** + * + * + *
+   * Optional. The selected deployment for a Version resource.
+   * This can be used when special handling is needed on client side for a
+   * particular deployment linked to the version.
+   * Format is
+   * `projects/{project}/locations/{location}/deployments/{deployment}`
+   * 
+ * + * + * string selected_deployment = 16 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for selectedDeployment. + */ + com.google.protobuf.ByteString getSelectedDeploymentBytes(); +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/proto/google/cloud/apihub/v1/apihub_service.proto b/java-apihub/proto-google-cloud-apihub-v1/src/main/proto/google/cloud/apihub/v1/apihub_service.proto new file mode 100644 index 000000000000..bbc89cae32dc --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/proto/google/cloud/apihub/v1/apihub_service.proto @@ -0,0 +1,1836 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.apihub.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/apihub/v1/common_fields.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.ApiHub.V1"; +option go_package = "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb"; +option java_multiple_files = true; +option java_outer_classname = "ApiHubServiceProto"; +option java_package = "com.google.cloud.apihub.v1"; +option php_namespace = "Google\\Cloud\\ApiHub\\V1"; +option ruby_package = "Google::Cloud::ApiHub::V1"; + +// This service provides all methods related to the API hub. +service ApiHub { + option (google.api.default_host) = "apihub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Create an API resource in the API hub. + // Once an API resource is created, versions can be added to it. + rpc CreateApi(CreateApiRequest) returns (Api) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/apis" + body: "api" + }; + option (google.api.method_signature) = "parent,api,api_id"; + } + + // Get API resource details including the API versions contained in it. + rpc GetApi(GetApiRequest) returns (Api) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List API resources in the API hub. + rpc ListApis(ListApisRequest) returns (ListApisResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/apis" + }; + option (google.api.method_signature) = "parent"; + } + + // Update an API resource in the API hub. The following fields in the + // [API][] can be updated: + // + // * [display_name][google.cloud.apihub.v1.Api.display_name] + // * [description][google.cloud.apihub.v1.Api.description] + // * [owner][google.cloud.apihub.v1.Api.owner] + // * [documentation][google.cloud.apihub.v1.Api.documentation] + // * [target_user][google.cloud.apihub.v1.Api.target_user] + // * [team][google.cloud.apihub.v1.Api.team] + // * [business_unit][google.cloud.apihub.v1.Api.business_unit] + // * [maturity_level][google.cloud.apihub.v1.Api.maturity_level] + // * [attributes][google.cloud.apihub.v1.Api.attributes] + // + // The + // [update_mask][google.cloud.apihub.v1.UpdateApiRequest.update_mask] + // should be used to specify the fields being updated. + // + // Updating the owner field requires complete owner message + // and updates both owner and email fields. + rpc UpdateApi(UpdateApiRequest) returns (Api) { + option (google.api.http) = { + patch: "/v1/{api.name=projects/*/locations/*/apis/*}" + body: "api" + }; + option (google.api.method_signature) = "api,update_mask"; + } + + // Delete an API resource in the API hub. API can only be deleted if all + // underlying versions are deleted. + rpc DeleteApi(DeleteApiRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apis/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Create an API version for an API resource in the API hub. + rpc CreateVersion(CreateVersionRequest) returns (Version) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/apis/*}/versions" + body: "version" + }; + option (google.api.method_signature) = "parent,version,version_id"; + } + + // Get details about the API version of an API resource. This will include + // information about the specs and operations present in the API + // version as well as the deployments linked to it. + rpc GetVersion(GetVersionRequest) returns (Version) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List API versions of an API resource in the API hub. + rpc ListVersions(ListVersionsRequest) returns (ListVersionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/apis/*}/versions" + }; + option (google.api.method_signature) = "parent"; + } + + // Update API version. The following fields in the + // [version][google.cloud.apihub.v1.Version] can be updated currently: + // + // * [display_name][google.cloud.apihub.v1.Version.display_name] + // * [description][google.cloud.apihub.v1.Version.description] + // * [documentation][google.cloud.apihub.v1.Version.documentation] + // * [deployments][google.cloud.apihub.v1.Version.deployments] + // * [lifecycle][google.cloud.apihub.v1.Version.lifecycle] + // * [compliance][google.cloud.apihub.v1.Version.compliance] + // * [accreditation][google.cloud.apihub.v1.Version.accreditation] + // * [attributes][google.cloud.apihub.v1.Version.attributes] + // + // The + // [update_mask][google.cloud.apihub.v1.UpdateVersionRequest.update_mask] + // should be used to specify the fields being updated. + rpc UpdateVersion(UpdateVersionRequest) returns (Version) { + option (google.api.http) = { + patch: "/v1/{version.name=projects/*/locations/*/apis/*/versions/*}" + body: "version" + }; + option (google.api.method_signature) = "version,update_mask"; + } + + // Delete an API version. Version can only be deleted if all underlying specs, + // operations, definitions and linked deployments are deleted. + rpc DeleteVersion(DeleteVersionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apis/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Add a spec to an API version in the API hub. + // Multiple specs can be added to an API version. + // Note, while adding a spec, at least one of `contents` or `source_uri` must + // be provided. If `contents` is provided, then `spec_type` must also be + // provided. + // + // On adding a spec with contents to the version, the operations present in it + // will be added to the version.Note that the file contents in the spec should + // be of the same type as defined in the + // `projects/{project}/locations/{location}/attributes/system-spec-type` + // attribute associated with spec resource. Note that specs of various types + // can be uploaded, however parsing of details is supported for OpenAPI spec + // currently. + // + // In order to access the information parsed from the spec, use the + // [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method. + // In order to access the raw contents for a particular spec, use the + // [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method. + // In order to access the operations parsed from the spec, use the + // [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] + // method. + rpc CreateSpec(CreateSpecRequest) returns (Spec) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs" + body: "spec" + }; + option (google.api.method_signature) = "parent,spec,spec_id"; + } + + // Get details about the information parsed from a spec. + // Note that this method does not return the raw spec contents. + // Use [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method + // to retrieve the same. + rpc GetSpec(GetSpecRequest) returns (Spec) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Get spec contents. + rpc GetSpecContents(GetSpecContentsRequest) returns (SpecContents) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:contents" + }; + option (google.api.method_signature) = "name"; + } + + // List specs corresponding to a particular API resource. + rpc ListSpecs(ListSpecsRequest) returns (ListSpecsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs" + }; + option (google.api.method_signature) = "parent"; + } + + // Update spec. The following fields in the + // [spec][google.cloud.apihub.v1.Spec] can be updated: + // + // * [display_name][google.cloud.apihub.v1.Spec.display_name] + // * [source_uri][google.cloud.apihub.v1.Spec.source_uri] + // * [lint_response][google.cloud.apihub.v1.Spec.lint_response] + // * [attributes][google.cloud.apihub.v1.Spec.attributes] + // * [contents][google.cloud.apihub.v1.Spec.contents] + // * [spec_type][google.cloud.apihub.v1.Spec.spec_type] + // + // In case of an OAS spec, updating spec contents can lead to: + // 1. Creation, deletion and update of operations. + // 2. Creation, deletion and update of definitions. + // 3. Update of other info parsed out from the new spec. + // + // In case of contents or source_uri being present in update mask, spec_type + // must also be present. Also, spec_type can not be present in update mask if + // contents or source_uri is not present. + // + // The + // [update_mask][google.cloud.apihub.v1.UpdateSpecRequest.update_mask] + // should be used to specify the fields being updated. + rpc UpdateSpec(UpdateSpecRequest) returns (Spec) { + option (google.api.http) = { + patch: "/v1/{spec.name=projects/*/locations/*/apis/*/versions/*/specs/*}" + body: "spec" + }; + option (google.api.method_signature) = "spec,update_mask"; + } + + // Delete a spec. + // Deleting a spec will also delete the associated operations from the + // version. + rpc DeleteSpec(DeleteSpecRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Get details about a particular operation in API version. + rpc GetApiOperation(GetApiOperationRequest) returns (ApiOperation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/operations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List operations in an API version. + rpc ListApiOperations(ListApiOperationsRequest) + returns (ListApiOperationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/operations" + }; + option (google.api.method_signature) = "parent"; + } + + // Get details about a definition in an API version. + rpc GetDefinition(GetDefinitionRequest) returns (Definition) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/definitions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Create a deployment resource in the API hub. + // Once a deployment resource is created, it can be associated with API + // versions. + rpc CreateDeployment(CreateDeploymentRequest) returns (Deployment) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/deployments" + body: "deployment" + }; + option (google.api.method_signature) = "parent,deployment,deployment_id"; + } + + // Get details about a deployment and the API versions linked to it. + rpc GetDeployment(GetDeploymentRequest) returns (Deployment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/deployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List deployment resources in the API hub. + rpc ListDeployments(ListDeploymentsRequest) + returns (ListDeploymentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/deployments" + }; + option (google.api.method_signature) = "parent"; + } + + // Update a deployment resource in the API hub. The following fields in the + // [deployment resource][google.cloud.apihub.v1.Deployment] can be + // updated: + // + // * [display_name][google.cloud.apihub.v1.Deployment.display_name] + // * [description][google.cloud.apihub.v1.Deployment.description] + // * [documentation][google.cloud.apihub.v1.Deployment.documentation] + // * [deployment_type][google.cloud.apihub.v1.Deployment.deployment_type] + // * [resource_uri][google.cloud.apihub.v1.Deployment.resource_uri] + // * [endpoints][google.cloud.apihub.v1.Deployment.endpoints] + // * [slo][google.cloud.apihub.v1.Deployment.slo] + // * [environment][google.cloud.apihub.v1.Deployment.environment] + // * [attributes][google.cloud.apihub.v1.Deployment.attributes] + // + // The + // [update_mask][google.cloud.apihub.v1.UpdateDeploymentRequest.update_mask] + // should be used to specify the fields being updated. + rpc UpdateDeployment(UpdateDeploymentRequest) returns (Deployment) { + option (google.api.http) = { + patch: "/v1/{deployment.name=projects/*/locations/*/deployments/*}" + body: "deployment" + }; + option (google.api.method_signature) = "deployment,update_mask"; + } + + // Delete a deployment resource in the API hub. + rpc DeleteDeployment(DeleteDeploymentRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/deployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Create a user defined attribute. + // + // Certain pre defined attributes are already created by the API hub. These + // attributes will have type as `SYSTEM_DEFINED` and can be listed via + // [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method. + // Allowed values for the same can be updated via + // [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] method. + rpc CreateAttribute(CreateAttributeRequest) returns (Attribute) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/attributes" + body: "attribute" + }; + option (google.api.method_signature) = "parent,attribute,attribute_id"; + } + + // Get details about the attribute. + rpc GetAttribute(GetAttributeRequest) returns (Attribute) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/attributes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Update the attribute. The following fields in the + // [Attribute resource][google.cloud.apihub.v1.Attribute] can be updated: + // + // * [display_name][google.cloud.apihub.v1.Attribute.display_name] + // The display name can be updated for user defined attributes only. + // * [description][google.cloud.apihub.v1.Attribute.description] + // The description can be updated for user defined attributes only. + // * [allowed_values][google.cloud.apihub.v1.Attribute.allowed_values] + // To update the list of allowed values, clients need to use the fetched list + // of allowed values and add or remove values to or from the same list. + // The mutable allowed values can be updated for both user defined and System + // defined attributes. The immutable allowed values cannot be updated or + // deleted. The updated list of allowed values cannot be empty. If an allowed + // value that is already used by some resource's attribute is deleted, then + // the association between the resource and the attribute value will also be + // deleted. + // * [cardinality][google.cloud.apihub.v1.Attribute.cardinality] + // The cardinality can be updated for user defined attributes only. + // Cardinality can only be increased during an update. + // + // The + // [update_mask][google.cloud.apihub.v1.UpdateAttributeRequest.update_mask] + // should be used to specify the fields being updated. + rpc UpdateAttribute(UpdateAttributeRequest) returns (Attribute) { + option (google.api.http) = { + patch: "/v1/{attribute.name=projects/*/locations/*/attributes/*}" + body: "attribute" + }; + option (google.api.method_signature) = "attribute,update_mask"; + } + + // Delete an attribute. + // + // Note: System defined attributes cannot be deleted. All + // associations of the attribute being deleted with any API hub resource will + // also get deleted. + rpc DeleteAttribute(DeleteAttributeRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/attributes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List all attributes. + rpc ListAttributes(ListAttributesRequest) returns (ListAttributesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/attributes" + }; + option (google.api.method_signature) = "parent"; + } + + // Search across API-Hub resources. + rpc SearchResources(SearchResourcesRequest) + returns (SearchResourcesResponse) { + option (google.api.http) = { + post: "/v1/{location=projects/*/locations/*}:searchResources" + body: "*" + }; + option (google.api.method_signature) = "location,query"; + } + + // Create an External API resource in the API hub. + rpc CreateExternalApi(CreateExternalApiRequest) returns (ExternalApi) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/externalApis" + body: "external_api" + }; + option (google.api.method_signature) = + "parent,external_api,external_api_id"; + } + + // Get details about an External API resource in the API hub. + rpc GetExternalApi(GetExternalApiRequest) returns (ExternalApi) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/externalApis/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Update an External API resource in the API hub. The following fields can be + // updated: + // + // * [display_name][google.cloud.apihub.v1.ExternalApi.display_name] + // * [description][google.cloud.apihub.v1.ExternalApi.description] + // * [documentation][google.cloud.apihub.v1.ExternalApi.documentation] + // * [endpoints][google.cloud.apihub.v1.ExternalApi.endpoints] + // * [paths][google.cloud.apihub.v1.ExternalApi.paths] + // + // The + // [update_mask][google.cloud.apihub.v1.UpdateExternalApiRequest.update_mask] + // should be used to specify the fields being updated. + rpc UpdateExternalApi(UpdateExternalApiRequest) returns (ExternalApi) { + option (google.api.http) = { + patch: "/v1/{external_api.name=projects/*/locations/*/externalApis/*}" + body: "external_api" + }; + option (google.api.method_signature) = "external_api,update_mask"; + } + + // Delete an External API resource in the API hub. + rpc DeleteExternalApi(DeleteExternalApiRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/externalApis/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List External API resources in the API hub. + rpc ListExternalApis(ListExternalApisRequest) + returns (ListExternalApisResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/externalApis" + }; + option (google.api.method_signature) = "parent"; + } +} + +// This service provides methods for various operations related to a +// [Dependency][google.cloud.apihub.v1.Dependency] in the API hub. +service ApiHubDependencies { + option (google.api.default_host) = "apihub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Create a dependency between two entities in the API hub. + rpc CreateDependency(CreateDependencyRequest) returns (Dependency) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/dependencies" + body: "dependency" + }; + option (google.api.method_signature) = "parent,dependency,dependency_id"; + } + + // Get details about a dependency resource in the API hub. + rpc GetDependency(GetDependencyRequest) returns (Dependency) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/dependencies/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Update a dependency based on the + // [update_mask][google.cloud.apihub.v1.UpdateDependencyRequest.update_mask] + // provided in the request. + // + // The following fields in the [dependency][google.cloud.apihub.v1.Dependency] + // can be updated: + // * [description][google.cloud.apihub.v1.Dependency.description] + rpc UpdateDependency(UpdateDependencyRequest) returns (Dependency) { + option (google.api.http) = { + patch: "/v1/{dependency.name=projects/*/locations/*/dependencies/*}" + body: "dependency" + }; + option (google.api.method_signature) = "dependency,update_mask"; + } + + // Delete the dependency resource. + rpc DeleteDependency(DeleteDependencyRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/dependencies/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List dependencies based on the provided filter and pagination parameters. + rpc ListDependencies(ListDependenciesRequest) + returns (ListDependenciesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/dependencies" + }; + option (google.api.method_signature) = "parent"; + } +} + +// The [CreateApi][google.cloud.apihub.v1.ApiHub.CreateApi] method's request. +message CreateApiRequest { + // Required. The parent resource for the API resource. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Api" + } + ]; + + // Optional. The ID to use for the API resource, which will become the final + // component of the API's resource name. This field is optional. + // + // * If provided, the same will be used. The service will throw an error if + // the specified id is already used by another API resource in the API hub. + // * If not provided, a system generated id will be used. + // + // This value should be 4-500 characters, and valid characters + // are /[a-z][A-Z][0-9]-_/. + string api_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The API resource to create. + Api api = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The [GetApi][google.cloud.apihub.v1.ApiHub.GetApi] method's request. +message GetApiRequest { + // Required. The name of the API resource to retrieve. + // Format: `projects/{project}/locations/{location}/apis/{api}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Api" } + ]; +} + +// The [UpdateApi][google.cloud.apihub.v1.ApiHub.UpdateApi] method's request. +message UpdateApiRequest { + // Required. The API resource to update. + // + // The API resource's `name` field is used to identify the API resource to + // update. + // Format: `projects/{project}/locations/{location}/apis/{api}` + Api api = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The [DeleteApi][google.cloud.apihub.v1.ApiHub.DeleteApi] method's request. +message DeleteApiRequest { + // Required. The name of the API resource to delete. + // Format: `projects/{project}/locations/{location}/apis/{api}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Api" } + ]; + + // Optional. If set to true, any versions from this API will also be deleted. + // Otherwise, the request will only work if the API has no versions. + bool force = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The [ListApis][google.cloud.apihub.v1.ApiHub.ListApis] method's request. +message ListApisRequest { + // Required. The parent, which owns this collection of API resources. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Api" + } + ]; + + // Optional. An expression that filters the list of ApiResources. + // + // A filter expression consists of a field name, a comparison + // operator, and a value for filtering. The value must be a string. The + // comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not + // case sensitive. + // + // The following fields in the `ApiResource` are eligible for filtering: + // + // * `owner.email` - The email of the team which owns the ApiResource. + // Allowed comparison operators: `=`. + // * `create_time` - The time at which the ApiResource was created. The + // value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + // format. Allowed comparison operators: `>` and `<`. + // * `display_name` - The display name of the ApiResource. Allowed + // comparison operators: `=`. + // * `target_user.enum_values.values.id` - The allowed value id of the + // target users attribute associated with the ApiResource. Allowed + // comparison operator is `:`. + // * `target_user.enum_values.values.display_name` - The allowed value + // display name of the target users attribute associated with the + // ApiResource. Allowed comparison operator is `:`. + // * `team.enum_values.values.id` - The allowed value id of the team + // attribute associated with the ApiResource. Allowed comparison operator is + // `:`. + // * `team.enum_values.values.display_name` - The allowed value display name + // of the team attribute associated with the ApiResource. Allowed comparison + // operator is `:`. + // * `business_unit.enum_values.values.id` - The allowed value id of the + // business unit attribute associated with the ApiResource. Allowed + // comparison operator is `:`. + // * `business_unit.enum_values.values.display_name` - The allowed value + // display name of the business unit attribute associated with the + // ApiResource. Allowed comparison operator is `:`. + // * `maturity_level.enum_values.values.id` - The allowed value id of the + // maturity level attribute associated with the ApiResource. Allowed + // comparison operator is `:`. + // * `maturity_level.enum_values.values.display_name` - The allowed value + // display name of the maturity level attribute associated with the + // ApiResource. Allowed comparison operator is `:`. + // * `api_style.enum_values.values.id` - The allowed value id of the + // api style attribute associated with the ApiResource. Allowed + // comparison operator is `:`. + // * `api_style.enum_values.values.display_name` - The allowed value display + // name of the api style attribute associated with the ApiResource. Allowed + // comparison operator is `:`. + // + // Expressions are combined with either `AND` logic operator or `OR` logical + // operator but not both of them together i.e. only one of the `AND` or `OR` + // operator can be used throughout the filter string and both the operators + // cannot be used together. No other logical operators are supported. At most + // three filter fields are allowed in the filter string and if provided + // more than that then `INVALID_ARGUMENT` error is returned by the API. + // + // Here are a few examples: + // + // * `owner.email = \"apihub@google.com\"` - - The owner team email is + // _apihub@google.com_. + // * `owner.email = \"apihub@google.com\" AND create_time < + // \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + // The owner team email is _apihub@google.com_ and the api was created + // before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + // * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id: + // apihub-team-id` - The filter string specifies the APIs where the owner + // team email is _apihub@google.com_ or the id of the allowed value + // associated with the team attribute is _apihub-team-id_. + // * `owner.email = \"apihub@google.com\" OR + // team.enum_values.values.display_name: ApiHub Team` - The filter string + // specifies the APIs where the owner team email is _apihub@google.com_ or + // the display name of the allowed value associated with the team attribute + // is `ApiHub Team`. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of API resources to return. The service may + // return fewer than this value. If unspecified, at most 50 Apis will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListApis` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters (except page_size) provided to + // `ListApis` must match the call that provided the page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The [ListApis][google.cloud.apihub.v1.ApiHub.ListApis] method's response. +message ListApisResponse { + // The API resources present in the API hub. + repeated Api apis = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The [CreateVersion][google.cloud.apihub.v1.ApiHub.CreateVersion] method's +// request. +message CreateVersionRequest { + // Required. The parent resource for API version. + // Format: `projects/{project}/locations/{location}/apis/{api}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Api" } + ]; + + // Optional. The ID to use for the API version, which will become the final + // component of the version's resource name. This field is optional. + // + // * If provided, the same will be used. The service will throw an error if + // the specified id is already used by another version in the API resource. + // * If not provided, a system generated id will be used. + // + // This value should be 4-500 characters, and valid characters + // are /[a-z][A-Z][0-9]-_/. + string version_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The version to create. + Version version = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The [GetVersion][google.cloud.apihub.v1.ApiHub.GetVersion] method's request. +message GetVersionRequest { + // Required. The name of the API version to retrieve. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Version" } + ]; +} + +// The [UpdateVersion][google.cloud.apihub.v1.ApiHub.UpdateVersion] method's +// request. +message UpdateVersionRequest { + // Required. The API version to update. + // + // The version's `name` field is used to identify the API version to update. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + Version version = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The [DeleteVersion][google.cloud.apihub.v1.ApiHub.DeleteVersion] method's +// request. +message DeleteVersionRequest { + // Required. The name of the version to delete. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Version" } + ]; + + // Optional. If set to true, any specs from this version will also be deleted. + // Otherwise, the request will only work if the version has no specs. + bool force = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The [ListVersions][google.cloud.apihub.v1.ApiHub.ListVersions] method's +// request. +message ListVersionsRequest { + // Required. The parent which owns this collection of API versions i.e., the + // API resource Format: `projects/{project}/locations/{location}/apis/{api}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Version" + } + ]; + + // Optional. An expression that filters the list of Versions. + // + // A filter expression consists of a field name, a comparison + // operator, and a value for filtering. The value must be a string, a + // number, or a boolean. The comparison operator must be one of: `<`, `>` or + // `=`. Filters are not case sensitive. + // + // The following fields in the `Version` are eligible for filtering: + // + // * `display_name` - The display name of the Version. Allowed + // comparison operators: `=`. + // * `create_time` - The time at which the Version was created. The + // value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + // format. Allowed comparison operators: `>` and `<`. + // * `lifecycle.enum_values.values.id` - The allowed value id of the + // lifecycle attribute associated with the Version. Allowed comparison + // operators: `:`. + // * `lifecycle.enum_values.values.display_name` - The allowed value display + // name of the lifecycle attribute associated with the Version. Allowed + // comparison operators: `:`. + // * `compliance.enum_values.values.id` - The allowed value id of the + // compliances attribute associated with the Version. Allowed comparison + // operators: `:`. + // * `compliance.enum_values.values.display_name` - The allowed value + // display name of the compliances attribute associated with the Version. + // Allowed comparison operators: `:`. + // * `accreditation.enum_values.values.id` - The allowed value id of the + // accreditations attribute associated with the Version. Allowed + // comparison operators: `:`. + // * `accreditation.enum_values.values.display_name` - The allowed value + // display name of the accreditations attribute associated with the Version. + // Allowed comparison operators: `:`. + // + // Expressions are combined with either `AND` logic operator or `OR` logical + // operator but not both of them together i.e. only one of the `AND` or `OR` + // operator can be used throughout the filter string and both the operators + // cannot be used together. No other logical operators are + // supported. At most three filter fields are allowed in the filter + // string and if provided more than that then `INVALID_ARGUMENT` error is + // returned by the API. + // + // Here are a few examples: + // + // * `lifecycle.enum_values.values.id: preview-id` - The filter string + // specifies that the id of the allowed value associated with the lifecycle + // attribute of the Version is _preview-id_. + // * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` - + // The filter string specifies that the display name of the allowed value + // associated with the lifecycle attribute of the Version is `Preview + // Display Name`. + // * `lifecycle.enum_values.values.id: preview-id AND create_time < + // \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + // The id of the allowed value associated with the lifecycle attribute of + // the Version is _preview-id_ and it was created before _2021-08-15 + // 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + // * `compliance.enum_values.values.id: gdpr-id OR + // compliance.enum_values.values.id: pci-dss-id` + // - The id of the allowed value associated with the compliance attribute is + // _gdpr-id_ or _pci-dss-id_. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of versions to return. The service may return + // fewer than this value. If unspecified, at most 50 versions will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListVersions` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters (except page_size) provided to + // `ListVersions` must match the call that provided the page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The [ListVersions][google.cloud.apihub.v1.ApiHub.ListVersions] method's +// response. +message ListVersionsResponse { + // The versions corresponding to an API. + repeated Version versions = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The [CreateSpec][google.cloud.apihub.v1.ApiHub.CreateSpec] method's request. +message CreateSpecRequest { + // Required. The parent resource for Spec. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Version" } + ]; + + // Optional. The ID to use for the spec, which will become the final component + // of the spec's resource name. This field is optional. + // + // * If provided, the same will be used. The service will throw an error if + // the specified id is already used by another spec in the API + // resource. + // * If not provided, a system generated id will be used. + // + // This value should be 4-500 characters, and valid characters + // are /[a-z][A-Z][0-9]-_/. + string spec_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The spec to create. + Spec spec = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method's request. +message GetSpecRequest { + // Required. The name of the spec to retrieve. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Spec" } + ]; +} + +// The [UpdateSpec][google.cloud.apihub.v1.ApiHub.UpdateSpec] method's request. +message UpdateSpecRequest { + // Required. The spec to update. + // + // The spec's `name` field is used to identify the spec to + // update. Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + Spec spec = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The [DeleteSpec][google.cloud.apihub.v1.ApiHub.DeleteSpec] method's request. +message DeleteSpecRequest { + // Required. The name of the spec to delete. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Spec" } + ]; +} + +// The [ListSpecs][ListSpecs] method's request. +message ListSpecsRequest { + // Required. The parent, which owns this collection of specs. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Spec" + } + ]; + + // Optional. An expression that filters the list of Specs. + // + // A filter expression consists of a field name, a comparison + // operator, and a value for filtering. The value must be a string. The + // comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not + // case sensitive. + // + // The following fields in the `Spec` are eligible for filtering: + // + // * `display_name` - The display name of the Spec. Allowed comparison + // operators: `=`. + // * `create_time` - The time at which the Spec was created. The + // value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + // format. Allowed comparison operators: `>` and `<`. + // * `spec_type.enum_values.values.id` - The allowed value id of the + // spec_type attribute associated with the Spec. Allowed comparison + // operators: `:`. + // * `spec_type.enum_values.values.display_name` - The allowed value display + // name of the spec_type attribute associated with the Spec. Allowed + // comparison operators: `:`. + // * `lint_response.json_values.values` - The json value of the + // lint_response attribute associated with the Spec. Allowed comparison + // operators: `:`. + // * `mime_type` - The MIME type of the Spec. Allowed comparison + // operators: `=`. + // + // Expressions are combined with either `AND` logic operator or `OR` logical + // operator but not both of them together i.e. only one of the `AND` or `OR` + // operator can be used throughout the filter string and both the operators + // cannot be used together. No other logical operators are + // supported. At most three filter fields are allowed in the filter + // string and if provided more than that then `INVALID_ARGUMENT` error is + // returned by the API. + // + // Here are a few examples: + // + // * `spec_type.enum_values.values.id: rest-id` - The filter + // string specifies that the id of the allowed value associated with the + // spec_type attribute is _rest-id_. + // * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` - + // The filter string specifies that the display name of the allowed value + // associated with the spec_type attribute is `Rest Display Name`. + // * `spec_type.enum_values.values.id: grpc-id AND create_time < + // \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + // The id of the allowed value associated with the spec_type attribute is + // _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and + // after _2021-08-10 12:00:00 UTC_. + // * `spec_type.enum_values.values.id: rest-id OR + // spec_type.enum_values.values.id: grpc-id` + // - The id of the allowed value associated with the spec_type attribute is + // _rest-id_ or _grpc-id_. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of specs to return. The service may return + // fewer than this value. If unspecified, at most 50 specs will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListSpecs` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListSpecs` must + // match the call that provided the page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The [ListSpecs][google.cloud.apihub.v1.ApiHub.ListSpecs] method's response. +message ListSpecsResponse { + // The specs corresponding to an API. + repeated Spec specs = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method's +// request. +message GetSpecContentsRequest { + // Required. The name of the spec whose contents need to be retrieved. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Spec" } + ]; +} + +// The [GetApiOperation][google.cloud.apihub.v1.ApiHub.GetApiOperation] method's +// request. +message GetApiOperationRequest { + // Required. The name of the operation to retrieve. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/ApiOperation" + } + ]; +} + +// The [ListApiOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] +// method's request. +message ListApiOperationsRequest { + // Required. The parent which owns this collection of operations i.e., the API + // version. Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/ApiOperation" + } + ]; + + // Optional. An expression that filters the list of ApiOperations. + // + // A filter expression consists of a field name, a comparison + // operator, and a value for filtering. The value must be a string or a + // boolean. The comparison operator must be one of: `<`, `>` or + // `=`. Filters are not case sensitive. + // + // The following fields in the `ApiOperation` are eligible for filtering: + // * `name` - The ApiOperation resource name. Allowed comparison + // operators: + // `=`. + // * `details.http_operation.path.path` - The http operation's complete path + // relative to server endpoint. Allowed comparison operators: `=`. + // * `details.http_operation.method` - The http operation method type. + // Allowed comparison operators: `=`. + // * `details.deprecated` - Indicates if the ApiOperation is deprecated. + // Allowed values are True / False indicating the deprycation status of the + // ApiOperation. Allowed comparison operators: `=`. + // * `create_time` - The time at which the ApiOperation was created. The + // value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + // format. Allowed comparison operators: `>` and `<`. + // + // Expressions are combined with either `AND` logic operator or `OR` logical + // operator but not both of them together i.e. only one of the `AND` or `OR` + // operator can be used throughout the filter string and both the operators + // cannot be used together. No other logical operators are supported. At most + // three filter fields are allowed in the filter string and if provided + // more than that then `INVALID_ARGUMENT` error is returned by the API. + // + // Here are a few examples: + // + // * `details.deprecated = True` - The ApiOperation is deprecated. + // * `details.http_operation.method = GET AND create_time < + // \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + // The method of the http operation of the ApiOperation is _GET_ and the + // spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 + // 12:00:00 UTC_. + // * `details.http_operation.method = GET OR details.http_operation.method = + // POST`. - The http operation of the method of ApiOperation is _GET_ or + // _POST_. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of operations to return. The service may + // return fewer than this value. If unspecified, at most 50 operations will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListApiOperations` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters (except page_size) provided to + // `ListApiOperations` must match the call that provided the page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The [ListApiOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] +// method's response. +message ListApiOperationsResponse { + // The operations corresponding to an API version. + // Only following field will be populated in the response: name, + // spec, details.deprecated, details.http_operation.path.path, + // details.http_operation.method and details.documentation.external_uri. + repeated ApiOperation api_operations = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The [GetDefinition][google.cloud.apihub.v1.ApiHub.GetDefinition] method's +// request. +message GetDefinitionRequest { + // Required. The name of the definition to retrieve. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Definition" + } + ]; +} + +// The [CreateDeployment][google.cloud.apihub.v1.ApiHub.CreateDeployment] +// method's request. +message CreateDeploymentRequest { + // Required. The parent resource for the deployment resource. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Deployment" + } + ]; + + // Optional. The ID to use for the deployment resource, which will become the + // final component of the deployment's resource name. This field is optional. + // + // * If provided, the same will be used. The service will throw an error if + // the specified id is already used by another deployment resource in the API + // hub. + // * If not provided, a system generated id will be used. + // + // This value should be 4-500 characters, and valid characters + // are /[a-z][A-Z][0-9]-_/. + string deployment_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The deployment resource to create. + Deployment deployment = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The [GetDeployment][google.cloud.apihub.v1.ApiHub.GetDeployment] method's +// request. +message GetDeploymentRequest { + // Required. The name of the deployment resource to retrieve. + // Format: `projects/{project}/locations/{location}/deployments/{deployment}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Deployment" + } + ]; +} + +// The [UpdateDeployment][google.cloud.apihub.v1.ApiHub.UpdateDeployment] +// method's request. +message UpdateDeploymentRequest { + // Required. The deployment resource to update. + // + // The deployment resource's `name` field is used to identify the deployment + // resource to update. + // Format: `projects/{project}/locations/{location}/deployments/{deployment}` + Deployment deployment = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The [DeleteDeployment][google.cloud.apihub.v1.ApiHub.DeleteDeployment] +// method's request. +message DeleteDeploymentRequest { + // Required. The name of the deployment resource to delete. + // Format: `projects/{project}/locations/{location}/deployments/{deployment}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Deployment" + } + ]; +} + +// The [ListDeployments][google.cloud.apihub.v1.ApiHub.ListDeployments] method's +// request. +message ListDeploymentsRequest { + // Required. The parent, which owns this collection of deployment resources. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Deployment" + } + ]; + + // Optional. An expression that filters the list of Deployments. + // + // A filter expression consists of a field name, a comparison + // operator, and a value for filtering. The value must be a string. The + // comparison operator must be one of: `<`, `>` or + // `=`. Filters are not case sensitive. + // + // The following fields in the `Deployments` are eligible for filtering: + // + // * `display_name` - The display name of the Deployment. Allowed + // comparison operators: `=`. + // * `create_time` - The time at which the Deployment was created. The + // value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + // format. Allowed comparison operators: `>` and `<`. + // * `resource_uri` - A URI to the deployment resource. Allowed + // comparison operators: `=`. + // * `api_versions` - The API versions linked to this deployment. Allowed + // comparison operators: `:`. + // * `deployment_type.enum_values.values.id` - The allowed value id of the + // deployment_type attribute associated with the Deployment. Allowed + // comparison operators: `:`. + // * `deployment_type.enum_values.values.display_name` - The allowed value + // display name of the deployment_type attribute associated with the + // Deployment. Allowed comparison operators: `:`. + // * `slo.string_values.values` -The allowed string value of the slo + // attribute associated with the deployment. Allowed comparison + // operators: `:`. + // * `environment.enum_values.values.id` - The allowed value id of the + // environment attribute associated with the deployment. Allowed + // comparison operators: `:`. + // * `environment.enum_values.values.display_name` - The allowed value + // display name of the environment attribute associated with the deployment. + // Allowed comparison operators: `:`. + // + // Expressions are combined with either `AND` logic operator or `OR` logical + // operator but not both of them together i.e. only one of the `AND` or `OR` + // operator can be used throughout the filter string and both the operators + // cannot be used together. No other logical operators are supported. At most + // three filter fields are allowed in the filter string and if provided + // more than that then `INVALID_ARGUMENT` error is returned by the API. + // + // Here are a few examples: + // + // * `environment.enum_values.values.id: staging-id` - The allowed value id + // of the environment attribute associated with the Deployment is + // _staging-id_. + // * `environment.enum_values.values.display_name: \"Staging Deployment\"` - + // The allowed value display name of the environment attribute associated + // with the Deployment is `Staging Deployment`. + // * `environment.enum_values.values.id: production-id AND create_time < + // \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + // The allowed value id of the environment attribute associated with the + // Deployment is _production-id_ and Deployment was created before + // _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + // * `environment.enum_values.values.id: production-id OR + // slo.string_values.values: \"99.99%\"` + // - The allowed value id of the environment attribute Deployment is + // _production-id_ or string value of the slo attribute is _99.99%_. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of deployment resources to return. The service + // may return fewer than this value. If unspecified, at most 50 deployments + // will be returned. The maximum value is 1000; values above 1000 will be + // coerced to 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListDeployments` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters (except page_size) provided to + // `ListDeployments` must match the call that provided the page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The [ListDeployments][google.cloud.apihub.v1.ApiHub.ListDeployments] method's +// response. +message ListDeploymentsResponse { + // The deployment resources present in the API hub. + repeated Deployment deployments = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The [CreateAttribute][google.cloud.apihub.v1.ApiHub.CreateAttribute] method's +// request. +message CreateAttributeRequest { + // Required. The parent resource for Attribute. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Attribute" + } + ]; + + // Optional. The ID to use for the attribute, which will become the final + // component of the attribute's resource name. This field is optional. + // + // * If provided, the same will be used. The service will throw an error if + // the specified id is already used by another attribute resource in the API + // hub. + // * If not provided, a system generated id will be used. + // + // This value should be 4-500 characters, and valid characters + // are /[a-z][A-Z][0-9]-_/. + string attribute_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The attribute to create. + Attribute attribute = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The [GetAttribute][google.cloud.apihub.v1.ApiHub.GetAttribute] method's +// request. +message GetAttributeRequest { + // Required. The name of the attribute to retrieve. + // Format: + // `projects/{project}/locations/{location}/attributes/{attribute}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Attribute" + } + ]; +} + +// The [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] method's +// request. +message UpdateAttributeRequest { + // Required. The attribute to update. + // + // The attribute's `name` field is used to identify the attribute to update. + // Format: + // `projects/{project}/locations/{location}/attributes/{attribute}` + Attribute attribute = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The [DeleteAttribute][google.cloud.apihub.v1.ApiHub.DeleteAttribute] method's +// request. +message DeleteAttributeRequest { + // Required. The name of the attribute to delete. + // Format: + // `projects/{project}/locations/{location}/attributes/{attribute}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Attribute" + } + ]; +} + +// The [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method's +// request. +message ListAttributesRequest { + // Required. The parent resource for Attribute. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Attribute" + } + ]; + + // Optional. An expression that filters the list of Attributes. + // + // A filter expression consists of a field name, a comparison + // operator, and a value for filtering. The value must be a string or a + // boolean. The comparison operator must be one of: `<`, `>` or + // `=`. Filters are not case sensitive. + // + // The following fields in the `Attribute` are eligible for filtering: + // + // * `display_name` - The display name of the Attribute. Allowed + // comparison operators: `=`. + // * `definition_type` - The definition type of the attribute. Allowed + // comparison operators: `=`. + // * `scope` - The scope of the attribute. Allowed comparison operators: + // `=`. + // * `data_type` - The type of the data of the attribute. Allowed + // comparison operators: `=`. + // * `mandatory` - Denotes whether the attribute is mandatory or not. + // Allowed comparison operators: `=`. + // * `create_time` - The time at which the Attribute was created. The + // value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + // format. Allowed comparison operators: `>` and `<`. + // + // Expressions are combined with either `AND` logic operator or `OR` logical + // operator but not both of them together i.e. only one of the `AND` or `OR` + // operator can be used throughout the filter string and both the operators + // cannot be used together. No other logical operators are + // supported. At most three filter fields are allowed in the filter + // string and if provided more than that then `INVALID_ARGUMENT` error is + // returned by the API. + // + // Here are a few examples: + // + // * `display_name = production` - - The display name of the attribute is + // _production_. + // * `(display_name = production) AND (create_time < + // \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` - + // The display name of the attribute is _production_ and the attribute was + // created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 + // UTC_. + // * `display_name = production OR scope = api` - + // The attribute where the display name is _production_ or the scope is + // _api_. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of attribute resources to return. The service + // may return fewer than this value. If unspecified, at most 50 attributes + // will be returned. The maximum value is 1000; values above 1000 will be + // coerced to 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListAttributes` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListAttributes` must + // match the call that provided the page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method's +// response. +message ListAttributesResponse { + // The list of all attributes. + repeated Attribute attributes = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The [SearchResources][google.cloud.apihub.v1.ApiHub.SearchResources] method's +// request. +message SearchResourcesRequest { + // Required. The resource name of the location which will be of the type + // `projects/{project_id}/locations/{location_id}`. This field is used to + // identify the instance of API-Hub in which resources should be searched. + string location = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The free text search query. This query can contain keywords which + // could be related to any detail of the API-Hub resources such display names, + // descriptions, attributes etc. + string query = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An expression that filters the list of search results. + // + // A filter expression consists of a field name, a comparison operator, + // and a value for filtering. The value must be a string, a number, or a + // boolean. The comparison operator must be `=`. Filters are not case + // sensitive. + // + // The following field names are eligible for filtering: + // * `resource_type` - The type of resource in the search results. + // Must be one of the following: `Api`, `ApiOperation`, `Deployment`, + // `Definition`, `Spec` or `Version`. This field can only be specified once + // in the filter. + // + // Here are is an example: + // + // * `resource_type = Api` - The resource_type is _Api_. + string filter = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of search results to return. The service may + // return fewer than this value. If unspecified at most 10 search results will + // be returned. If value is negative then `INVALID_ARGUMENT` error is + // returned. The maximum value is 25; values above 25 will be coerced to 25. + // While paginating, you can specify a new page size parameter for each page + // of search results to be listed. + int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous + // [SearchResources][SearchResources] + // call. Specify this parameter to retrieve the next page of transactions. + // + // When paginating, you must specify the `page_token` parameter and all the + // other parameters except + // [page_size][google.cloud.apihub.v1.SearchResourcesRequest.page_size] + // should be specified with the same value which was used in the previous + // call. If the other fields are set with a different value than the previous + // call then `INVALID_ARGUMENT` error is returned. + string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// ApiHubResource is one of the resources such as Api, Operation, Deployment, +// Definition, Spec and Version resources stored in API-Hub. +message ApiHubResource { + oneof resource { + // This represents Api resource in search results. Only name, display_name, + // description and owner fields are populated in search results. + Api api = 1; + + // This represents ApiOperation resource in search results. Only name, + // and description fields are populated in search results. + ApiOperation operation = 2; + + // This represents Deployment resource in search results. Only name, + // display_name and description fields are populated in search results. + Deployment deployment = 3; + + // This represents Spec resource in search results. Only name, + // display_name and description fields are populated in search results. + Spec spec = 4; + + // This represents Definition resource in search results. + // Only name field is populated in search results. + Definition definition = 5; + + // This represents Version resource in search results. Only name, + // display_name and description fields are populated in search results. + Version version = 6; + } +} + +// Represents the search results. +message SearchResult { + // This represents the ApiHubResource. + // Note: Only selected fields of the resources are populated in response. + ApiHubResource resource = 1; +} + +// Response for the +// [SearchResources][google.cloud.apihub.v1.ApiHub.SearchResources] method. +message SearchResourcesResponse { + // List of search results according to the filter and search query specified. + // The order of search results represents the ranking. + repeated SearchResult search_results = 1; + + // Pass this token in the + // [SearchResourcesRequest][google.cloud.apihub.v1.SearchResourcesRequest] + // to continue to list results. If all results have been returned, this field + // is an empty string or not present in the response. + string next_page_token = 2; +} + +// The +// [CreateDependency][google.cloud.apihub.v1.ApiHubDependencies.CreateDependency] +// method's request. +message CreateDependencyRequest { + // Required. The parent resource for the dependency resource. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Dependency" + } + ]; + + // Optional. The ID to use for the dependency resource, which will become the + // final component of the dependency's resource name. This field is optional. + // * If provided, the same will be used. The service will throw an error if + // duplicate id is provided by the client. + // * If not provided, a system generated id will be used. + // + // This value should be 4-500 characters, and valid characters + // are `[a-z][A-Z][0-9]-_`. + string dependency_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The dependency resource to create. + Dependency dependency = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The [GetDependency][.ApiHubDependencies.GetDependency] +// method's request. +message GetDependencyRequest { + // Required. The name of the dependency resource to retrieve. + // Format: `projects/{project}/locations/{location}/dependencies/{dependency}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Dependency" + } + ]; +} + +// The +// [UpdateDependency][google.cloud.apihub.v1.ApiHubDependencies.UpdateDependency] +// method's request. +message UpdateDependencyRequest { + // Required. The dependency resource to update. + // + // The dependency's `name` field is used to identify the dependency to update. + // Format: `projects/{project}/locations/{location}/dependencies/{dependency}` + Dependency dependency = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The +// [DeleteDependency][google.cloud.apihub.v1.ApiHubDependencies.DeleteDependency] +// method's request. +message DeleteDependencyRequest { + // Required. The name of the dependency resource to delete. + // Format: `projects/{project}/locations/{location}/dependencies/{dependency}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Dependency" + } + ]; +} + +// The +// [ListDependencies][google.cloud.apihub.v1.ApiHubDependencies.ListDependencies] +// method's request. +message ListDependenciesRequest { + // Required. The parent which owns this collection of dependency resources. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Dependency" + } + ]; + + // Optional. An expression that filters the list of Dependencies. + // + // A filter expression consists of a field name, a comparison operator, and + // a value for filtering. The value must be a string. Allowed comparison + // operator is `=`. Filters are not case sensitive. + // + // The following fields in the `Dependency` are eligible for filtering: + // + // * `consumer.operation_resource_name` - The operation resource name for + // the consumer entity involved in a dependency. Allowed comparison + // operators: `=`. + // * `consumer.external_api_resource_name` - The external api resource name + // for the consumer entity involved in a dependency. Allowed comparison + // operators: `=`. + // * `supplier.operation_resource_name` - The operation resource name for + // the supplier entity involved in a dependency. Allowed comparison + // operators: `=`. + // * `supplier.external_api_resource_name` - The external api resource name + // for the supplier entity involved in a dependency. Allowed comparison + // operators: `=`. + // + // Expressions are combined with either `AND` logic operator or `OR` logical + // operator but not both of them together i.e. only one of the `AND` or `OR` + // operator can be used throughout the filter string and both the operators + // cannot be used together. No other logical operators are supported. At most + // three filter fields are allowed in the filter string and if provided + // more than that then `INVALID_ARGUMENT` error is returned by the API. + // + // For example, `consumer.operation_resource_name = + // \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR + // supplier.operation_resource_name = + // \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The + // dependencies with either consumer or supplier operation resource name as + // _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of dependency resources to return. The service + // may return fewer than this value. If unspecified, at most 50 dependencies + // will be returned. The maximum value is 1000; values above 1000 will be + // coerced to 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListDependencies` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListDependencies` must + // match the call that provided the page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The +// [ListDependencies][google.cloud.apihub.v1.ApiHubDependencies.ListDependencies] +// method's response. +message ListDependenciesResponse { + // The dependency resources present in the API hub. + // Only following field will be populated in the response: name. + repeated Dependency dependencies = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The [CreateExternalApi][google.cloud.apihub.v1.ApiHub.CreateExternalApi] +// method's request. +message CreateExternalApiRequest { + // Required. The parent resource for the External API resource. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/ExternalApi" + } + ]; + + // Optional. The ID to use for the External API resource, which will become + // the final component of the External API's resource name. This field is + // optional. + // + // * If provided, the same will be used. The service will throw an error if + // the specified id is already used by another External API resource in the + // API hub. + // * If not provided, a system generated id will be used. + // + // This value should be 4-500 characters, and valid characters + // are /[a-z][A-Z][0-9]-_/. + string external_api_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The External API resource to create. + ExternalApi external_api = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The [GetExternalApi][google.cloud.apihub.v1.ApiHub.GetExternalApi] method's +// request. +message GetExternalApiRequest { + // Required. The name of the External API resource to retrieve. + // Format: + // `projects/{project}/locations/{location}/externalApis/{externalApi}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/ExternalApi" + } + ]; +} + +// The [UpdateExternalApi][google.cloud.apihub.v1.ApiHub.UpdateExternalApi] +// method's request. +message UpdateExternalApiRequest { + // Required. The External API resource to update. + // + // The External API resource's `name` field is used to identify the External + // API resource to update. Format: + // `projects/{project}/locations/{location}/externalApis/{externalApi}` + ExternalApi external_api = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The [DeleteExternalApi][google.cloud.apihub.v1.ApiHub.DeleteExternalApi] +// method's request. +message DeleteExternalApiRequest { + // Required. The name of the External API resource to delete. + // Format: + // `projects/{project}/locations/{location}/externalApis/{externalApi}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/ExternalApi" + } + ]; +} + +// The [ListExternalApis][google.cloud.apihub.v1.ApiHub.ListExternalApis] +// method's request. +message ListExternalApisRequest { + // Required. The parent, which owns this collection of External API resources. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/ExternalApi" + } + ]; + + // Optional. The maximum number of External API resources to return. The + // service may return fewer than this value. If unspecified, at most 50 + // ExternalApis will be returned. The maximum value is 1000; values above 1000 + // will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListExternalApis` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters (except page_size) provided to + // `ListExternalApis` must match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The [ListExternalApis][google.cloud.apihub.v1.ApiHub.ListExternalApis] +// method's response. +message ListExternalApisResponse { + // The External API resources present in the API hub. + // Only following fields will be populated in the response: name, + // display_name, documentation.external_uri. + repeated ExternalApi external_apis = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/proto/google/cloud/apihub/v1/common_fields.proto b/java-apihub/proto-google-cloud-apihub-v1/src/main/proto/google/cloud/apihub/v1/common_fields.proto new file mode 100644 index 000000000000..9d1c87f19a17 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/proto/google/cloud/apihub/v1/common_fields.proto @@ -0,0 +1,1297 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.apihub.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ApiHub.V1"; +option go_package = "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb"; +option java_multiple_files = true; +option java_outer_classname = "CommonFieldsProto"; +option java_package = "com.google.cloud.apihub.v1"; +option php_namespace = "Google\\Cloud\\ApiHub\\V1"; +option ruby_package = "Google::Cloud::ApiHub::V1"; +option (google.api.resource_definition) = { + type: "aiplatform.googleapis.com/Extension" + pattern: "projects/{project}/locations/{location}/extensions/{extension}" +}; + +// Lint state represents success or failure for linting. +enum LintState { + // Lint state unspecified. + LINT_STATE_UNSPECIFIED = 0; + + // Linting was completed successfully. + LINT_STATE_SUCCESS = 1; + + // Linting encountered errors. + LINT_STATE_ERROR = 2; +} + +// Enumeration of linter types. +enum Linter { + // Linter type unspecified. + LINTER_UNSPECIFIED = 0; + + // Linter type spectral. + SPECTRAL = 1; + + // Linter type other. + OTHER = 2; +} + +// Severity of the issue. +enum Severity { + // Severity unspecified. + SEVERITY_UNSPECIFIED = 0; + + // Severity error. + SEVERITY_ERROR = 1; + + // Severity warning. + SEVERITY_WARNING = 2; + + // Severity info. + SEVERITY_INFO = 3; + + // Severity hint. + SEVERITY_HINT = 4; +} + +// An API resource in the API Hub. +message Api { + option (google.api.resource) = { + type: "apihub.googleapis.com/Api" + pattern: "projects/{project}/locations/{location}/apis/{api}" + plural: "apis" + singular: "api" + }; + + // Identifier. The name of the API resource in the API Hub. + // + // Format: + // `projects/{project}/locations/{location}/apis/{api}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. The display name of the API resource. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The description of the API resource. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The documentation for the API resource. + Documentation documentation = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Owner details for the API resource. + Owner owner = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The list of versions present in an API resource. + // Note: An API resource can be associated with more than 1 version. + // Format is + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + repeated string versions = 6 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Version" } + ]; + + // Output only. The time at which the API resource was created. + google.protobuf.Timestamp create_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the API resource was last updated. + google.protobuf.Timestamp update_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The target users for the API. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-target-user` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues target_user = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The team owning the API. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-team` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues team = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The business unit owning the API. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-business-unit` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues business_unit = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maturity level of the API. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-maturity-level` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues maturity_level = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of user defined attributes associated with the API + // resource. The key is the attribute name. It will be of the format: + // `projects/{project}/locations/{location}/attributes/{attribute}`. + // The value is the attribute values associated with the resource. + map attributes = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The style of the API. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-api-style` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues api_style = 14 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The selected version for an API resource. + // This can be used when special handling is needed on client side for + // particular version of the API. Format is + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + string selected_version = 15 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Version" } + ]; +} + +// Represents a version of the API resource in API hub. This is also referred +// to as the API version. +message Version { + option (google.api.resource) = { + type: "apihub.googleapis.com/Version" + pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}" + plural: "versions" + singular: "version" + }; + + // Identifier. The name of the version. + // + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. The display name of the version. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The description of the version. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The documentation of the version. + Documentation documentation = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The specs associated with this version. + // Note that an API version can be associated with multiple specs. + // Format is + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + repeated string specs = 5 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Spec" } + ]; + + // Output only. The operations contained in the API version. + // These operations will be added to the version when a new spec is + // added or when an existing spec is updated. Format is + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` + repeated string api_operations = 6 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/ApiOperation" + } + ]; + + // Output only. The definitions contained in the API version. + // These definitions will be added to the version when a new spec is + // added or when an existing spec is updated. Format is + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}` + repeated string definitions = 7 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Definition" + } + ]; + + // Optional. The deployments linked to this API version. + // Note: A particular API version could be deployed to multiple deployments + // (for dev deployment, UAT deployment, etc) + // Format is + // `projects/{project}/locations/{location}/deployments/{deployment}` + repeated string deployments = 8 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Deployment" + } + ]; + + // Output only. The time at which the version was created. + google.protobuf.Timestamp create_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the version was last updated. + google.protobuf.Timestamp update_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The lifecycle of the API version. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-lifecycle` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues lifecycle = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The compliance associated with the API version. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-compliance` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues compliance = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The accreditations associated with the API version. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-accreditation` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues accreditation = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of user defined attributes associated with the Version + // resource. The key is the attribute name. It will be of the format: + // `projects/{project}/locations/{location}/attributes/{attribute}`. + // The value is the attribute values associated with the resource. + map attributes = 14 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The selected deployment for a Version resource. + // This can be used when special handling is needed on client side for a + // particular deployment linked to the version. + // Format is + // `projects/{project}/locations/{location}/deployments/{deployment}` + string selected_deployment = 16 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Deployment" + } + ]; +} + +// Represents a spec associated with an API version in the API +// Hub. Note that specs of various types can be uploaded, however +// parsing of details is supported for OpenAPI spec currently. +message Spec { + option (google.api.resource) = { + type: "apihub.googleapis.com/Spec" + pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}" + plural: "specs" + singular: "spec" + }; + + // Specifies the parsing mode for API specifications during creation and + // update. + // - `RELAXED`: Parsing errors in the specification content do not fail the + // API call. + // - `STRICT`: Parsing errors in the specification content result in failure + // of the API call. + // If not specified, defaults to `RELAXED`. + enum ParsingMode { + // Defaults to `RELAXED`. + PARSING_MODE_UNSPECIFIED = 0; + + // Parsing of the Spec on create and update is relaxed, meaning that + // parsing errors the spec contents will not fail the API call. + RELAXED = 1; + + // Parsing of the Spec on create and update is strict, meaning that + // parsing errors in the spec contents will fail the API call. + STRICT = 2; + } + + // Identifier. The name of the spec. + // + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. The display name of the spec. + // This can contain the file name of the spec. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The type of spec. + // The value should be one of the allowed values defined for + // `projects/{project}/locations/{location}/attributes/system-spec-type` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. + // + // Note, this field is mandatory if content is provided. + AttributeValues spec_type = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Input only. The contents of the uploaded spec. + SpecContents contents = 4 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = INPUT_ONLY + ]; + + // Output only. Details parsed from the spec. + SpecDetails details = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The URI of the spec source in case file is uploaded + // from an external version control system. + string source_uri = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The time at which the spec was created. + google.protobuf.Timestamp create_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the spec was last updated. + google.protobuf.Timestamp update_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The lint response for the spec. + LintResponse lint_response = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of user defined attributes associated with the spec. + // The key is the attribute name. It will be of the format: + // `projects/{project}/locations/{location}/attributes/{attribute}`. + // The value is the attribute values associated with the resource. + map attributes = 10 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The documentation of the spec. + // For OpenAPI spec, this will be populated from `externalDocs` in OpenAPI + // spec. + Documentation documentation = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Input only. Enum specifying the parsing mode for OpenAPI + // Specification (OAS) parsing. + ParsingMode parsing_mode = 12 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = INPUT_ONLY + ]; +} + +// Details of the deployment where APIs are hosted. +// A deployment could represent an Apigee proxy, API gateway, other Google Cloud +// services or non-Google Cloud services as well. A deployment entity is a root +// level entity in the API hub and exists independent of any API. +message Deployment { + option (google.api.resource) = { + type: "apihub.googleapis.com/Deployment" + pattern: "projects/{project}/locations/{location}/deployments/{deployment}" + plural: "deployments" + singular: "deployment" + }; + + // Identifier. The name of the deployment. + // + // Format: + // `projects/{project}/locations/{location}/deployments/{deployment}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. The display name of the deployment. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The description of the deployment. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The documentation of the deployment. + Documentation documentation = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The type of deployment. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-deployment-type` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues deployment_type = 5 [(google.api.field_behavior) = REQUIRED]; + + // Required. A URI to the runtime resource. This URI can be used to manage the + // resource. For example, if the runtime resource is of type APIGEE_PROXY, + // then this field will contain the URI to the management UI of the proxy. + string resource_uri = 6 [(google.api.field_behavior) = REQUIRED]; + + // Required. The endpoints at which this deployment resource is listening for + // API requests. This could be a list of complete URIs, hostnames or an IP + // addresses. + repeated string endpoints = 7 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The API versions linked to this deployment. + // Note: A particular deployment could be linked to multiple different API + // versions (of same or different APIs). + repeated string api_versions = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the deployment was created. + google.protobuf.Timestamp create_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the deployment was last updated. + google.protobuf.Timestamp update_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The SLO for this deployment. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-slo` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues slo = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The environment mapping to this deployment. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-environment` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues environment = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of user defined attributes associated with the + // deployment resource. The key is the attribute name. It will be of the + // format: `projects/{project}/locations/{location}/attributes/{attribute}`. + // The value is the attribute values associated with the resource. + map attributes = 13 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents an operation contained in an API version in the API Hub. +// An operation is added/updated/deleted in an API version when a new spec is +// added or an existing spec is updated/deleted in a version. +// Currently, an operation will be created only corresponding to OpenAPI spec as +// parsing is supported for OpenAPI spec. +message ApiOperation { + option (google.api.resource) = { + type: "apihub.googleapis.com/ApiOperation" + pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}" + plural: "apiOperations" + singular: "apiOperation" + }; + + // Identifier. The name of the operation. + // + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The name of the spec from where the operation was parsed. + // Format is + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + string spec = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Spec" } + ]; + + // Output only. Operation details. + OperationDetails details = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the operation was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the operation was last updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The list of user defined attributes associated with the API + // operation resource. The key is the attribute name. It will be of the + // format: `projects/{project}/locations/{location}/attributes/{attribute}`. + // The value is the attribute values associated with the resource. + map attributes = 6 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents a definition for example schema, request, response definitions +// contained in an API version. +// A definition is added/updated/deleted in an API version when a new spec is +// added or an existing spec is updated/deleted in a version. Currently, +// definition will be created only corresponding to OpenAPI spec as parsing is +// supported for OpenAPI spec. Also, within OpenAPI spec, only `schema` object +// is supported. +message Definition { + option (google.api.resource) = { + type: "apihub.googleapis.com/Definition" + pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}" + plural: "definitions" + singular: "definition" + }; + + // Enumeration of definition types. + enum Type { + // Definition type unspecified. + TYPE_UNSPECIFIED = 0; + + // Definition type schema. + SCHEMA = 1; + } + + oneof value { + // Output only. The value of a schema definition. + Schema schema = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Identifier. The name of the definition. + // + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The name of the spec from where the definition was parsed. + // Format is + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + string spec = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Spec" } + ]; + + // Output only. The type of the definition. + Type type = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the definition was created. + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the definition was last updated. + google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The list of user defined attributes associated with the + // definition resource. The key is the attribute name. It will be of the + // format: `projects/{project}/locations/{location}/attributes/{attribute}`. + // The value is the attribute values associated with the resource. + map attributes = 7 + [(google.api.field_behavior) = OPTIONAL]; +} + +// An attribute in the API Hub. +// An attribute is a name value pair which can be attached to different +// resources in the API hub based on the scope of the attribute. Attributes can +// either be pre-defined by the API Hub or created by users. +message Attribute { + option (google.api.resource) = { + type: "apihub.googleapis.com/Attribute" + pattern: "projects/{project}/locations/{location}/attributes/{attribute}" + plural: "attributes" + singular: "attribute" + }; + + // The value that can be assigned to the attribute when the data type is + // enum. + message AllowedValue { + // Required. The ID of the allowed value. + // * If provided, the same will be used. The service will throw an error if + // the specified id is already used by another allowed value in the same + // attribute resource. + // * If not provided, a system generated id derived from the display name + // will be used. In this case, the service will handle conflict resolution + // by adding a system generated suffix in case of duplicates. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-/. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The display name of the allowed value. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The detailed description of the allowed value. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When set to true, the allowed value cannot be updated or + // deleted by the user. It can only be true for System defined attributes. + bool immutable = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Enumeration of attribute definition types. + enum DefinitionType { + // Attribute definition type unspecified. + DEFINITION_TYPE_UNSPECIFIED = 0; + + // The attribute is predefined by the API Hub. Note that only the list of + // allowed values can be updated in this case via UpdateAttribute method. + SYSTEM_DEFINED = 1; + + // The attribute is defined by the user. + USER_DEFINED = 2; + } + + // Enumeration for the scope of the attribute representing the resource in the + // API Hub to which the attribute can be linked. + enum Scope { + // Scope Unspecified. + SCOPE_UNSPECIFIED = 0; + + // Attribute can be linked to an API. + API = 1; + + // Attribute can be linked to an API version. + VERSION = 2; + + // Attribute can be linked to a Spec. + SPEC = 3; + + // Attribute can be linked to an API Operation. + API_OPERATION = 4; + + // Attribute can be linked to a Deployment. + DEPLOYMENT = 5; + + // Attribute can be linked to a Dependency. + DEPENDENCY = 6; + + // Attribute can be linked to a definition. + DEFINITION = 7; + + // Attribute can be linked to a ExternalAPI. + EXTERNAL_API = 8; + + // Attribute can be linked to a Plugin. + PLUGIN = 9; + } + + // Enumeration of attribute's data type. + enum DataType { + // Attribute data type unspecified. + DATA_TYPE_UNSPECIFIED = 0; + + // Attribute's value is of type enum. + ENUM = 1; + + // Attribute's value is of type json. + JSON = 2; + + // Attribute's value is of type string. + STRING = 3; + } + + // Identifier. The name of the attribute in the API Hub. + // + // Format: + // `projects/{project}/locations/{location}/attributes/{attribute}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. The display name of the attribute. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The description of the attribute. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The definition type of the attribute. + DefinitionType definition_type = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The scope of the attribute. It represents the resource in the API + // Hub to which the attribute can be linked. + Scope scope = 5 [(google.api.field_behavior) = REQUIRED]; + + // Required. The type of the data of the attribute. + DataType data_type = 6 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The list of allowed values when the attribute value is of type + // enum. This is required when the data_type of the attribute is ENUM. The + // maximum number of allowed values of an attribute will be 1000. + repeated AllowedValue allowed_values = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of values that the attribute can have when + // associated with an API Hub resource. Cardinality 1 would represent a + // single-valued attribute. It must not be less than 1 or greater than 20. If + // not specified, the cardinality would be set to 1 by default and represent a + // single-valued attribute. + int32 cardinality = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. When mandatory is true, the attribute is mandatory for the + // resource specified in the scope. Only System defined attributes can be + // mandatory. + bool mandatory = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the attribute was created. + google.protobuf.Timestamp create_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the attribute was last updated. + google.protobuf.Timestamp update_time = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The spec contents. +message SpecContents { + // Required. The contents of the spec. + bytes contents = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The mime type of the content for example application/json, + // application/yaml, application/wsdl etc. + string mime_type = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// SpecDetails contains the details parsed from supported +// spec types. +message SpecDetails { + oneof details { + // Output only. Additional details apart from `OperationDetails` parsed from + // an OpenAPI spec. The OperationDetails parsed from the spec can be + // obtained by using + // [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] + // method. + OpenApiSpecDetails open_api_spec_details = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The description of the spec. + string description = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// OpenApiSpecDetails contains the details parsed from an OpenAPI spec in +// addition to the fields mentioned in +// [SpecDetails][google.cloud.apihub.v1.SpecDetails]. +message OpenApiSpecDetails { + // Enumeration of spec formats. + enum Format { + // SpecFile type unspecified. + FORMAT_UNSPECIFIED = 0; + + // OpenAPI Spec v2.0. + OPEN_API_SPEC_2_0 = 1; + + // OpenAPI Spec v3.0. + OPEN_API_SPEC_3_0 = 2; + + // OpenAPI Spec v3.1. + OPEN_API_SPEC_3_1 = 3; + } + + // Output only. The format of the spec. + Format format = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The version in the spec. + // This maps to `info.version` in OpenAPI spec. + string version = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Owner details for the spec. + // This maps to `info.contact` in OpenAPI spec. + Owner owner = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The operation details parsed from the spec. +message OperationDetails { + oneof operation { + // The HTTP Operation. + HttpOperation http_operation = 4; + } + + // Output only. Description of the operation behavior. + // For OpenAPI spec, this will map to `operation.description` in the + // spec, in case description is empty, `operation.summary` will be used. + string description = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Additional external documentation for this operation. + // For OpenAPI spec, this will map to `operation.documentation` in the spec. + Documentation documentation = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. For OpenAPI spec, this will be set if `operation.deprecated`is + // marked as `true` in the spec. + bool deprecated = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The HTTP Operation. +message HttpOperation { + // Enumeration of Method types. + enum Method { + // Method unspecified. + METHOD_UNSPECIFIED = 0; + + // Get Operation type. + GET = 1; + + // Put Operation type. + PUT = 2; + + // Post Operation type. + POST = 3; + + // Delete Operation type. + DELETE = 4; + + // Options Operation type. + OPTIONS = 5; + + // Head Operation type. + HEAD = 6; + + // Patch Operation type. + PATCH = 7; + + // Trace Operation type. + TRACE = 8; + } + + // Output only. The path details for the Operation. + Path path = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Operation method + Method method = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The path details derived from the spec. +message Path { + // Output only. Complete path relative to server endpoint. + string path = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A short description for the path applicable to all operations. + string description = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The schema details derived from the spec. Currently, this entity is supported +// for OpenAPI spec only. +// For OpenAPI spec, this maps to the schema defined in +// the `definitions` section for OpenAPI 2.0 version and in +// `components.schemas` section for OpenAPI 3.0 and 3.1 version. +message Schema { + // Output only. The display name of the schema. + // This will map to the name of the schema in the spec. + string display_name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The raw value of the schema definition corresponding to the + // schema name in the spec. + bytes raw_value = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Owner details. +message Owner { + // Optional. The name of the owner. + string display_name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The email of the owner. + string email = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Documentation details. +message Documentation { + // Optional. The uri of the externally hosted documentation. + string external_uri = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// The attribute values associated with resource. +message AttributeValues { + // The attribute values of data type enum. + message EnumAttributeValues { + // Required. The attribute values in case attribute data type is enum. + repeated Attribute.AllowedValue values = 1 + [(google.api.field_behavior) = REQUIRED]; + } + + // The attribute values of data type string or JSON. + message StringAttributeValues { + // Required. The attribute values in case attribute data type is string or + // JSON. + repeated string values = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // The attribute values associated with the resource. + oneof Value { + // The attribute values associated with a resource in case attribute data + // type is enum. + EnumAttributeValues enum_values = 2; + + // The attribute values associated with a resource in case attribute data + // type is string. + StringAttributeValues string_values = 3; + + // The attribute values associated with a resource in case attribute data + // type is JSON. + StringAttributeValues json_values = 4; + } + + // Output only. The name of the attribute. + // Format: projects/{project}/locations/{location}/attributes/{attribute} + string attribute = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Attribute" + } + ]; +} + +// A dependency resource defined in the API hub describes a dependency directed +// from a consumer to a supplier entity. A dependency can be defined between two +// [Operations][google.cloud.apihub.v1.Operation] or between +// an [Operation][google.cloud.apihub.v1.Operation] and [External +// API][google.cloud.apihub.v1.ExternalApi]. +message Dependency { + option (google.api.resource) = { + type: "apihub.googleapis.com/Dependency" + pattern: "projects/{project}/locations/{location}/dependencies/{dependency}" + plural: "dependencies" + singular: "dependency" + }; + + // Possible states for a dependency. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // Dependency will be in a proposed state when it is newly identified by the + // API hub on its own. + PROPOSED = 1; + + // Dependency will be in a validated state when it is validated by the + // admin or manually created in the API hub. + VALIDATED = 2; + } + + // Possible modes of discovering the dependency. + enum DiscoveryMode { + // Default value. This value is unused. + DISCOVERY_MODE_UNSPECIFIED = 0; + + // Manual mode of discovery when the dependency is defined by the user. + MANUAL = 1; + } + + // Identifier. The name of the dependency in the API Hub. + // + // Format: `projects/{project}/locations/{location}/dependencies/{dependency}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Immutable. The entity acting as the consumer in the dependency. + DependencyEntityReference consumer = 2 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED + ]; + + // Required. Immutable. The entity acting as the supplier in the dependency. + DependencyEntityReference supplier = 3 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED + ]; + + // Output only. State of the dependency. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Human readable description corresponding of the dependency. + string description = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Discovery mode of the dependency. + DiscoveryMode discovery_mode = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Error details of a dependency if the system has detected it + // internally. + DependencyErrorDetail error_detail = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the dependency was created. + google.protobuf.Timestamp create_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the dependency was last updated. + google.protobuf.Timestamp update_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The list of user defined attributes associated with the + // dependency resource. The key is the attribute name. It will be of the + // format: `projects/{project}/locations/{location}/attributes/{attribute}`. + // The value is the attribute values associated with the resource. + map attributes = 10 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Reference to an entity participating in a dependency. +message DependencyEntityReference { + // Required. Unique identifier for the participating entity. + oneof identifier { + // The resource name of an operation in the API Hub. + // + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` + string operation_resource_name = 2; + + // The resource name of an external API in the API Hub. + // + // Format: + // `projects/{project}/locations/{location}/externalApis/{external_api}` + string external_api_resource_name = 3; + } + + // Output only. Display name of the entity. + string display_name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Details describing error condition of a dependency. +message DependencyErrorDetail { + // Possible values representing an error in the dependency. + enum Error { + // Default value used for no error in the dependency. + ERROR_UNSPECIFIED = 0; + + // Supplier entity has been deleted. + SUPPLIER_NOT_FOUND = 1; + + // Supplier entity has been recreated. + SUPPLIER_RECREATED = 2; + } + + // Optional. Error in the dependency. + Error error = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Timestamp at which the error was found. + google.protobuf.Timestamp error_time = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// LintResponse contains the response from the linter. +message LintResponse { + // Count of issues with a given severity. + message SummaryEntry { + // Required. Severity of the issue. + Severity severity = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Count of issues with the given severity. + int32 count = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Optional. Array of issues found in the analyzed document. + repeated Issue issues = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Summary of all issue types and counts for each severity level. + repeated SummaryEntry summary = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Lint state represents success or failure for linting. + LintState state = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Name of the linting application. + string source = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. Name of the linter used. + Linter linter = 5 [(google.api.field_behavior) = REQUIRED]; + + // Required. Timestamp when the linting response was generated. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = REQUIRED]; +} + +// Issue contains the details of a single issue found by the linter. +message Issue { + // Required. Rule code unique to each rule defined in linter. + string code = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. An array of strings indicating the location in the analyzed + // document where the rule was triggered. + repeated string path = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Human-readable message describing the issue found by the linter. + string message = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Severity level of the rule violation. + Severity severity = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. Object describing where in the file the issue was found. + Range range = 5 [(google.api.field_behavior) = REQUIRED]; +} + +// Object describing where in the file the issue was found. +message Range { + // Required. Start of the issue. + Point start = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. End of the issue. + Point end = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Point within the file (line and character). +message Point { + // Required. Line number (zero-indexed). + int32 line = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Character position within the line (zero-indexed). + int32 character = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have been cancelled successfully + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// An ApiHubInstance represents the instance resources of the API Hub. +// Currently, only one ApiHub instance is allowed for each project. +message ApiHubInstance { + option (google.api.resource) = { + type: "apihub.googleapis.com/ApiHubInstance" + pattern: "projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}" + plural: "apiHubInstances" + singular: "apiHubInstance" + }; + + // Available configurations to provision an ApiHub Instance. + message Config { + // Required. The Customer Managed Encryption Key (CMEK) used for data + // encryption. The CMEK name should follow the format of + // `projects/([^/]+)/locations/([^/]+)/keyRings/([^/]+)/cryptoKeys/([^/]+)`, + // where the location must match the instance location. + string cmek_key_name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // State of the ApiHub Instance. + enum State { + // The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0; + + // The ApiHub instance has not been initialized or has been deleted. + INACTIVE = 1; + + // The ApiHub instance is being created. + CREATING = 2; + + // The ApiHub instance has been created and is ready for use. + ACTIVE = 3; + + // The ApiHub instance is being updated. + UPDATING = 4; + + // The ApiHub instance is being deleted. + DELETING = 5; + + // The ApiHub instance encountered an error during a state change. + FAILED = 6; + } + + // Identifier. Format: + // `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. Creation timestamp. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last update timestamp. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the ApiHub instance. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Extra information about ApiHub instance state. Currently the + // message would be populated when state is `FAILED`. + string state_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Config of the ApiHub instance. + Config config = 6 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Instance labels to represent user-provided metadata. + // Refer to cloud documentation on labels for more details. + // https://cloud.google.com/compute/docs/labeling-resources + map labels = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Description of the ApiHub instance. + string description = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// An external API represents an API being provided by external sources. This +// can be used to model third-party APIs and can be used to define dependencies. +message ExternalApi { + option (google.api.resource) = { + type: "apihub.googleapis.com/ExternalApi" + pattern: "projects/{project}/locations/{location}/externalApis/{external_api}" + plural: "externalApis" + singular: "externalApi" + }; + + // Identifier. Format: + // `projects/{project}/locations/{location}/externalApi/{externalApi}`. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Display name of the external API. Max length is 63 characters + // (Unicode Code Points). + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Description of the external API. Max length is 2000 characters + // (Unicode Code Points). + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of endpoints on which this API is accessible. + repeated string endpoints = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of paths served by this API. + repeated string paths = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Documentation of the external API. + Documentation documentation = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of user defined attributes associated with the Version + // resource. The key is the attribute name. It will be of the format: + // `projects/{project}/locations/{location}/attributes/{attribute}`. + // The value is the attribute values associated with the resource. + map attributes = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Creation timestamp. + google.protobuf.Timestamp create_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last update timestamp. + google.protobuf.Timestamp update_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/proto/google/cloud/apihub/v1/host_project_registration_service.proto b/java-apihub/proto-google-cloud-apihub-v1/src/main/proto/google/cloud/apihub/v1/host_project_registration_service.proto new file mode 100644 index 000000000000..2f9f370c870e --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/proto/google/cloud/apihub/v1/host_project_registration_service.proto @@ -0,0 +1,207 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.apihub.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ApiHub.V1"; +option go_package = "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb"; +option java_multiple_files = true; +option java_outer_classname = "HostProjectRegistrationServiceProto"; +option java_package = "com.google.cloud.apihub.v1"; +option php_namespace = "Google\\Cloud\\ApiHub\\V1"; +option ruby_package = "Google::Cloud::ApiHub::V1"; + +// This service is used for managing the host project registrations. +service HostProjectRegistrationService { + option (google.api.default_host) = "apihub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Create a host project registration. + // A Google cloud project can be registered as a host project if it is not + // attached as a runtime project to another host project. + // A project can be registered as a host project only once. Subsequent + // register calls for the same project will fail. + rpc CreateHostProjectRegistration(CreateHostProjectRegistrationRequest) + returns (HostProjectRegistration) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/hostProjectRegistrations" + body: "host_project_registration" + }; + option (google.api.method_signature) = + "parent,host_project_registration,host_project_registration_id"; + } + + // Get a host project registration. + rpc GetHostProjectRegistration(GetHostProjectRegistrationRequest) + returns (HostProjectRegistration) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/hostProjectRegistrations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists host project registrations. + rpc ListHostProjectRegistrations(ListHostProjectRegistrationsRequest) + returns (ListHostProjectRegistrationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/hostProjectRegistrations" + }; + option (google.api.method_signature) = "parent"; + } +} + +// The +// [CreateHostProjectRegistration][google.cloud.apihub.v1.HostProjectRegistrationService.CreateHostProjectRegistration] +// method's request. +message CreateHostProjectRegistrationRequest { + // Required. The parent resource for the host project. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/HostProjectRegistration" + } + ]; + + // Required. The ID to use for the Host Project Registration, which will + // become the final component of the host project registration's resource + // name. The ID must be the same as the Google cloud project specified in the + // host_project_registration.gcp_project field. + string host_project_registration_id = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The host project registration to register. + HostProjectRegistration host_project_registration = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// The +// [GetHostProjectRegistration][google.cloud.apihub.v1.HostProjectRegistrationService.GetHostProjectRegistration] +// method's request. +message GetHostProjectRegistrationRequest { + // Required. Host project registration resource name. + // projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/HostProjectRegistration" + } + ]; +} + +// The +// [ListHostProjectRegistrations][google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations] +// method's request. +message ListHostProjectRegistrationsRequest { + // Required. The parent, which owns this collection of host projects. + // Format: `projects/*/locations/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/HostProjectRegistration" + } + ]; + + // Optional. The maximum number of host project registrations to return. The + // service may return fewer than this value. If unspecified, at most 50 host + // project registrations will be returned. The maximum value is 1000; values + // above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous + // `ListHostProjectRegistrations` call. Provide this to retrieve the + // subsequent page. + // + // When paginating, all other parameters (except page_size) provided to + // `ListHostProjectRegistrations` must match the call that provided the page + // token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An expression that filters the list of HostProjectRegistrations. + // + // A filter expression consists of a field name, a comparison + // operator, and a value for filtering. The value must be a string. All + // standard operators as documented at https://google.aip.dev/160 are + // supported. + // + // The following fields in the `HostProjectRegistration` are eligible for + // filtering: + // + // * `name` - The name of the HostProjectRegistration. + // * `create_time` - The time at which the HostProjectRegistration was + // created. The value should be in the + // (RFC3339)[https://tools.ietf.org/html/rfc3339] format. + // * `gcp_project` - The Google cloud project associated with the + // HostProjectRegistration. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The +// [ListHostProjectRegistrations][google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations] +// method's response. +message ListHostProjectRegistrationsResponse { + // The list of host project registrations. + repeated HostProjectRegistration host_project_registrations = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Host project registration refers to the registration of a Google cloud +// project with Api Hub as a host project. This is the project where Api Hub is +// provisioned. It acts as the consumer project for the Api Hub instance +// provisioned. Multiple runtime projects can be attached to the host project +// and these attachments define the scope of Api Hub. +message HostProjectRegistration { + option (google.api.resource) = { + type: "apihub.googleapis.com/HostProjectRegistration" + pattern: "projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}" + plural: "hostProjectRegistrations" + singular: "hostProjectRegistration" + }; + + // Identifier. The name of the host project registration. + // Format: + // "projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}". + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Immutable. Google cloud project name in the format: + // "projects/abc" or "projects/123". As input, project name with either + // project id or number are accepted. As output, this field will contain + // project number. + string gcp_project = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Output only. The time at which the host project registration was created. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/proto/google/cloud/apihub/v1/linting_service.proto b/java-apihub/proto-google-cloud-apihub-v1/src/main/proto/google/cloud/apihub/v1/linting_service.proto new file mode 100644 index 000000000000..9001c551a407 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/proto/google/cloud/apihub/v1/linting_service.proto @@ -0,0 +1,159 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.apihub.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/apihub/v1/common_fields.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.ApiHub.V1"; +option go_package = "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb"; +option java_multiple_files = true; +option java_outer_classname = "LintingServiceProto"; +option java_package = "com.google.cloud.apihub.v1"; +option php_namespace = "Google\\Cloud\\ApiHub\\V1"; +option ruby_package = "Google::Cloud::ApiHub::V1"; + +// This service provides all methods related to the 1p Linter. +service LintingService { + option (google.api.default_host) = "apihub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Get the style guide being used for linting. + rpc GetStyleGuide(GetStyleGuideRequest) returns (StyleGuide) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/plugins/*/styleGuide}" + }; + option (google.api.method_signature) = "name"; + } + + // Update the styleGuide to be used for liniting in by API hub. + rpc UpdateStyleGuide(UpdateStyleGuideRequest) returns (StyleGuide) { + option (google.api.http) = { + patch: "/v1/{style_guide.name=projects/*/locations/*/plugins/*/styleGuide}" + body: "style_guide" + }; + option (google.api.method_signature) = "style_guide,update_mask"; + } + + // Get the contents of the style guide. + rpc GetStyleGuideContents(GetStyleGuideContentsRequest) + returns (StyleGuideContents) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/plugins/*/styleGuide}:contents" + }; + option (google.api.method_signature) = "name"; + } + + // Lints the requested spec and updates the corresponding API Spec with the + // lint response. This lint response will be available in all subsequent + // Get and List Spec calls to Core service. + rpc LintSpec(LintSpecRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:lint" + body: "*" + }; + } +} + +// The [GetStyleGuide][ApiHub.GetStyleGuide] method's request. +message GetStyleGuideRequest { + // Required. The name of the spec to retrieve. + // Format: + // `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/StyleGuide" + } + ]; +} + +// The [UpdateStyleGuide][ApiHub.UpdateStyleGuide] method's request. +message UpdateStyleGuideRequest { + // Required. The Style guide resource to update. + StyleGuide style_guide = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The [GetStyleGuideContents][ApiHub.GetStyleGuideContents] method's request. +message GetStyleGuideContentsRequest { + // Required. The name of the StyleGuide whose contents need to be retrieved. + // There is exactly one style guide resource per project per location. + // The expected format is + // `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/StyleGuide" + } + ]; +} + +// The [LintSpec][ApiHub.LintSpec] method's request. +message LintSpecRequest { + // Required. The name of the spec to be linted. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Spec" } + ]; +} + +// The style guide contents. +message StyleGuideContents { + // Required. The contents of the style guide. + bytes contents = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The mime type of the content. + string mime_type = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Represents a singleton style guide resource to be used for linting Open API +// specs. +message StyleGuide { + option (google.api.resource) = { + type: "apihub.googleapis.com/StyleGuide" + pattern: "projects/{project}/locations/{location}/plugins/{plugin}/styleGuide" + plural: "styleGuides" + singular: "styleGuide" + }; + + // Identifier. The name of the style guide. + // + // Format: + // `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Target linter for the style guide. + Linter linter = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Input only. The contents of the uploaded style guide. + StyleGuideContents contents = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY + ]; +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/proto/google/cloud/apihub/v1/plugin_service.proto b/java-apihub/proto-google-cloud-apihub-v1/src/main/proto/google/cloud/apihub/v1/plugin_service.proto new file mode 100644 index 000000000000..233c0669af00 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/proto/google/cloud/apihub/v1/plugin_service.proto @@ -0,0 +1,148 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.apihub.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/apihub/v1/common_fields.proto"; + +option csharp_namespace = "Google.Cloud.ApiHub.V1"; +option go_package = "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb"; +option java_multiple_files = true; +option java_outer_classname = "PluginServiceProto"; +option java_package = "com.google.cloud.apihub.v1"; +option php_namespace = "Google\\Cloud\\ApiHub\\V1"; +option ruby_package = "Google::Cloud::ApiHub::V1"; + +// This service is used for managing plugins inside the API Hub. +service ApiHubPlugin { + option (google.api.default_host) = "apihub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Get details about an API Hub plugin. + rpc GetPlugin(GetPluginRequest) returns (Plugin) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/plugins/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Enables a plugin. + // The `state` of the plugin after enabling is `ENABLED` + rpc EnablePlugin(EnablePluginRequest) returns (Plugin) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/plugins/*}:enable" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Disables a plugin. + // The `state` of the plugin after disabling is `DISABLED` + rpc DisablePlugin(DisablePluginRequest) returns (Plugin) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/plugins/*}:disable" + body: "*" + }; + option (google.api.method_signature) = "name"; + } +} + +// A plugin resource in the API Hub. +message Plugin { + option (google.api.resource) = { + type: "apihub.googleapis.com/Plugin" + pattern: "projects/{project}/locations/{location}/plugins/{plugin}" + plural: "plugins" + singular: "plugin" + }; + + // Possible states a plugin can have. Note that this enum may receive new + // values in the future. Consumers are advised to always code against the + // enum values expecting new states can be added later on. + enum State { + // The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0; + + // The plugin is enabled. + ENABLED = 1; + + // The plugin is disabled. + DISABLED = 2; + } + + // Identifier. The name of the plugin. + // Format: `projects/{project}/locations/{location}/plugins/{plugin}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. The display name of the plugin. Max length is 50 characters + // (Unicode code points). + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The type of the API. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-plugin-type` + // attribute. + // The number of allowed values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues type = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The plugin description. Max length is 2000 characters (Unicode + // code points). + string description = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Represents the state of the plugin. + State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The [GetPlugin][google.cloud.apihub.v1.ApiHubPlugin.GetPlugin] method's +// request. +message GetPluginRequest { + // Required. The name of the plugin to retrieve. + // Format: `projects/{project}/locations/{location}/plugins/{plugin}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Plugin" } + ]; +} + +// The [EnablePlugin][google.cloud.apihub.v1.ApiHubPlugin.EnablePlugin] method's +// request. +message EnablePluginRequest { + // Required. The name of the plugin to enable. + // Format: `projects/{project}/locations/{location}/plugins/{plugin}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Plugin" } + ]; +} + +// The [DisablePlugin][google.cloud.apihub.v1.ApiHubPlugin.DisablePlugin] +// method's request. +message DisablePluginRequest { + // Required. The name of the plugin to disable. + // Format: `projects/{project}/locations/{location}/plugins/{plugin}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Plugin" } + ]; +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/proto/google/cloud/apihub/v1/provisioning_service.proto b/java-apihub/proto-google-cloud-apihub-v1/src/main/proto/google/cloud/apihub/v1/provisioning_service.proto new file mode 100644 index 000000000000..2bf39fab7793 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/proto/google/cloud/apihub/v1/provisioning_service.proto @@ -0,0 +1,136 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.apihub.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/apihub/v1/common_fields.proto"; +import "google/longrunning/operations.proto"; + +option csharp_namespace = "Google.Cloud.ApiHub.V1"; +option go_package = "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb"; +option java_multiple_files = true; +option java_outer_classname = "ProvisioningServiceProto"; +option java_package = "com.google.cloud.apihub.v1"; +option php_namespace = "Google\\Cloud\\ApiHub\\V1"; +option ruby_package = "Google::Cloud::ApiHub::V1"; + +// This service is used for managing the data plane provisioning of the API hub. +service Provisioning { + option (google.api.default_host) = "apihub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Provisions instance resources for the API Hub. + rpc CreateApiHubInstance(CreateApiHubInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/apiHubInstances" + body: "api_hub_instance" + }; + option (google.api.method_signature) = + "parent,api_hub_instance,api_hub_instance_id"; + option (google.longrunning.operation_info) = { + response_type: "ApiHubInstance" + metadata_type: "OperationMetadata" + }; + } + + // Gets details of a single API Hub instance. + rpc GetApiHubInstance(GetApiHubInstanceRequest) returns (ApiHubInstance) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apiHubInstances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Looks up an Api Hub instance in a given GCP project. There will always be + // only one Api Hub instance for a GCP project across all locations. + rpc LookupApiHubInstance(LookupApiHubInstanceRequest) + returns (LookupApiHubInstanceResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/apiHubInstances:lookup" + }; + option (google.api.method_signature) = "parent"; + } +} + +// The +// [CreateApiHubInstance][google.cloud.apihub.v1.Provisioning.CreateApiHubInstance] +// method's request. +message CreateApiHubInstanceRequest { + // Required. The parent resource for the Api Hub instance resource. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. Identifier to assign to the Api Hub instance. Must be unique + // within scope of the parent resource. If the field is not provided, system + // generated id will be used. + // + // This value should be 4-40 characters, and valid characters + // are `/[a-z][A-Z][0-9]-_/`. + string api_hub_instance_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The ApiHub instance. + ApiHubInstance api_hub_instance = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The +// [GetApiHubInstance][google.cloud.apihub.v1.Provisioning.GetApiHubInstance] +// method's request. +message GetApiHubInstanceRequest { + // Required. The name of the Api Hub instance to retrieve. + // Format: + // `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/ApiHubInstance" + } + ]; +} + +// The +// [LookupApiHubInstance][google.cloud.apihub.v1.Provisioning.LookupApiHubInstance] +// method's request. +message LookupApiHubInstanceRequest { + // Required. There will always be only one Api Hub instance for a GCP project + // across all locations. + // The parent resource for the Api Hub instance resource. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/ApiHubInstance" + } + ]; +} + +// The +// [LookupApiHubInstance][google.cloud.apihub.v1.Provisioning.LookupApiHubInstance] +// method's response.` +message LookupApiHubInstanceResponse { + // API Hub instance for a project if it exists, empty otherwise. + ApiHubInstance api_hub_instance = 1; +} diff --git a/java-apihub/proto-google-cloud-apihub-v1/src/main/proto/google/cloud/apihub/v1/runtime_project_attachment_service.proto b/java-apihub/proto-google-cloud-apihub-v1/src/main/proto/google/cloud/apihub/v1/runtime_project_attachment_service.proto new file mode 100644 index 000000000000..71c361c028a8 --- /dev/null +++ b/java-apihub/proto-google-cloud-apihub-v1/src/main/proto/google/cloud/apihub/v1/runtime_project_attachment_service.proto @@ -0,0 +1,261 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.apihub.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ApiHub.V1"; +option go_package = "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb"; +option java_multiple_files = true; +option java_outer_classname = "RuntimeProjectAttachmentServiceProto"; +option java_package = "com.google.cloud.apihub.v1"; +option php_namespace = "Google\\Cloud\\ApiHub\\V1"; +option ruby_package = "Google::Cloud::ApiHub::V1"; + +// This service is used for managing the runtime project attachments. +service RuntimeProjectAttachmentService { + option (google.api.default_host) = "apihub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Attaches a runtime project to the host project. + rpc CreateRuntimeProjectAttachment(CreateRuntimeProjectAttachmentRequest) + returns (RuntimeProjectAttachment) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/runtimeProjectAttachments" + body: "runtime_project_attachment" + }; + option (google.api.method_signature) = + "parent,runtime_project_attachment,runtime_project_attachment_id"; + } + + // Gets a runtime project attachment. + rpc GetRuntimeProjectAttachment(GetRuntimeProjectAttachmentRequest) + returns (RuntimeProjectAttachment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/runtimeProjectAttachments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List runtime projects attached to the host project. + rpc ListRuntimeProjectAttachments(ListRuntimeProjectAttachmentsRequest) + returns (ListRuntimeProjectAttachmentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/runtimeProjectAttachments" + }; + option (google.api.method_signature) = "parent"; + } + + // Delete a runtime project attachment in the API Hub. This call will detach + // the runtime project from the host project. + rpc DeleteRuntimeProjectAttachment(DeleteRuntimeProjectAttachmentRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/runtimeProjectAttachments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Look up a runtime project attachment. This API can be called in the context + // of any project. + rpc LookupRuntimeProjectAttachment(LookupRuntimeProjectAttachmentRequest) + returns (LookupRuntimeProjectAttachmentResponse) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*}:lookupRuntimeProjectAttachment" + }; + option (google.api.method_signature) = "name"; + } +} + +// The +// [CreateRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.CreateRuntimeProjectAttachment] +// method's request. +message CreateRuntimeProjectAttachmentRequest { + // Required. The parent resource for the Runtime Project Attachment. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/RuntimeProjectAttachment" + } + ]; + + // Required. The ID to use for the Runtime Project Attachment, which will + // become the final component of the Runtime Project Attachment's name. The ID + // must be the same as the project ID of the Google cloud project specified in + // the runtime_project_attachment.runtime_project field. + string runtime_project_attachment_id = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The Runtime Project Attachment to create. + RuntimeProjectAttachment runtime_project_attachment = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// The +// [GetRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.GetRuntimeProjectAttachment] +// method's request. +message GetRuntimeProjectAttachmentRequest { + // Required. The name of the API resource to retrieve. + // Format: + // `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/RuntimeProjectAttachment" + } + ]; +} + +// The +// [ListRuntimeProjectAttachments][google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments] +// method's request. +message ListRuntimeProjectAttachmentsRequest { + // Required. The parent, which owns this collection of runtime project + // attachments. Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/RuntimeProjectAttachment" + } + ]; + + // Optional. The maximum number of runtime project attachments to return. The + // service may return fewer than this value. If unspecified, at most 50 + // runtime project attachments will be returned. The maximum value is 1000; + // values above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous + // `ListRuntimeProjectAttachments` call. Provide this to retrieve the + // subsequent page. + // + // When paginating, all other parameters (except page_size) provided to + // `ListRuntimeProjectAttachments` must match the call that provided the page + // token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An expression that filters the list of RuntimeProjectAttachments. + // + // A filter expression consists of a field name, a comparison + // operator, and a value for filtering. The value must be a string. All + // standard operators as documented at https://google.aip.dev/160 are + // supported. + // + // The following fields in the `RuntimeProjectAttachment` are eligible for + // filtering: + // + // * `name` - The name of the RuntimeProjectAttachment. + // * `create_time` - The time at which the RuntimeProjectAttachment was + // created. The value should be in the + // (RFC3339)[https://tools.ietf.org/html/rfc3339] format. + // * `runtime_project` - The Google cloud project associated with the + // RuntimeProjectAttachment. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The +// [ListRuntimeProjectAttachments][google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments] +// method's response. +message ListRuntimeProjectAttachmentsResponse { + // List of runtime project attachments. + repeated RuntimeProjectAttachment runtime_project_attachments = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The +// [DeleteRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.DeleteRuntimeProjectAttachment] +// method's request. +message DeleteRuntimeProjectAttachmentRequest { + // Required. The name of the Runtime Project Attachment to delete. + // Format: + // `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/RuntimeProjectAttachment" + } + ]; +} + +// The +// [LookupRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.LookupRuntimeProjectAttachment] +// method's request. +message LookupRuntimeProjectAttachmentRequest { + // Required. Runtime project ID to look up runtime project attachment for. + // Lookup happens across all regions. Expected format: + // `projects/{project}/locations/{location}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; +} + +// The +// [ListRuntimeProjectAttachments][google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments] +// method's response. +message LookupRuntimeProjectAttachmentResponse { + // Runtime project attachment for a project if exists, empty otherwise. + RuntimeProjectAttachment runtime_project_attachment = 1; +} + +// Runtime project attachment represents an attachment from the runtime project +// to the host project. Api Hub looks for deployments in the attached runtime +// projects and creates corresponding resources in Api Hub for the discovered +// deployments. +message RuntimeProjectAttachment { + option (google.api.resource) = { + type: "apihub.googleapis.com/RuntimeProjectAttachment" + pattern: "projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}" + plural: "runtimeProjectAttachments" + singular: "runtimeProjectAttachment" + }; + + // Identifier. The resource name of a runtime project attachment. Format: + // "projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}". + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Immutable. Google cloud project name in the format: + // "projects/abc" or "projects/123". As input, project name with either + // project id or number are accepted. As output, this field will contain + // project number. + string runtime_project = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Output only. Create time. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/create/SyncCreateSetCredentialsProvider.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..c5a0e0b9c3e6 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiHubSettings; +import com.google.cloud.apihub.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ApiHubSettings apiHubSettings = + ApiHubSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + ApiHubClient apiHubClient = ApiHubClient.create(apiHubSettings); + } +} +// [END apihub_v1_generated_ApiHub_Create_SetCredentialsProvider_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/create/SyncCreateSetCredentialsProvider1.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..27a5cfbe31e5 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,39 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_Create_SetCredentialsProvider1_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiHubSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ApiHubSettings apiHubSettings = ApiHubSettings.newHttpJsonBuilder().build(); + ApiHubClient apiHubClient = ApiHubClient.create(apiHubSettings); + } +} +// [END apihub_v1_generated_ApiHub_Create_SetCredentialsProvider1_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/create/SyncCreateSetEndpoint.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..3e7f7ff3b16f --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/create/SyncCreateSetEndpoint.java @@ -0,0 +1,40 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_Create_SetEndpoint_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiHubSettings; +import com.google.cloud.apihub.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ApiHubSettings apiHubSettings = ApiHubSettings.newBuilder().setEndpoint(myEndpoint).build(); + ApiHubClient apiHubClient = ApiHubClient.create(apiHubSettings); + } +} +// [END apihub_v1_generated_ApiHub_Create_SetEndpoint_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createapi/AsyncCreateApi.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createapi/AsyncCreateApi.java new file mode 100644 index 000000000000..a34917158f30 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createapi/AsyncCreateApi.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_CreateApi_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.Api; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.CreateApiRequest; +import com.google.cloud.apihub.v1.LocationName; + +public class AsyncCreateApi { + + public static void main(String[] args) throws Exception { + asyncCreateApi(); + } + + public static void asyncCreateApi() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + CreateApiRequest request = + CreateApiRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setApiId("apiId93021397") + .setApi(Api.newBuilder().build()) + .build(); + ApiFuture future = apiHubClient.createApiCallable().futureCall(request); + // Do something. + Api response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHub_CreateApi_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createapi/SyncCreateApi.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createapi/SyncCreateApi.java new file mode 100644 index 000000000000..f00556f4e618 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createapi/SyncCreateApi.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_CreateApi_sync] +import com.google.cloud.apihub.v1.Api; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.CreateApiRequest; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncCreateApi { + + public static void main(String[] args) throws Exception { + syncCreateApi(); + } + + public static void syncCreateApi() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + CreateApiRequest request = + CreateApiRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setApiId("apiId93021397") + .setApi(Api.newBuilder().build()) + .build(); + Api response = apiHubClient.createApi(request); + } + } +} +// [END apihub_v1_generated_ApiHub_CreateApi_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createapi/SyncCreateApiLocationnameApiString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createapi/SyncCreateApiLocationnameApiString.java new file mode 100644 index 000000000000..82f93e857d76 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createapi/SyncCreateApiLocationnameApiString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_CreateApi_LocationnameApiString_sync] +import com.google.cloud.apihub.v1.Api; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncCreateApiLocationnameApiString { + + public static void main(String[] args) throws Exception { + syncCreateApiLocationnameApiString(); + } + + public static void syncCreateApiLocationnameApiString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Api api = Api.newBuilder().build(); + String apiId = "apiId93021397"; + Api response = apiHubClient.createApi(parent, api, apiId); + } + } +} +// [END apihub_v1_generated_ApiHub_CreateApi_LocationnameApiString_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createapi/SyncCreateApiStringApiString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createapi/SyncCreateApiStringApiString.java new file mode 100644 index 000000000000..ca57f2e4e156 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createapi/SyncCreateApiStringApiString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_CreateApi_StringApiString_sync] +import com.google.cloud.apihub.v1.Api; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncCreateApiStringApiString { + + public static void main(String[] args) throws Exception { + syncCreateApiStringApiString(); + } + + public static void syncCreateApiStringApiString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + Api api = Api.newBuilder().build(); + String apiId = "apiId93021397"; + Api response = apiHubClient.createApi(parent, api, apiId); + } + } +} +// [END apihub_v1_generated_ApiHub_CreateApi_StringApiString_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createattribute/AsyncCreateAttribute.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createattribute/AsyncCreateAttribute.java new file mode 100644 index 000000000000..f157857b97ea --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createattribute/AsyncCreateAttribute.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_CreateAttribute_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Attribute; +import com.google.cloud.apihub.v1.CreateAttributeRequest; +import com.google.cloud.apihub.v1.LocationName; + +public class AsyncCreateAttribute { + + public static void main(String[] args) throws Exception { + asyncCreateAttribute(); + } + + public static void asyncCreateAttribute() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + CreateAttributeRequest request = + CreateAttributeRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setAttributeId("attributeId-309887785") + .setAttribute(Attribute.newBuilder().build()) + .build(); + ApiFuture future = apiHubClient.createAttributeCallable().futureCall(request); + // Do something. + Attribute response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHub_CreateAttribute_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createattribute/SyncCreateAttribute.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createattribute/SyncCreateAttribute.java new file mode 100644 index 000000000000..233c00059698 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createattribute/SyncCreateAttribute.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_CreateAttribute_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Attribute; +import com.google.cloud.apihub.v1.CreateAttributeRequest; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncCreateAttribute { + + public static void main(String[] args) throws Exception { + syncCreateAttribute(); + } + + public static void syncCreateAttribute() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + CreateAttributeRequest request = + CreateAttributeRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setAttributeId("attributeId-309887785") + .setAttribute(Attribute.newBuilder().build()) + .build(); + Attribute response = apiHubClient.createAttribute(request); + } + } +} +// [END apihub_v1_generated_ApiHub_CreateAttribute_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createattribute/SyncCreateAttributeLocationnameAttributeString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createattribute/SyncCreateAttributeLocationnameAttributeString.java new file mode 100644 index 000000000000..5b70f0d68be7 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createattribute/SyncCreateAttributeLocationnameAttributeString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_CreateAttribute_LocationnameAttributeString_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Attribute; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncCreateAttributeLocationnameAttributeString { + + public static void main(String[] args) throws Exception { + syncCreateAttributeLocationnameAttributeString(); + } + + public static void syncCreateAttributeLocationnameAttributeString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Attribute attribute = Attribute.newBuilder().build(); + String attributeId = "attributeId-309887785"; + Attribute response = apiHubClient.createAttribute(parent, attribute, attributeId); + } + } +} +// [END apihub_v1_generated_ApiHub_CreateAttribute_LocationnameAttributeString_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createattribute/SyncCreateAttributeStringAttributeString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createattribute/SyncCreateAttributeStringAttributeString.java new file mode 100644 index 000000000000..a88b478fd9c6 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createattribute/SyncCreateAttributeStringAttributeString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_CreateAttribute_StringAttributeString_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Attribute; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncCreateAttributeStringAttributeString { + + public static void main(String[] args) throws Exception { + syncCreateAttributeStringAttributeString(); + } + + public static void syncCreateAttributeStringAttributeString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + Attribute attribute = Attribute.newBuilder().build(); + String attributeId = "attributeId-309887785"; + Attribute response = apiHubClient.createAttribute(parent, attribute, attributeId); + } + } +} +// [END apihub_v1_generated_ApiHub_CreateAttribute_StringAttributeString_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createdeployment/AsyncCreateDeployment.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createdeployment/AsyncCreateDeployment.java new file mode 100644 index 000000000000..bd894c9ffd51 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createdeployment/AsyncCreateDeployment.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_CreateDeployment_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.CreateDeploymentRequest; +import com.google.cloud.apihub.v1.Deployment; +import com.google.cloud.apihub.v1.LocationName; + +public class AsyncCreateDeployment { + + public static void main(String[] args) throws Exception { + asyncCreateDeployment(); + } + + public static void asyncCreateDeployment() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + CreateDeploymentRequest request = + CreateDeploymentRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setDeploymentId("deploymentId-136894784") + .setDeployment(Deployment.newBuilder().build()) + .build(); + ApiFuture future = apiHubClient.createDeploymentCallable().futureCall(request); + // Do something. + Deployment response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHub_CreateDeployment_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createdeployment/SyncCreateDeployment.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createdeployment/SyncCreateDeployment.java new file mode 100644 index 000000000000..54f53021d981 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createdeployment/SyncCreateDeployment.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_CreateDeployment_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.CreateDeploymentRequest; +import com.google.cloud.apihub.v1.Deployment; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncCreateDeployment { + + public static void main(String[] args) throws Exception { + syncCreateDeployment(); + } + + public static void syncCreateDeployment() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + CreateDeploymentRequest request = + CreateDeploymentRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setDeploymentId("deploymentId-136894784") + .setDeployment(Deployment.newBuilder().build()) + .build(); + Deployment response = apiHubClient.createDeployment(request); + } + } +} +// [END apihub_v1_generated_ApiHub_CreateDeployment_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createdeployment/SyncCreateDeploymentLocationnameDeploymentString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createdeployment/SyncCreateDeploymentLocationnameDeploymentString.java new file mode 100644 index 000000000000..144d0f92f93e --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createdeployment/SyncCreateDeploymentLocationnameDeploymentString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_CreateDeployment_LocationnameDeploymentString_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Deployment; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncCreateDeploymentLocationnameDeploymentString { + + public static void main(String[] args) throws Exception { + syncCreateDeploymentLocationnameDeploymentString(); + } + + public static void syncCreateDeploymentLocationnameDeploymentString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Deployment deployment = Deployment.newBuilder().build(); + String deploymentId = "deploymentId-136894784"; + Deployment response = apiHubClient.createDeployment(parent, deployment, deploymentId); + } + } +} +// [END apihub_v1_generated_ApiHub_CreateDeployment_LocationnameDeploymentString_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createdeployment/SyncCreateDeploymentStringDeploymentString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createdeployment/SyncCreateDeploymentStringDeploymentString.java new file mode 100644 index 000000000000..4e6deace9eb9 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createdeployment/SyncCreateDeploymentStringDeploymentString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_CreateDeployment_StringDeploymentString_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Deployment; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncCreateDeploymentStringDeploymentString { + + public static void main(String[] args) throws Exception { + syncCreateDeploymentStringDeploymentString(); + } + + public static void syncCreateDeploymentStringDeploymentString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + Deployment deployment = Deployment.newBuilder().build(); + String deploymentId = "deploymentId-136894784"; + Deployment response = apiHubClient.createDeployment(parent, deployment, deploymentId); + } + } +} +// [END apihub_v1_generated_ApiHub_CreateDeployment_StringDeploymentString_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createexternalapi/AsyncCreateExternalApi.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createexternalapi/AsyncCreateExternalApi.java new file mode 100644 index 000000000000..3b247c9ed15e --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createexternalapi/AsyncCreateExternalApi.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_CreateExternalApi_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.CreateExternalApiRequest; +import com.google.cloud.apihub.v1.ExternalApi; +import com.google.cloud.apihub.v1.LocationName; + +public class AsyncCreateExternalApi { + + public static void main(String[] args) throws Exception { + asyncCreateExternalApi(); + } + + public static void asyncCreateExternalApi() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + CreateExternalApiRequest request = + CreateExternalApiRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setExternalApiId("externalApiId-31672374") + .setExternalApi(ExternalApi.newBuilder().build()) + .build(); + ApiFuture future = apiHubClient.createExternalApiCallable().futureCall(request); + // Do something. + ExternalApi response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHub_CreateExternalApi_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createexternalapi/SyncCreateExternalApi.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createexternalapi/SyncCreateExternalApi.java new file mode 100644 index 000000000000..3e9ffbdc1012 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createexternalapi/SyncCreateExternalApi.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_CreateExternalApi_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.CreateExternalApiRequest; +import com.google.cloud.apihub.v1.ExternalApi; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncCreateExternalApi { + + public static void main(String[] args) throws Exception { + syncCreateExternalApi(); + } + + public static void syncCreateExternalApi() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + CreateExternalApiRequest request = + CreateExternalApiRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setExternalApiId("externalApiId-31672374") + .setExternalApi(ExternalApi.newBuilder().build()) + .build(); + ExternalApi response = apiHubClient.createExternalApi(request); + } + } +} +// [END apihub_v1_generated_ApiHub_CreateExternalApi_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createexternalapi/SyncCreateExternalApiLocationnameExternalapiString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createexternalapi/SyncCreateExternalApiLocationnameExternalapiString.java new file mode 100644 index 000000000000..476b2556d3a8 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createexternalapi/SyncCreateExternalApiLocationnameExternalapiString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_CreateExternalApi_LocationnameExternalapiString_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ExternalApi; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncCreateExternalApiLocationnameExternalapiString { + + public static void main(String[] args) throws Exception { + syncCreateExternalApiLocationnameExternalapiString(); + } + + public static void syncCreateExternalApiLocationnameExternalapiString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ExternalApi externalApi = ExternalApi.newBuilder().build(); + String externalApiId = "externalApiId-31672374"; + ExternalApi response = apiHubClient.createExternalApi(parent, externalApi, externalApiId); + } + } +} +// [END apihub_v1_generated_ApiHub_CreateExternalApi_LocationnameExternalapiString_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createexternalapi/SyncCreateExternalApiStringExternalapiString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createexternalapi/SyncCreateExternalApiStringExternalapiString.java new file mode 100644 index 000000000000..dd99b93a3c82 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createexternalapi/SyncCreateExternalApiStringExternalapiString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_CreateExternalApi_StringExternalapiString_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ExternalApi; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncCreateExternalApiStringExternalapiString { + + public static void main(String[] args) throws Exception { + syncCreateExternalApiStringExternalapiString(); + } + + public static void syncCreateExternalApiStringExternalapiString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + ExternalApi externalApi = ExternalApi.newBuilder().build(); + String externalApiId = "externalApiId-31672374"; + ExternalApi response = apiHubClient.createExternalApi(parent, externalApi, externalApiId); + } + } +} +// [END apihub_v1_generated_ApiHub_CreateExternalApi_StringExternalapiString_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createspec/AsyncCreateSpec.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createspec/AsyncCreateSpec.java new file mode 100644 index 000000000000..5e12a933ae00 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createspec/AsyncCreateSpec.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_CreateSpec_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.CreateSpecRequest; +import com.google.cloud.apihub.v1.Spec; +import com.google.cloud.apihub.v1.VersionName; + +public class AsyncCreateSpec { + + public static void main(String[] args) throws Exception { + asyncCreateSpec(); + } + + public static void asyncCreateSpec() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + CreateSpecRequest request = + CreateSpecRequest.newBuilder() + .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .setSpecId("specId-896074186") + .setSpec(Spec.newBuilder().build()) + .build(); + ApiFuture future = apiHubClient.createSpecCallable().futureCall(request); + // Do something. + Spec response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHub_CreateSpec_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createspec/SyncCreateSpec.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createspec/SyncCreateSpec.java new file mode 100644 index 000000000000..00ec6fafb269 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createspec/SyncCreateSpec.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_CreateSpec_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.CreateSpecRequest; +import com.google.cloud.apihub.v1.Spec; +import com.google.cloud.apihub.v1.VersionName; + +public class SyncCreateSpec { + + public static void main(String[] args) throws Exception { + syncCreateSpec(); + } + + public static void syncCreateSpec() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + CreateSpecRequest request = + CreateSpecRequest.newBuilder() + .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .setSpecId("specId-896074186") + .setSpec(Spec.newBuilder().build()) + .build(); + Spec response = apiHubClient.createSpec(request); + } + } +} +// [END apihub_v1_generated_ApiHub_CreateSpec_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createspec/SyncCreateSpecStringSpecString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createspec/SyncCreateSpecStringSpecString.java new file mode 100644 index 000000000000..a6a3c56389df --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createspec/SyncCreateSpecStringSpecString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_CreateSpec_StringSpecString_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Spec; +import com.google.cloud.apihub.v1.VersionName; + +public class SyncCreateSpecStringSpecString { + + public static void main(String[] args) throws Exception { + syncCreateSpecStringSpecString(); + } + + public static void syncCreateSpecStringSpecString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString(); + Spec spec = Spec.newBuilder().build(); + String specId = "specId-896074186"; + Spec response = apiHubClient.createSpec(parent, spec, specId); + } + } +} +// [END apihub_v1_generated_ApiHub_CreateSpec_StringSpecString_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createspec/SyncCreateSpecVersionnameSpecString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createspec/SyncCreateSpecVersionnameSpecString.java new file mode 100644 index 000000000000..b163befb57d4 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createspec/SyncCreateSpecVersionnameSpecString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_CreateSpec_VersionnameSpecString_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Spec; +import com.google.cloud.apihub.v1.VersionName; + +public class SyncCreateSpecVersionnameSpecString { + + public static void main(String[] args) throws Exception { + syncCreateSpecVersionnameSpecString(); + } + + public static void syncCreateSpecVersionnameSpecString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + VersionName parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + Spec spec = Spec.newBuilder().build(); + String specId = "specId-896074186"; + Spec response = apiHubClient.createSpec(parent, spec, specId); + } + } +} +// [END apihub_v1_generated_ApiHub_CreateSpec_VersionnameSpecString_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createversion/AsyncCreateVersion.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createversion/AsyncCreateVersion.java new file mode 100644 index 000000000000..adb7ee985f7c --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createversion/AsyncCreateVersion.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_CreateVersion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiName; +import com.google.cloud.apihub.v1.CreateVersionRequest; +import com.google.cloud.apihub.v1.Version; + +public class AsyncCreateVersion { + + public static void main(String[] args) throws Exception { + asyncCreateVersion(); + } + + public static void asyncCreateVersion() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + CreateVersionRequest request = + CreateVersionRequest.newBuilder() + .setParent(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + .setVersionId("versionId-1407102957") + .setVersion(Version.newBuilder().build()) + .build(); + ApiFuture future = apiHubClient.createVersionCallable().futureCall(request); + // Do something. + Version response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHub_CreateVersion_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createversion/SyncCreateVersion.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createversion/SyncCreateVersion.java new file mode 100644 index 000000000000..0c526f1ee253 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createversion/SyncCreateVersion.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_CreateVersion_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiName; +import com.google.cloud.apihub.v1.CreateVersionRequest; +import com.google.cloud.apihub.v1.Version; + +public class SyncCreateVersion { + + public static void main(String[] args) throws Exception { + syncCreateVersion(); + } + + public static void syncCreateVersion() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + CreateVersionRequest request = + CreateVersionRequest.newBuilder() + .setParent(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + .setVersionId("versionId-1407102957") + .setVersion(Version.newBuilder().build()) + .build(); + Version response = apiHubClient.createVersion(request); + } + } +} +// [END apihub_v1_generated_ApiHub_CreateVersion_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createversion/SyncCreateVersionApinameVersionString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createversion/SyncCreateVersionApinameVersionString.java new file mode 100644 index 000000000000..43d7d77372b4 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createversion/SyncCreateVersionApinameVersionString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_CreateVersion_ApinameVersionString_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiName; +import com.google.cloud.apihub.v1.Version; + +public class SyncCreateVersionApinameVersionString { + + public static void main(String[] args) throws Exception { + syncCreateVersionApinameVersionString(); + } + + public static void syncCreateVersionApinameVersionString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ApiName parent = ApiName.of("[PROJECT]", "[LOCATION]", "[API]"); + Version version = Version.newBuilder().build(); + String versionId = "versionId-1407102957"; + Version response = apiHubClient.createVersion(parent, version, versionId); + } + } +} +// [END apihub_v1_generated_ApiHub_CreateVersion_ApinameVersionString_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createversion/SyncCreateVersionStringVersionString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createversion/SyncCreateVersionStringVersionString.java new file mode 100644 index 000000000000..9db8f0ace791 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/createversion/SyncCreateVersionStringVersionString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_CreateVersion_StringVersionString_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiName; +import com.google.cloud.apihub.v1.Version; + +public class SyncCreateVersionStringVersionString { + + public static void main(String[] args) throws Exception { + syncCreateVersionStringVersionString(); + } + + public static void syncCreateVersionStringVersionString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String parent = ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString(); + Version version = Version.newBuilder().build(); + String versionId = "versionId-1407102957"; + Version response = apiHubClient.createVersion(parent, version, versionId); + } + } +} +// [END apihub_v1_generated_ApiHub_CreateVersion_StringVersionString_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteapi/AsyncDeleteApi.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteapi/AsyncDeleteApi.java new file mode 100644 index 000000000000..c595b72cdd68 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteapi/AsyncDeleteApi.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_DeleteApi_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiName; +import com.google.cloud.apihub.v1.DeleteApiRequest; +import com.google.protobuf.Empty; + +public class AsyncDeleteApi { + + public static void main(String[] args) throws Exception { + asyncDeleteApi(); + } + + public static void asyncDeleteApi() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + DeleteApiRequest request = + DeleteApiRequest.newBuilder() + .setName(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + .setForce(true) + .build(); + ApiFuture future = apiHubClient.deleteApiCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END apihub_v1_generated_ApiHub_DeleteApi_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteapi/SyncDeleteApi.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteapi/SyncDeleteApi.java new file mode 100644 index 000000000000..6fc20fe8027e --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteapi/SyncDeleteApi.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_DeleteApi_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiName; +import com.google.cloud.apihub.v1.DeleteApiRequest; +import com.google.protobuf.Empty; + +public class SyncDeleteApi { + + public static void main(String[] args) throws Exception { + syncDeleteApi(); + } + + public static void syncDeleteApi() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + DeleteApiRequest request = + DeleteApiRequest.newBuilder() + .setName(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + .setForce(true) + .build(); + apiHubClient.deleteApi(request); + } + } +} +// [END apihub_v1_generated_ApiHub_DeleteApi_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteapi/SyncDeleteApiApiname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteapi/SyncDeleteApiApiname.java new file mode 100644 index 000000000000..76644078fd33 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteapi/SyncDeleteApiApiname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_DeleteApi_Apiname_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiName; +import com.google.protobuf.Empty; + +public class SyncDeleteApiApiname { + + public static void main(String[] args) throws Exception { + syncDeleteApiApiname(); + } + + public static void syncDeleteApiApiname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ApiName name = ApiName.of("[PROJECT]", "[LOCATION]", "[API]"); + apiHubClient.deleteApi(name); + } + } +} +// [END apihub_v1_generated_ApiHub_DeleteApi_Apiname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteapi/SyncDeleteApiString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteapi/SyncDeleteApiString.java new file mode 100644 index 000000000000..b4eb53736fc1 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteapi/SyncDeleteApiString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_DeleteApi_String_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiName; +import com.google.protobuf.Empty; + +public class SyncDeleteApiString { + + public static void main(String[] args) throws Exception { + syncDeleteApiString(); + } + + public static void syncDeleteApiString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String name = ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString(); + apiHubClient.deleteApi(name); + } + } +} +// [END apihub_v1_generated_ApiHub_DeleteApi_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteattribute/AsyncDeleteAttribute.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteattribute/AsyncDeleteAttribute.java new file mode 100644 index 000000000000..a61a7cf41054 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteattribute/AsyncDeleteAttribute.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_DeleteAttribute_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.AttributeName; +import com.google.cloud.apihub.v1.DeleteAttributeRequest; +import com.google.protobuf.Empty; + +public class AsyncDeleteAttribute { + + public static void main(String[] args) throws Exception { + asyncDeleteAttribute(); + } + + public static void asyncDeleteAttribute() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + DeleteAttributeRequest request = + DeleteAttributeRequest.newBuilder() + .setName(AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString()) + .build(); + ApiFuture future = apiHubClient.deleteAttributeCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END apihub_v1_generated_ApiHub_DeleteAttribute_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteattribute/SyncDeleteAttribute.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteattribute/SyncDeleteAttribute.java new file mode 100644 index 000000000000..8b1386fd4fa9 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteattribute/SyncDeleteAttribute.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_DeleteAttribute_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.AttributeName; +import com.google.cloud.apihub.v1.DeleteAttributeRequest; +import com.google.protobuf.Empty; + +public class SyncDeleteAttribute { + + public static void main(String[] args) throws Exception { + syncDeleteAttribute(); + } + + public static void syncDeleteAttribute() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + DeleteAttributeRequest request = + DeleteAttributeRequest.newBuilder() + .setName(AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString()) + .build(); + apiHubClient.deleteAttribute(request); + } + } +} +// [END apihub_v1_generated_ApiHub_DeleteAttribute_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteattribute/SyncDeleteAttributeAttributename.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteattribute/SyncDeleteAttributeAttributename.java new file mode 100644 index 000000000000..76357eed2835 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteattribute/SyncDeleteAttributeAttributename.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_DeleteAttribute_Attributename_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.AttributeName; +import com.google.protobuf.Empty; + +public class SyncDeleteAttributeAttributename { + + public static void main(String[] args) throws Exception { + syncDeleteAttributeAttributename(); + } + + public static void syncDeleteAttributeAttributename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + AttributeName name = AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]"); + apiHubClient.deleteAttribute(name); + } + } +} +// [END apihub_v1_generated_ApiHub_DeleteAttribute_Attributename_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteattribute/SyncDeleteAttributeString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteattribute/SyncDeleteAttributeString.java new file mode 100644 index 000000000000..5033bfa21a3a --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteattribute/SyncDeleteAttributeString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_DeleteAttribute_String_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.AttributeName; +import com.google.protobuf.Empty; + +public class SyncDeleteAttributeString { + + public static void main(String[] args) throws Exception { + syncDeleteAttributeString(); + } + + public static void syncDeleteAttributeString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String name = AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString(); + apiHubClient.deleteAttribute(name); + } + } +} +// [END apihub_v1_generated_ApiHub_DeleteAttribute_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletedeployment/AsyncDeleteDeployment.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletedeployment/AsyncDeleteDeployment.java new file mode 100644 index 000000000000..f0d6927bb270 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletedeployment/AsyncDeleteDeployment.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_DeleteDeployment_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.DeleteDeploymentRequest; +import com.google.cloud.apihub.v1.DeploymentName; +import com.google.protobuf.Empty; + +public class AsyncDeleteDeployment { + + public static void main(String[] args) throws Exception { + asyncDeleteDeployment(); + } + + public static void asyncDeleteDeployment() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + DeleteDeploymentRequest request = + DeleteDeploymentRequest.newBuilder() + .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + .build(); + ApiFuture future = apiHubClient.deleteDeploymentCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END apihub_v1_generated_ApiHub_DeleteDeployment_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletedeployment/SyncDeleteDeployment.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletedeployment/SyncDeleteDeployment.java new file mode 100644 index 000000000000..4b7ec44dd9df --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletedeployment/SyncDeleteDeployment.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_DeleteDeployment_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.DeleteDeploymentRequest; +import com.google.cloud.apihub.v1.DeploymentName; +import com.google.protobuf.Empty; + +public class SyncDeleteDeployment { + + public static void main(String[] args) throws Exception { + syncDeleteDeployment(); + } + + public static void syncDeleteDeployment() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + DeleteDeploymentRequest request = + DeleteDeploymentRequest.newBuilder() + .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + .build(); + apiHubClient.deleteDeployment(request); + } + } +} +// [END apihub_v1_generated_ApiHub_DeleteDeployment_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletedeployment/SyncDeleteDeploymentDeploymentname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletedeployment/SyncDeleteDeploymentDeploymentname.java new file mode 100644 index 000000000000..f5bfe6d27e21 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletedeployment/SyncDeleteDeploymentDeploymentname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_DeleteDeployment_Deploymentname_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.DeploymentName; +import com.google.protobuf.Empty; + +public class SyncDeleteDeploymentDeploymentname { + + public static void main(String[] args) throws Exception { + syncDeleteDeploymentDeploymentname(); + } + + public static void syncDeleteDeploymentDeploymentname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]"); + apiHubClient.deleteDeployment(name); + } + } +} +// [END apihub_v1_generated_ApiHub_DeleteDeployment_Deploymentname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletedeployment/SyncDeleteDeploymentString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletedeployment/SyncDeleteDeploymentString.java new file mode 100644 index 000000000000..51c229e1ac32 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletedeployment/SyncDeleteDeploymentString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_DeleteDeployment_String_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.DeploymentName; +import com.google.protobuf.Empty; + +public class SyncDeleteDeploymentString { + + public static void main(String[] args) throws Exception { + syncDeleteDeploymentString(); + } + + public static void syncDeleteDeploymentString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString(); + apiHubClient.deleteDeployment(name); + } + } +} +// [END apihub_v1_generated_ApiHub_DeleteDeployment_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteexternalapi/AsyncDeleteExternalApi.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteexternalapi/AsyncDeleteExternalApi.java new file mode 100644 index 000000000000..16cb28c9050b --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteexternalapi/AsyncDeleteExternalApi.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_DeleteExternalApi_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.DeleteExternalApiRequest; +import com.google.cloud.apihub.v1.ExternalApiName; +import com.google.protobuf.Empty; + +public class AsyncDeleteExternalApi { + + public static void main(String[] args) throws Exception { + asyncDeleteExternalApi(); + } + + public static void asyncDeleteExternalApi() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + DeleteExternalApiRequest request = + DeleteExternalApiRequest.newBuilder() + .setName(ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString()) + .build(); + ApiFuture future = apiHubClient.deleteExternalApiCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END apihub_v1_generated_ApiHub_DeleteExternalApi_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteexternalapi/SyncDeleteExternalApi.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteexternalapi/SyncDeleteExternalApi.java new file mode 100644 index 000000000000..fc0749c605fe --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteexternalapi/SyncDeleteExternalApi.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_DeleteExternalApi_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.DeleteExternalApiRequest; +import com.google.cloud.apihub.v1.ExternalApiName; +import com.google.protobuf.Empty; + +public class SyncDeleteExternalApi { + + public static void main(String[] args) throws Exception { + syncDeleteExternalApi(); + } + + public static void syncDeleteExternalApi() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + DeleteExternalApiRequest request = + DeleteExternalApiRequest.newBuilder() + .setName(ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString()) + .build(); + apiHubClient.deleteExternalApi(request); + } + } +} +// [END apihub_v1_generated_ApiHub_DeleteExternalApi_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteexternalapi/SyncDeleteExternalApiExternalapiname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteexternalapi/SyncDeleteExternalApiExternalapiname.java new file mode 100644 index 000000000000..96304e76d463 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteexternalapi/SyncDeleteExternalApiExternalapiname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_DeleteExternalApi_Externalapiname_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ExternalApiName; +import com.google.protobuf.Empty; + +public class SyncDeleteExternalApiExternalapiname { + + public static void main(String[] args) throws Exception { + syncDeleteExternalApiExternalapiname(); + } + + public static void syncDeleteExternalApiExternalapiname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ExternalApiName name = ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]"); + apiHubClient.deleteExternalApi(name); + } + } +} +// [END apihub_v1_generated_ApiHub_DeleteExternalApi_Externalapiname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteexternalapi/SyncDeleteExternalApiString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteexternalapi/SyncDeleteExternalApiString.java new file mode 100644 index 000000000000..0dbc3a63c7c5 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteexternalapi/SyncDeleteExternalApiString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_DeleteExternalApi_String_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ExternalApiName; +import com.google.protobuf.Empty; + +public class SyncDeleteExternalApiString { + + public static void main(String[] args) throws Exception { + syncDeleteExternalApiString(); + } + + public static void syncDeleteExternalApiString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String name = ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString(); + apiHubClient.deleteExternalApi(name); + } + } +} +// [END apihub_v1_generated_ApiHub_DeleteExternalApi_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletespec/AsyncDeleteSpec.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletespec/AsyncDeleteSpec.java new file mode 100644 index 000000000000..4d9cbcd20afc --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletespec/AsyncDeleteSpec.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_DeleteSpec_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.DeleteSpecRequest; +import com.google.cloud.apihub.v1.SpecName; +import com.google.protobuf.Empty; + +public class AsyncDeleteSpec { + + public static void main(String[] args) throws Exception { + asyncDeleteSpec(); + } + + public static void asyncDeleteSpec() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + DeleteSpecRequest request = + DeleteSpecRequest.newBuilder() + .setName( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .build(); + ApiFuture future = apiHubClient.deleteSpecCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END apihub_v1_generated_ApiHub_DeleteSpec_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletespec/SyncDeleteSpec.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletespec/SyncDeleteSpec.java new file mode 100644 index 000000000000..d14a064ff72b --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletespec/SyncDeleteSpec.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_DeleteSpec_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.DeleteSpecRequest; +import com.google.cloud.apihub.v1.SpecName; +import com.google.protobuf.Empty; + +public class SyncDeleteSpec { + + public static void main(String[] args) throws Exception { + syncDeleteSpec(); + } + + public static void syncDeleteSpec() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + DeleteSpecRequest request = + DeleteSpecRequest.newBuilder() + .setName( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .build(); + apiHubClient.deleteSpec(request); + } + } +} +// [END apihub_v1_generated_ApiHub_DeleteSpec_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletespec/SyncDeleteSpecSpecname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletespec/SyncDeleteSpecSpecname.java new file mode 100644 index 000000000000..5150b4607155 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletespec/SyncDeleteSpecSpecname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_DeleteSpec_Specname_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.SpecName; +import com.google.protobuf.Empty; + +public class SyncDeleteSpecSpecname { + + public static void main(String[] args) throws Exception { + syncDeleteSpecSpecname(); + } + + public static void syncDeleteSpecSpecname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + SpecName name = SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]"); + apiHubClient.deleteSpec(name); + } + } +} +// [END apihub_v1_generated_ApiHub_DeleteSpec_Specname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletespec/SyncDeleteSpecString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletespec/SyncDeleteSpecString.java new file mode 100644 index 000000000000..ba92452f76f5 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deletespec/SyncDeleteSpecString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_DeleteSpec_String_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.SpecName; +import com.google.protobuf.Empty; + +public class SyncDeleteSpecString { + + public static void main(String[] args) throws Exception { + syncDeleteSpecString(); + } + + public static void syncDeleteSpecString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String name = + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString(); + apiHubClient.deleteSpec(name); + } + } +} +// [END apihub_v1_generated_ApiHub_DeleteSpec_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteversion/AsyncDeleteVersion.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteversion/AsyncDeleteVersion.java new file mode 100644 index 000000000000..84b65f02ebc4 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteversion/AsyncDeleteVersion.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_DeleteVersion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.DeleteVersionRequest; +import com.google.cloud.apihub.v1.VersionName; +import com.google.protobuf.Empty; + +public class AsyncDeleteVersion { + + public static void main(String[] args) throws Exception { + asyncDeleteVersion(); + } + + public static void asyncDeleteVersion() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + DeleteVersionRequest request = + DeleteVersionRequest.newBuilder() + .setName(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .setForce(true) + .build(); + ApiFuture future = apiHubClient.deleteVersionCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END apihub_v1_generated_ApiHub_DeleteVersion_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteversion/SyncDeleteVersion.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteversion/SyncDeleteVersion.java new file mode 100644 index 000000000000..4f134b212891 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteversion/SyncDeleteVersion.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_DeleteVersion_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.DeleteVersionRequest; +import com.google.cloud.apihub.v1.VersionName; +import com.google.protobuf.Empty; + +public class SyncDeleteVersion { + + public static void main(String[] args) throws Exception { + syncDeleteVersion(); + } + + public static void syncDeleteVersion() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + DeleteVersionRequest request = + DeleteVersionRequest.newBuilder() + .setName(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .setForce(true) + .build(); + apiHubClient.deleteVersion(request); + } + } +} +// [END apihub_v1_generated_ApiHub_DeleteVersion_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteversion/SyncDeleteVersionString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteversion/SyncDeleteVersionString.java new file mode 100644 index 000000000000..1799284c0ec1 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteversion/SyncDeleteVersionString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_DeleteVersion_String_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.VersionName; +import com.google.protobuf.Empty; + +public class SyncDeleteVersionString { + + public static void main(String[] args) throws Exception { + syncDeleteVersionString(); + } + + public static void syncDeleteVersionString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String name = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString(); + apiHubClient.deleteVersion(name); + } + } +} +// [END apihub_v1_generated_ApiHub_DeleteVersion_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteversion/SyncDeleteVersionVersionname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteversion/SyncDeleteVersionVersionname.java new file mode 100644 index 000000000000..64f36ed2b2f9 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/deleteversion/SyncDeleteVersionVersionname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_DeleteVersion_Versionname_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.VersionName; +import com.google.protobuf.Empty; + +public class SyncDeleteVersionVersionname { + + public static void main(String[] args) throws Exception { + syncDeleteVersionVersionname(); + } + + public static void syncDeleteVersionVersionname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + apiHubClient.deleteVersion(name); + } + } +} +// [END apihub_v1_generated_ApiHub_DeleteVersion_Versionname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapi/AsyncGetApi.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapi/AsyncGetApi.java new file mode 100644 index 000000000000..792647130d5b --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapi/AsyncGetApi.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetApi_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.Api; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiName; +import com.google.cloud.apihub.v1.GetApiRequest; + +public class AsyncGetApi { + + public static void main(String[] args) throws Exception { + asyncGetApi(); + } + + public static void asyncGetApi() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + GetApiRequest request = + GetApiRequest.newBuilder() + .setName(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + .build(); + ApiFuture future = apiHubClient.getApiCallable().futureCall(request); + // Do something. + Api response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHub_GetApi_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapi/SyncGetApi.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapi/SyncGetApi.java new file mode 100644 index 000000000000..bc629f124201 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapi/SyncGetApi.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetApi_sync] +import com.google.cloud.apihub.v1.Api; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiName; +import com.google.cloud.apihub.v1.GetApiRequest; + +public class SyncGetApi { + + public static void main(String[] args) throws Exception { + syncGetApi(); + } + + public static void syncGetApi() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + GetApiRequest request = + GetApiRequest.newBuilder() + .setName(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + .build(); + Api response = apiHubClient.getApi(request); + } + } +} +// [END apihub_v1_generated_ApiHub_GetApi_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapi/SyncGetApiApiname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapi/SyncGetApiApiname.java new file mode 100644 index 000000000000..d8a1320a3b80 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapi/SyncGetApiApiname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetApi_Apiname_sync] +import com.google.cloud.apihub.v1.Api; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiName; + +public class SyncGetApiApiname { + + public static void main(String[] args) throws Exception { + syncGetApiApiname(); + } + + public static void syncGetApiApiname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ApiName name = ApiName.of("[PROJECT]", "[LOCATION]", "[API]"); + Api response = apiHubClient.getApi(name); + } + } +} +// [END apihub_v1_generated_ApiHub_GetApi_Apiname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapi/SyncGetApiString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapi/SyncGetApiString.java new file mode 100644 index 000000000000..152b6f440f0f --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapi/SyncGetApiString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetApi_String_sync] +import com.google.cloud.apihub.v1.Api; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiName; + +public class SyncGetApiString { + + public static void main(String[] args) throws Exception { + syncGetApiString(); + } + + public static void syncGetApiString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String name = ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString(); + Api response = apiHubClient.getApi(name); + } + } +} +// [END apihub_v1_generated_ApiHub_GetApi_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapioperation/AsyncGetApiOperation.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapioperation/AsyncGetApiOperation.java new file mode 100644 index 000000000000..2f484a96ac74 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapioperation/AsyncGetApiOperation.java @@ -0,0 +1,52 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetApiOperation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiOperation; +import com.google.cloud.apihub.v1.ApiOperationName; +import com.google.cloud.apihub.v1.GetApiOperationRequest; + +public class AsyncGetApiOperation { + + public static void main(String[] args) throws Exception { + asyncGetApiOperation(); + } + + public static void asyncGetApiOperation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + GetApiOperationRequest request = + GetApiOperationRequest.newBuilder() + .setName( + ApiOperationName.of( + "[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[OPERATION]") + .toString()) + .build(); + ApiFuture future = apiHubClient.getApiOperationCallable().futureCall(request); + // Do something. + ApiOperation response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHub_GetApiOperation_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapioperation/SyncGetApiOperation.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapioperation/SyncGetApiOperation.java new file mode 100644 index 000000000000..6dc3eacbc83e --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapioperation/SyncGetApiOperation.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetApiOperation_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiOperation; +import com.google.cloud.apihub.v1.ApiOperationName; +import com.google.cloud.apihub.v1.GetApiOperationRequest; + +public class SyncGetApiOperation { + + public static void main(String[] args) throws Exception { + syncGetApiOperation(); + } + + public static void syncGetApiOperation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + GetApiOperationRequest request = + GetApiOperationRequest.newBuilder() + .setName( + ApiOperationName.of( + "[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[OPERATION]") + .toString()) + .build(); + ApiOperation response = apiHubClient.getApiOperation(request); + } + } +} +// [END apihub_v1_generated_ApiHub_GetApiOperation_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapioperation/SyncGetApiOperationApioperationname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapioperation/SyncGetApiOperationApioperationname.java new file mode 100644 index 000000000000..df363519a369 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapioperation/SyncGetApiOperationApioperationname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetApiOperation_Apioperationname_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiOperation; +import com.google.cloud.apihub.v1.ApiOperationName; + +public class SyncGetApiOperationApioperationname { + + public static void main(String[] args) throws Exception { + syncGetApiOperationApioperationname(); + } + + public static void syncGetApiOperationApioperationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ApiOperationName name = + ApiOperationName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[OPERATION]"); + ApiOperation response = apiHubClient.getApiOperation(name); + } + } +} +// [END apihub_v1_generated_ApiHub_GetApiOperation_Apioperationname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapioperation/SyncGetApiOperationString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapioperation/SyncGetApiOperationString.java new file mode 100644 index 000000000000..98534221dbae --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getapioperation/SyncGetApiOperationString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetApiOperation_String_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiOperation; +import com.google.cloud.apihub.v1.ApiOperationName; + +public class SyncGetApiOperationString { + + public static void main(String[] args) throws Exception { + syncGetApiOperationString(); + } + + public static void syncGetApiOperationString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String name = + ApiOperationName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[OPERATION]") + .toString(); + ApiOperation response = apiHubClient.getApiOperation(name); + } + } +} +// [END apihub_v1_generated_ApiHub_GetApiOperation_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getattribute/AsyncGetAttribute.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getattribute/AsyncGetAttribute.java new file mode 100644 index 000000000000..53da207cf458 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getattribute/AsyncGetAttribute.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetAttribute_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Attribute; +import com.google.cloud.apihub.v1.AttributeName; +import com.google.cloud.apihub.v1.GetAttributeRequest; + +public class AsyncGetAttribute { + + public static void main(String[] args) throws Exception { + asyncGetAttribute(); + } + + public static void asyncGetAttribute() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + GetAttributeRequest request = + GetAttributeRequest.newBuilder() + .setName(AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString()) + .build(); + ApiFuture future = apiHubClient.getAttributeCallable().futureCall(request); + // Do something. + Attribute response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHub_GetAttribute_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getattribute/SyncGetAttribute.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getattribute/SyncGetAttribute.java new file mode 100644 index 000000000000..61835f884f17 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getattribute/SyncGetAttribute.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetAttribute_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Attribute; +import com.google.cloud.apihub.v1.AttributeName; +import com.google.cloud.apihub.v1.GetAttributeRequest; + +public class SyncGetAttribute { + + public static void main(String[] args) throws Exception { + syncGetAttribute(); + } + + public static void syncGetAttribute() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + GetAttributeRequest request = + GetAttributeRequest.newBuilder() + .setName(AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString()) + .build(); + Attribute response = apiHubClient.getAttribute(request); + } + } +} +// [END apihub_v1_generated_ApiHub_GetAttribute_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getattribute/SyncGetAttributeAttributename.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getattribute/SyncGetAttributeAttributename.java new file mode 100644 index 000000000000..d91842a911ac --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getattribute/SyncGetAttributeAttributename.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetAttribute_Attributename_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Attribute; +import com.google.cloud.apihub.v1.AttributeName; + +public class SyncGetAttributeAttributename { + + public static void main(String[] args) throws Exception { + syncGetAttributeAttributename(); + } + + public static void syncGetAttributeAttributename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + AttributeName name = AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]"); + Attribute response = apiHubClient.getAttribute(name); + } + } +} +// [END apihub_v1_generated_ApiHub_GetAttribute_Attributename_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getattribute/SyncGetAttributeString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getattribute/SyncGetAttributeString.java new file mode 100644 index 000000000000..236934f6d9d2 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getattribute/SyncGetAttributeString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetAttribute_String_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Attribute; +import com.google.cloud.apihub.v1.AttributeName; + +public class SyncGetAttributeString { + + public static void main(String[] args) throws Exception { + syncGetAttributeString(); + } + + public static void syncGetAttributeString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String name = AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString(); + Attribute response = apiHubClient.getAttribute(name); + } + } +} +// [END apihub_v1_generated_ApiHub_GetAttribute_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdefinition/AsyncGetDefinition.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdefinition/AsyncGetDefinition.java new file mode 100644 index 000000000000..ac49907f95b1 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdefinition/AsyncGetDefinition.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetDefinition_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Definition; +import com.google.cloud.apihub.v1.DefinitionName; +import com.google.cloud.apihub.v1.GetDefinitionRequest; + +public class AsyncGetDefinition { + + public static void main(String[] args) throws Exception { + asyncGetDefinition(); + } + + public static void asyncGetDefinition() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + GetDefinitionRequest request = + GetDefinitionRequest.newBuilder() + .setName( + DefinitionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[DEFINITION]") + .toString()) + .build(); + ApiFuture future = apiHubClient.getDefinitionCallable().futureCall(request); + // Do something. + Definition response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHub_GetDefinition_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdefinition/SyncGetDefinition.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdefinition/SyncGetDefinition.java new file mode 100644 index 000000000000..77341b2f38ba --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdefinition/SyncGetDefinition.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetDefinition_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Definition; +import com.google.cloud.apihub.v1.DefinitionName; +import com.google.cloud.apihub.v1.GetDefinitionRequest; + +public class SyncGetDefinition { + + public static void main(String[] args) throws Exception { + syncGetDefinition(); + } + + public static void syncGetDefinition() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + GetDefinitionRequest request = + GetDefinitionRequest.newBuilder() + .setName( + DefinitionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[DEFINITION]") + .toString()) + .build(); + Definition response = apiHubClient.getDefinition(request); + } + } +} +// [END apihub_v1_generated_ApiHub_GetDefinition_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdefinition/SyncGetDefinitionDefinitionname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdefinition/SyncGetDefinitionDefinitionname.java new file mode 100644 index 000000000000..67f4fc06153e --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdefinition/SyncGetDefinitionDefinitionname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetDefinition_Definitionname_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Definition; +import com.google.cloud.apihub.v1.DefinitionName; + +public class SyncGetDefinitionDefinitionname { + + public static void main(String[] args) throws Exception { + syncGetDefinitionDefinitionname(); + } + + public static void syncGetDefinitionDefinitionname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + DefinitionName name = + DefinitionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[DEFINITION]"); + Definition response = apiHubClient.getDefinition(name); + } + } +} +// [END apihub_v1_generated_ApiHub_GetDefinition_Definitionname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdefinition/SyncGetDefinitionString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdefinition/SyncGetDefinitionString.java new file mode 100644 index 000000000000..83f020a2e626 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdefinition/SyncGetDefinitionString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetDefinition_String_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Definition; +import com.google.cloud.apihub.v1.DefinitionName; + +public class SyncGetDefinitionString { + + public static void main(String[] args) throws Exception { + syncGetDefinitionString(); + } + + public static void syncGetDefinitionString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String name = + DefinitionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[DEFINITION]") + .toString(); + Definition response = apiHubClient.getDefinition(name); + } + } +} +// [END apihub_v1_generated_ApiHub_GetDefinition_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdeployment/AsyncGetDeployment.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdeployment/AsyncGetDeployment.java new file mode 100644 index 000000000000..59f7fd80d2e7 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdeployment/AsyncGetDeployment.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetDeployment_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Deployment; +import com.google.cloud.apihub.v1.DeploymentName; +import com.google.cloud.apihub.v1.GetDeploymentRequest; + +public class AsyncGetDeployment { + + public static void main(String[] args) throws Exception { + asyncGetDeployment(); + } + + public static void asyncGetDeployment() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + GetDeploymentRequest request = + GetDeploymentRequest.newBuilder() + .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + .build(); + ApiFuture future = apiHubClient.getDeploymentCallable().futureCall(request); + // Do something. + Deployment response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHub_GetDeployment_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdeployment/SyncGetDeployment.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdeployment/SyncGetDeployment.java new file mode 100644 index 000000000000..e95c2fa8f46f --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdeployment/SyncGetDeployment.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetDeployment_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Deployment; +import com.google.cloud.apihub.v1.DeploymentName; +import com.google.cloud.apihub.v1.GetDeploymentRequest; + +public class SyncGetDeployment { + + public static void main(String[] args) throws Exception { + syncGetDeployment(); + } + + public static void syncGetDeployment() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + GetDeploymentRequest request = + GetDeploymentRequest.newBuilder() + .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + .build(); + Deployment response = apiHubClient.getDeployment(request); + } + } +} +// [END apihub_v1_generated_ApiHub_GetDeployment_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdeployment/SyncGetDeploymentDeploymentname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdeployment/SyncGetDeploymentDeploymentname.java new file mode 100644 index 000000000000..c02e90891a9f --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdeployment/SyncGetDeploymentDeploymentname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetDeployment_Deploymentname_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Deployment; +import com.google.cloud.apihub.v1.DeploymentName; + +public class SyncGetDeploymentDeploymentname { + + public static void main(String[] args) throws Exception { + syncGetDeploymentDeploymentname(); + } + + public static void syncGetDeploymentDeploymentname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]"); + Deployment response = apiHubClient.getDeployment(name); + } + } +} +// [END apihub_v1_generated_ApiHub_GetDeployment_Deploymentname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdeployment/SyncGetDeploymentString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdeployment/SyncGetDeploymentString.java new file mode 100644 index 000000000000..b27694ccf5c8 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getdeployment/SyncGetDeploymentString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetDeployment_String_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Deployment; +import com.google.cloud.apihub.v1.DeploymentName; + +public class SyncGetDeploymentString { + + public static void main(String[] args) throws Exception { + syncGetDeploymentString(); + } + + public static void syncGetDeploymentString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString(); + Deployment response = apiHubClient.getDeployment(name); + } + } +} +// [END apihub_v1_generated_ApiHub_GetDeployment_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getexternalapi/AsyncGetExternalApi.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getexternalapi/AsyncGetExternalApi.java new file mode 100644 index 000000000000..a6e16b672341 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getexternalapi/AsyncGetExternalApi.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetExternalApi_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ExternalApi; +import com.google.cloud.apihub.v1.ExternalApiName; +import com.google.cloud.apihub.v1.GetExternalApiRequest; + +public class AsyncGetExternalApi { + + public static void main(String[] args) throws Exception { + asyncGetExternalApi(); + } + + public static void asyncGetExternalApi() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + GetExternalApiRequest request = + GetExternalApiRequest.newBuilder() + .setName(ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString()) + .build(); + ApiFuture future = apiHubClient.getExternalApiCallable().futureCall(request); + // Do something. + ExternalApi response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHub_GetExternalApi_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getexternalapi/SyncGetExternalApi.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getexternalapi/SyncGetExternalApi.java new file mode 100644 index 000000000000..6f36f681be46 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getexternalapi/SyncGetExternalApi.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetExternalApi_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ExternalApi; +import com.google.cloud.apihub.v1.ExternalApiName; +import com.google.cloud.apihub.v1.GetExternalApiRequest; + +public class SyncGetExternalApi { + + public static void main(String[] args) throws Exception { + syncGetExternalApi(); + } + + public static void syncGetExternalApi() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + GetExternalApiRequest request = + GetExternalApiRequest.newBuilder() + .setName(ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString()) + .build(); + ExternalApi response = apiHubClient.getExternalApi(request); + } + } +} +// [END apihub_v1_generated_ApiHub_GetExternalApi_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getexternalapi/SyncGetExternalApiExternalapiname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getexternalapi/SyncGetExternalApiExternalapiname.java new file mode 100644 index 000000000000..62f95596545f --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getexternalapi/SyncGetExternalApiExternalapiname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetExternalApi_Externalapiname_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ExternalApi; +import com.google.cloud.apihub.v1.ExternalApiName; + +public class SyncGetExternalApiExternalapiname { + + public static void main(String[] args) throws Exception { + syncGetExternalApiExternalapiname(); + } + + public static void syncGetExternalApiExternalapiname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ExternalApiName name = ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]"); + ExternalApi response = apiHubClient.getExternalApi(name); + } + } +} +// [END apihub_v1_generated_ApiHub_GetExternalApi_Externalapiname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getexternalapi/SyncGetExternalApiString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getexternalapi/SyncGetExternalApiString.java new file mode 100644 index 000000000000..28c97a41177c --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getexternalapi/SyncGetExternalApiString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetExternalApi_String_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ExternalApi; +import com.google.cloud.apihub.v1.ExternalApiName; + +public class SyncGetExternalApiString { + + public static void main(String[] args) throws Exception { + syncGetExternalApiString(); + } + + public static void syncGetExternalApiString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String name = ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString(); + ExternalApi response = apiHubClient.getExternalApi(name); + } + } +} +// [END apihub_v1_generated_ApiHub_GetExternalApi_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getlocation/AsyncGetLocation.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..7d2199b2429e --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getlocation/AsyncGetLocation.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = apiHubClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHub_GetLocation_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getlocation/SyncGetLocation.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..9bdd7821f08e --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetLocation_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = apiHubClient.getLocation(request); + } + } +} +// [END apihub_v1_generated_ApiHub_GetLocation_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspec/AsyncGetSpec.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspec/AsyncGetSpec.java new file mode 100644 index 000000000000..dc03024f4b33 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspec/AsyncGetSpec.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetSpec_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.GetSpecRequest; +import com.google.cloud.apihub.v1.Spec; +import com.google.cloud.apihub.v1.SpecName; + +public class AsyncGetSpec { + + public static void main(String[] args) throws Exception { + asyncGetSpec(); + } + + public static void asyncGetSpec() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + GetSpecRequest request = + GetSpecRequest.newBuilder() + .setName( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .build(); + ApiFuture future = apiHubClient.getSpecCallable().futureCall(request); + // Do something. + Spec response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHub_GetSpec_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspec/SyncGetSpec.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspec/SyncGetSpec.java new file mode 100644 index 000000000000..f1f63e39b621 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspec/SyncGetSpec.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetSpec_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.GetSpecRequest; +import com.google.cloud.apihub.v1.Spec; +import com.google.cloud.apihub.v1.SpecName; + +public class SyncGetSpec { + + public static void main(String[] args) throws Exception { + syncGetSpec(); + } + + public static void syncGetSpec() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + GetSpecRequest request = + GetSpecRequest.newBuilder() + .setName( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .build(); + Spec response = apiHubClient.getSpec(request); + } + } +} +// [END apihub_v1_generated_ApiHub_GetSpec_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspec/SyncGetSpecSpecname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspec/SyncGetSpecSpecname.java new file mode 100644 index 000000000000..be85dfce90da --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspec/SyncGetSpecSpecname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetSpec_Specname_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Spec; +import com.google.cloud.apihub.v1.SpecName; + +public class SyncGetSpecSpecname { + + public static void main(String[] args) throws Exception { + syncGetSpecSpecname(); + } + + public static void syncGetSpecSpecname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + SpecName name = SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]"); + Spec response = apiHubClient.getSpec(name); + } + } +} +// [END apihub_v1_generated_ApiHub_GetSpec_Specname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspec/SyncGetSpecString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspec/SyncGetSpecString.java new file mode 100644 index 000000000000..f205ca72089c --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspec/SyncGetSpecString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetSpec_String_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Spec; +import com.google.cloud.apihub.v1.SpecName; + +public class SyncGetSpecString { + + public static void main(String[] args) throws Exception { + syncGetSpecString(); + } + + public static void syncGetSpecString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String name = + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString(); + Spec response = apiHubClient.getSpec(name); + } + } +} +// [END apihub_v1_generated_ApiHub_GetSpec_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspeccontents/AsyncGetSpecContents.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspeccontents/AsyncGetSpecContents.java new file mode 100644 index 000000000000..5583724b9677 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspeccontents/AsyncGetSpecContents.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetSpecContents_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.GetSpecContentsRequest; +import com.google.cloud.apihub.v1.SpecContents; +import com.google.cloud.apihub.v1.SpecName; + +public class AsyncGetSpecContents { + + public static void main(String[] args) throws Exception { + asyncGetSpecContents(); + } + + public static void asyncGetSpecContents() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + GetSpecContentsRequest request = + GetSpecContentsRequest.newBuilder() + .setName( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .build(); + ApiFuture future = apiHubClient.getSpecContentsCallable().futureCall(request); + // Do something. + SpecContents response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHub_GetSpecContents_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspeccontents/SyncGetSpecContents.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspeccontents/SyncGetSpecContents.java new file mode 100644 index 000000000000..8e19f72e4c6d --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspeccontents/SyncGetSpecContents.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetSpecContents_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.GetSpecContentsRequest; +import com.google.cloud.apihub.v1.SpecContents; +import com.google.cloud.apihub.v1.SpecName; + +public class SyncGetSpecContents { + + public static void main(String[] args) throws Exception { + syncGetSpecContents(); + } + + public static void syncGetSpecContents() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + GetSpecContentsRequest request = + GetSpecContentsRequest.newBuilder() + .setName( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .build(); + SpecContents response = apiHubClient.getSpecContents(request); + } + } +} +// [END apihub_v1_generated_ApiHub_GetSpecContents_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspeccontents/SyncGetSpecContentsSpecname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspeccontents/SyncGetSpecContentsSpecname.java new file mode 100644 index 000000000000..0b8329d0f6fa --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspeccontents/SyncGetSpecContentsSpecname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetSpecContents_Specname_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.SpecContents; +import com.google.cloud.apihub.v1.SpecName; + +public class SyncGetSpecContentsSpecname { + + public static void main(String[] args) throws Exception { + syncGetSpecContentsSpecname(); + } + + public static void syncGetSpecContentsSpecname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + SpecName name = SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]"); + SpecContents response = apiHubClient.getSpecContents(name); + } + } +} +// [END apihub_v1_generated_ApiHub_GetSpecContents_Specname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspeccontents/SyncGetSpecContentsString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspeccontents/SyncGetSpecContentsString.java new file mode 100644 index 000000000000..d6b5714d6fc6 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getspeccontents/SyncGetSpecContentsString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetSpecContents_String_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.SpecContents; +import com.google.cloud.apihub.v1.SpecName; + +public class SyncGetSpecContentsString { + + public static void main(String[] args) throws Exception { + syncGetSpecContentsString(); + } + + public static void syncGetSpecContentsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String name = + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString(); + SpecContents response = apiHubClient.getSpecContents(name); + } + } +} +// [END apihub_v1_generated_ApiHub_GetSpecContents_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getversion/AsyncGetVersion.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getversion/AsyncGetVersion.java new file mode 100644 index 000000000000..3c19d86b0e3f --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getversion/AsyncGetVersion.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetVersion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.GetVersionRequest; +import com.google.cloud.apihub.v1.Version; +import com.google.cloud.apihub.v1.VersionName; + +public class AsyncGetVersion { + + public static void main(String[] args) throws Exception { + asyncGetVersion(); + } + + public static void asyncGetVersion() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + GetVersionRequest request = + GetVersionRequest.newBuilder() + .setName(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .build(); + ApiFuture future = apiHubClient.getVersionCallable().futureCall(request); + // Do something. + Version response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHub_GetVersion_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getversion/SyncGetVersion.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getversion/SyncGetVersion.java new file mode 100644 index 000000000000..74f14a1261ae --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getversion/SyncGetVersion.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetVersion_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.GetVersionRequest; +import com.google.cloud.apihub.v1.Version; +import com.google.cloud.apihub.v1.VersionName; + +public class SyncGetVersion { + + public static void main(String[] args) throws Exception { + syncGetVersion(); + } + + public static void syncGetVersion() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + GetVersionRequest request = + GetVersionRequest.newBuilder() + .setName(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .build(); + Version response = apiHubClient.getVersion(request); + } + } +} +// [END apihub_v1_generated_ApiHub_GetVersion_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getversion/SyncGetVersionString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getversion/SyncGetVersionString.java new file mode 100644 index 000000000000..e22e18b80037 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getversion/SyncGetVersionString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetVersion_String_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Version; +import com.google.cloud.apihub.v1.VersionName; + +public class SyncGetVersionString { + + public static void main(String[] args) throws Exception { + syncGetVersionString(); + } + + public static void syncGetVersionString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String name = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString(); + Version response = apiHubClient.getVersion(name); + } + } +} +// [END apihub_v1_generated_ApiHub_GetVersion_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getversion/SyncGetVersionVersionname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getversion/SyncGetVersionVersionname.java new file mode 100644 index 000000000000..c7385db32992 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/getversion/SyncGetVersionVersionname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_GetVersion_Versionname_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Version; +import com.google.cloud.apihub.v1.VersionName; + +public class SyncGetVersionVersionname { + + public static void main(String[] args) throws Exception { + syncGetVersionVersionname(); + } + + public static void syncGetVersionVersionname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + Version response = apiHubClient.getVersion(name); + } + } +} +// [END apihub_v1_generated_ApiHub_GetVersion_Versionname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapioperations/AsyncListApiOperations.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapioperations/AsyncListApiOperations.java new file mode 100644 index 000000000000..ef2698fc7fd4 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapioperations/AsyncListApiOperations.java @@ -0,0 +1,55 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListApiOperations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiOperation; +import com.google.cloud.apihub.v1.ListApiOperationsRequest; +import com.google.cloud.apihub.v1.VersionName; + +public class AsyncListApiOperations { + + public static void main(String[] args) throws Exception { + asyncListApiOperations(); + } + + public static void asyncListApiOperations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ListApiOperationsRequest request = + ListApiOperationsRequest.newBuilder() + .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + apiHubClient.listApiOperationsPagedCallable().futureCall(request); + // Do something. + for (ApiOperation element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListApiOperations_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapioperations/AsyncListApiOperationsPaged.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapioperations/AsyncListApiOperationsPaged.java new file mode 100644 index 000000000000..daf42abc982f --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapioperations/AsyncListApiOperationsPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListApiOperations_Paged_async] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiOperation; +import com.google.cloud.apihub.v1.ListApiOperationsRequest; +import com.google.cloud.apihub.v1.ListApiOperationsResponse; +import com.google.cloud.apihub.v1.VersionName; +import com.google.common.base.Strings; + +public class AsyncListApiOperationsPaged { + + public static void main(String[] args) throws Exception { + asyncListApiOperationsPaged(); + } + + public static void asyncListApiOperationsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ListApiOperationsRequest request = + ListApiOperationsRequest.newBuilder() + .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListApiOperationsResponse response = apiHubClient.listApiOperationsCallable().call(request); + for (ApiOperation element : response.getApiOperationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListApiOperations_Paged_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapioperations/SyncListApiOperations.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapioperations/SyncListApiOperations.java new file mode 100644 index 000000000000..00dc4ef51f0f --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapioperations/SyncListApiOperations.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListApiOperations_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiOperation; +import com.google.cloud.apihub.v1.ListApiOperationsRequest; +import com.google.cloud.apihub.v1.VersionName; + +public class SyncListApiOperations { + + public static void main(String[] args) throws Exception { + syncListApiOperations(); + } + + public static void syncListApiOperations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ListApiOperationsRequest request = + ListApiOperationsRequest.newBuilder() + .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (ApiOperation element : apiHubClient.listApiOperations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListApiOperations_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapioperations/SyncListApiOperationsString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapioperations/SyncListApiOperationsString.java new file mode 100644 index 000000000000..b28b16ddd926 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapioperations/SyncListApiOperationsString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListApiOperations_String_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiOperation; +import com.google.cloud.apihub.v1.VersionName; + +public class SyncListApiOperationsString { + + public static void main(String[] args) throws Exception { + syncListApiOperationsString(); + } + + public static void syncListApiOperationsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString(); + for (ApiOperation element : apiHubClient.listApiOperations(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListApiOperations_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapioperations/SyncListApiOperationsVersionname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapioperations/SyncListApiOperationsVersionname.java new file mode 100644 index 000000000000..ba170b69196d --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapioperations/SyncListApiOperationsVersionname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListApiOperations_Versionname_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiOperation; +import com.google.cloud.apihub.v1.VersionName; + +public class SyncListApiOperationsVersionname { + + public static void main(String[] args) throws Exception { + syncListApiOperationsVersionname(); + } + + public static void syncListApiOperationsVersionname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + VersionName parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + for (ApiOperation element : apiHubClient.listApiOperations(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListApiOperations_Versionname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapis/AsyncListApis.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapis/AsyncListApis.java new file mode 100644 index 000000000000..505bba552c07 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapis/AsyncListApis.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListApis_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.Api; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ListApisRequest; +import com.google.cloud.apihub.v1.LocationName; + +public class AsyncListApis { + + public static void main(String[] args) throws Exception { + asyncListApis(); + } + + public static void asyncListApis() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ListApisRequest request = + ListApisRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = apiHubClient.listApisPagedCallable().futureCall(request); + // Do something. + for (Api element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListApis_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapis/AsyncListApisPaged.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapis/AsyncListApisPaged.java new file mode 100644 index 000000000000..846d1c375996 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapis/AsyncListApisPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListApis_Paged_async] +import com.google.cloud.apihub.v1.Api; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ListApisRequest; +import com.google.cloud.apihub.v1.ListApisResponse; +import com.google.cloud.apihub.v1.LocationName; +import com.google.common.base.Strings; + +public class AsyncListApisPaged { + + public static void main(String[] args) throws Exception { + asyncListApisPaged(); + } + + public static void asyncListApisPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ListApisRequest request = + ListApisRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListApisResponse response = apiHubClient.listApisCallable().call(request); + for (Api element : response.getApisList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListApis_Paged_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapis/SyncListApis.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapis/SyncListApis.java new file mode 100644 index 000000000000..5a6ff4a28065 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapis/SyncListApis.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListApis_sync] +import com.google.cloud.apihub.v1.Api; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ListApisRequest; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncListApis { + + public static void main(String[] args) throws Exception { + syncListApis(); + } + + public static void syncListApis() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ListApisRequest request = + ListApisRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Api element : apiHubClient.listApis(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListApis_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapis/SyncListApisLocationname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapis/SyncListApisLocationname.java new file mode 100644 index 000000000000..1c86d7f1a0b3 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapis/SyncListApisLocationname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListApis_Locationname_sync] +import com.google.cloud.apihub.v1.Api; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncListApisLocationname { + + public static void main(String[] args) throws Exception { + syncListApisLocationname(); + } + + public static void syncListApisLocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (Api element : apiHubClient.listApis(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListApis_Locationname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapis/SyncListApisString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapis/SyncListApisString.java new file mode 100644 index 000000000000..0dc48c66a64d --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listapis/SyncListApisString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListApis_String_sync] +import com.google.cloud.apihub.v1.Api; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncListApisString { + + public static void main(String[] args) throws Exception { + syncListApisString(); + } + + public static void syncListApisString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (Api element : apiHubClient.listApis(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListApis_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listattributes/AsyncListAttributes.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listattributes/AsyncListAttributes.java new file mode 100644 index 000000000000..e4e4a1c589ef --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listattributes/AsyncListAttributes.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListAttributes_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Attribute; +import com.google.cloud.apihub.v1.ListAttributesRequest; +import com.google.cloud.apihub.v1.LocationName; + +public class AsyncListAttributes { + + public static void main(String[] args) throws Exception { + asyncListAttributes(); + } + + public static void asyncListAttributes() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ListAttributesRequest request = + ListAttributesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = apiHubClient.listAttributesPagedCallable().futureCall(request); + // Do something. + for (Attribute element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListAttributes_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listattributes/AsyncListAttributesPaged.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listattributes/AsyncListAttributesPaged.java new file mode 100644 index 000000000000..5363707675b9 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listattributes/AsyncListAttributesPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListAttributes_Paged_async] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Attribute; +import com.google.cloud.apihub.v1.ListAttributesRequest; +import com.google.cloud.apihub.v1.ListAttributesResponse; +import com.google.cloud.apihub.v1.LocationName; +import com.google.common.base.Strings; + +public class AsyncListAttributesPaged { + + public static void main(String[] args) throws Exception { + asyncListAttributesPaged(); + } + + public static void asyncListAttributesPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ListAttributesRequest request = + ListAttributesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListAttributesResponse response = apiHubClient.listAttributesCallable().call(request); + for (Attribute element : response.getAttributesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListAttributes_Paged_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listattributes/SyncListAttributes.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listattributes/SyncListAttributes.java new file mode 100644 index 000000000000..72f7cc8cf9c9 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listattributes/SyncListAttributes.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListAttributes_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Attribute; +import com.google.cloud.apihub.v1.ListAttributesRequest; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncListAttributes { + + public static void main(String[] args) throws Exception { + syncListAttributes(); + } + + public static void syncListAttributes() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ListAttributesRequest request = + ListAttributesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Attribute element : apiHubClient.listAttributes(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListAttributes_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listattributes/SyncListAttributesLocationname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listattributes/SyncListAttributesLocationname.java new file mode 100644 index 000000000000..68dfaa220bcb --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listattributes/SyncListAttributesLocationname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListAttributes_Locationname_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Attribute; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncListAttributesLocationname { + + public static void main(String[] args) throws Exception { + syncListAttributesLocationname(); + } + + public static void syncListAttributesLocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (Attribute element : apiHubClient.listAttributes(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListAttributes_Locationname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listattributes/SyncListAttributesString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listattributes/SyncListAttributesString.java new file mode 100644 index 000000000000..b0d398604ffd --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listattributes/SyncListAttributesString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListAttributes_String_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Attribute; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncListAttributesString { + + public static void main(String[] args) throws Exception { + syncListAttributesString(); + } + + public static void syncListAttributesString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (Attribute element : apiHubClient.listAttributes(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListAttributes_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listdeployments/AsyncListDeployments.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listdeployments/AsyncListDeployments.java new file mode 100644 index 000000000000..8a8f49168920 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listdeployments/AsyncListDeployments.java @@ -0,0 +1,55 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListDeployments_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Deployment; +import com.google.cloud.apihub.v1.ListDeploymentsRequest; +import com.google.cloud.apihub.v1.LocationName; + +public class AsyncListDeployments { + + public static void main(String[] args) throws Exception { + asyncListDeployments(); + } + + public static void asyncListDeployments() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ListDeploymentsRequest request = + ListDeploymentsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + apiHubClient.listDeploymentsPagedCallable().futureCall(request); + // Do something. + for (Deployment element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListDeployments_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listdeployments/AsyncListDeploymentsPaged.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listdeployments/AsyncListDeploymentsPaged.java new file mode 100644 index 000000000000..cfd16d477d06 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listdeployments/AsyncListDeploymentsPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListDeployments_Paged_async] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Deployment; +import com.google.cloud.apihub.v1.ListDeploymentsRequest; +import com.google.cloud.apihub.v1.ListDeploymentsResponse; +import com.google.cloud.apihub.v1.LocationName; +import com.google.common.base.Strings; + +public class AsyncListDeploymentsPaged { + + public static void main(String[] args) throws Exception { + asyncListDeploymentsPaged(); + } + + public static void asyncListDeploymentsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ListDeploymentsRequest request = + ListDeploymentsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListDeploymentsResponse response = apiHubClient.listDeploymentsCallable().call(request); + for (Deployment element : response.getDeploymentsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListDeployments_Paged_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listdeployments/SyncListDeployments.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listdeployments/SyncListDeployments.java new file mode 100644 index 000000000000..d65ec0c6185c --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listdeployments/SyncListDeployments.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListDeployments_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Deployment; +import com.google.cloud.apihub.v1.ListDeploymentsRequest; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncListDeployments { + + public static void main(String[] args) throws Exception { + syncListDeployments(); + } + + public static void syncListDeployments() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ListDeploymentsRequest request = + ListDeploymentsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Deployment element : apiHubClient.listDeployments(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListDeployments_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listdeployments/SyncListDeploymentsLocationname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listdeployments/SyncListDeploymentsLocationname.java new file mode 100644 index 000000000000..710270c7b563 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listdeployments/SyncListDeploymentsLocationname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListDeployments_Locationname_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Deployment; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncListDeploymentsLocationname { + + public static void main(String[] args) throws Exception { + syncListDeploymentsLocationname(); + } + + public static void syncListDeploymentsLocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (Deployment element : apiHubClient.listDeployments(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListDeployments_Locationname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listdeployments/SyncListDeploymentsString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listdeployments/SyncListDeploymentsString.java new file mode 100644 index 000000000000..18849762474c --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listdeployments/SyncListDeploymentsString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListDeployments_String_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Deployment; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncListDeploymentsString { + + public static void main(String[] args) throws Exception { + syncListDeploymentsString(); + } + + public static void syncListDeploymentsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (Deployment element : apiHubClient.listDeployments(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListDeployments_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listexternalapis/AsyncListExternalApis.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listexternalapis/AsyncListExternalApis.java new file mode 100644 index 000000000000..288f62793347 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listexternalapis/AsyncListExternalApis.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListExternalApis_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ExternalApi; +import com.google.cloud.apihub.v1.ListExternalApisRequest; +import com.google.cloud.apihub.v1.LocationName; + +public class AsyncListExternalApis { + + public static void main(String[] args) throws Exception { + asyncListExternalApis(); + } + + public static void asyncListExternalApis() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ListExternalApisRequest request = + ListExternalApisRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + apiHubClient.listExternalApisPagedCallable().futureCall(request); + // Do something. + for (ExternalApi element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListExternalApis_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listexternalapis/AsyncListExternalApisPaged.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listexternalapis/AsyncListExternalApisPaged.java new file mode 100644 index 000000000000..466ee9b6b0f4 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listexternalapis/AsyncListExternalApisPaged.java @@ -0,0 +1,61 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListExternalApis_Paged_async] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ExternalApi; +import com.google.cloud.apihub.v1.ListExternalApisRequest; +import com.google.cloud.apihub.v1.ListExternalApisResponse; +import com.google.cloud.apihub.v1.LocationName; +import com.google.common.base.Strings; + +public class AsyncListExternalApisPaged { + + public static void main(String[] args) throws Exception { + asyncListExternalApisPaged(); + } + + public static void asyncListExternalApisPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ListExternalApisRequest request = + ListExternalApisRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListExternalApisResponse response = apiHubClient.listExternalApisCallable().call(request); + for (ExternalApi element : response.getExternalApisList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListExternalApis_Paged_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listexternalapis/SyncListExternalApis.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listexternalapis/SyncListExternalApis.java new file mode 100644 index 000000000000..6beb7220cb1e --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listexternalapis/SyncListExternalApis.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListExternalApis_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ExternalApi; +import com.google.cloud.apihub.v1.ListExternalApisRequest; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncListExternalApis { + + public static void main(String[] args) throws Exception { + syncListExternalApis(); + } + + public static void syncListExternalApis() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ListExternalApisRequest request = + ListExternalApisRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (ExternalApi element : apiHubClient.listExternalApis(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListExternalApis_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listexternalapis/SyncListExternalApisLocationname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listexternalapis/SyncListExternalApisLocationname.java new file mode 100644 index 000000000000..aac1dc4941d0 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listexternalapis/SyncListExternalApisLocationname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListExternalApis_Locationname_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ExternalApi; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncListExternalApisLocationname { + + public static void main(String[] args) throws Exception { + syncListExternalApisLocationname(); + } + + public static void syncListExternalApisLocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (ExternalApi element : apiHubClient.listExternalApis(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListExternalApis_Locationname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listexternalapis/SyncListExternalApisString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listexternalapis/SyncListExternalApisString.java new file mode 100644 index 000000000000..a5d414815caf --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listexternalapis/SyncListExternalApisString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListExternalApis_String_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ExternalApi; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncListExternalApisString { + + public static void main(String[] args) throws Exception { + syncListExternalApisString(); + } + + public static void syncListExternalApisString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (ExternalApi element : apiHubClient.listExternalApis(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListExternalApis_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listlocations/AsyncListLocations.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..b48bd0817e03 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listlocations/AsyncListLocations.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = apiHubClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListLocations_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listlocations/AsyncListLocationsPaged.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..6c626c4dd90f --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,61 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListLocations_Paged_async] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = apiHubClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListLocations_Paged_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listlocations/SyncListLocations.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..258f59823ee7 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListLocations_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : apiHubClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListLocations_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listspecs/AsyncListSpecs.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listspecs/AsyncListSpecs.java new file mode 100644 index 000000000000..726b39382b19 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listspecs/AsyncListSpecs.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListSpecs_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ListSpecsRequest; +import com.google.cloud.apihub.v1.Spec; +import com.google.cloud.apihub.v1.VersionName; + +public class AsyncListSpecs { + + public static void main(String[] args) throws Exception { + asyncListSpecs(); + } + + public static void asyncListSpecs() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ListSpecsRequest request = + ListSpecsRequest.newBuilder() + .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = apiHubClient.listSpecsPagedCallable().futureCall(request); + // Do something. + for (Spec element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListSpecs_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listspecs/AsyncListSpecsPaged.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listspecs/AsyncListSpecsPaged.java new file mode 100644 index 000000000000..4433cdc9bc30 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listspecs/AsyncListSpecsPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListSpecs_Paged_async] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ListSpecsRequest; +import com.google.cloud.apihub.v1.ListSpecsResponse; +import com.google.cloud.apihub.v1.Spec; +import com.google.cloud.apihub.v1.VersionName; +import com.google.common.base.Strings; + +public class AsyncListSpecsPaged { + + public static void main(String[] args) throws Exception { + asyncListSpecsPaged(); + } + + public static void asyncListSpecsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ListSpecsRequest request = + ListSpecsRequest.newBuilder() + .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListSpecsResponse response = apiHubClient.listSpecsCallable().call(request); + for (Spec element : response.getSpecsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListSpecs_Paged_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listspecs/SyncListSpecs.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listspecs/SyncListSpecs.java new file mode 100644 index 000000000000..c040efb71790 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listspecs/SyncListSpecs.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListSpecs_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ListSpecsRequest; +import com.google.cloud.apihub.v1.Spec; +import com.google.cloud.apihub.v1.VersionName; + +public class SyncListSpecs { + + public static void main(String[] args) throws Exception { + syncListSpecs(); + } + + public static void syncListSpecs() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ListSpecsRequest request = + ListSpecsRequest.newBuilder() + .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Spec element : apiHubClient.listSpecs(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListSpecs_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listspecs/SyncListSpecsString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listspecs/SyncListSpecsString.java new file mode 100644 index 000000000000..095af353ac5e --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listspecs/SyncListSpecsString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListSpecs_String_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Spec; +import com.google.cloud.apihub.v1.VersionName; + +public class SyncListSpecsString { + + public static void main(String[] args) throws Exception { + syncListSpecsString(); + } + + public static void syncListSpecsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString(); + for (Spec element : apiHubClient.listSpecs(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListSpecs_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listspecs/SyncListSpecsVersionname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listspecs/SyncListSpecsVersionname.java new file mode 100644 index 000000000000..96e5b999516e --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listspecs/SyncListSpecsVersionname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListSpecs_Versionname_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Spec; +import com.google.cloud.apihub.v1.VersionName; + +public class SyncListSpecsVersionname { + + public static void main(String[] args) throws Exception { + syncListSpecsVersionname(); + } + + public static void syncListSpecsVersionname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + VersionName parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + for (Spec element : apiHubClient.listSpecs(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListSpecs_Versionname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listversions/AsyncListVersions.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listversions/AsyncListVersions.java new file mode 100644 index 000000000000..0a9f5383e026 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listversions/AsyncListVersions.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListVersions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiName; +import com.google.cloud.apihub.v1.ListVersionsRequest; +import com.google.cloud.apihub.v1.Version; + +public class AsyncListVersions { + + public static void main(String[] args) throws Exception { + asyncListVersions(); + } + + public static void asyncListVersions() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ListVersionsRequest request = + ListVersionsRequest.newBuilder() + .setParent(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = apiHubClient.listVersionsPagedCallable().futureCall(request); + // Do something. + for (Version element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListVersions_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listversions/AsyncListVersionsPaged.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listversions/AsyncListVersionsPaged.java new file mode 100644 index 000000000000..205697bc008c --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listversions/AsyncListVersionsPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListVersions_Paged_async] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiName; +import com.google.cloud.apihub.v1.ListVersionsRequest; +import com.google.cloud.apihub.v1.ListVersionsResponse; +import com.google.cloud.apihub.v1.Version; +import com.google.common.base.Strings; + +public class AsyncListVersionsPaged { + + public static void main(String[] args) throws Exception { + asyncListVersionsPaged(); + } + + public static void asyncListVersionsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ListVersionsRequest request = + ListVersionsRequest.newBuilder() + .setParent(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListVersionsResponse response = apiHubClient.listVersionsCallable().call(request); + for (Version element : response.getVersionsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListVersions_Paged_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listversions/SyncListVersions.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listversions/SyncListVersions.java new file mode 100644 index 000000000000..7092ae3b08dc --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listversions/SyncListVersions.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListVersions_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiName; +import com.google.cloud.apihub.v1.ListVersionsRequest; +import com.google.cloud.apihub.v1.Version; + +public class SyncListVersions { + + public static void main(String[] args) throws Exception { + syncListVersions(); + } + + public static void syncListVersions() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ListVersionsRequest request = + ListVersionsRequest.newBuilder() + .setParent(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Version element : apiHubClient.listVersions(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListVersions_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listversions/SyncListVersionsApiname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listversions/SyncListVersionsApiname.java new file mode 100644 index 000000000000..4dc8405de0cb --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listversions/SyncListVersionsApiname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListVersions_Apiname_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiName; +import com.google.cloud.apihub.v1.Version; + +public class SyncListVersionsApiname { + + public static void main(String[] args) throws Exception { + syncListVersionsApiname(); + } + + public static void syncListVersionsApiname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ApiName parent = ApiName.of("[PROJECT]", "[LOCATION]", "[API]"); + for (Version element : apiHubClient.listVersions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListVersions_Apiname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listversions/SyncListVersionsString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listversions/SyncListVersionsString.java new file mode 100644 index 000000000000..1950f7e47eaa --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/listversions/SyncListVersionsString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_ListVersions_String_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ApiName; +import com.google.cloud.apihub.v1.Version; + +public class SyncListVersionsString { + + public static void main(String[] args) throws Exception { + syncListVersionsString(); + } + + public static void syncListVersionsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String parent = ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString(); + for (Version element : apiHubClient.listVersions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_ListVersions_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/searchresources/AsyncSearchResources.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/searchresources/AsyncSearchResources.java new file mode 100644 index 000000000000..ad470e19bacc --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/searchresources/AsyncSearchResources.java @@ -0,0 +1,56 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_SearchResources_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.LocationName; +import com.google.cloud.apihub.v1.SearchResourcesRequest; +import com.google.cloud.apihub.v1.SearchResult; + +public class AsyncSearchResources { + + public static void main(String[] args) throws Exception { + asyncSearchResources(); + } + + public static void asyncSearchResources() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + SearchResourcesRequest request = + SearchResourcesRequest.newBuilder() + .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setQuery("query107944136") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + apiHubClient.searchResourcesPagedCallable().futureCall(request); + // Do something. + for (SearchResult element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_SearchResources_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/searchresources/AsyncSearchResourcesPaged.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/searchresources/AsyncSearchResourcesPaged.java new file mode 100644 index 000000000000..ca923c517469 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/searchresources/AsyncSearchResourcesPaged.java @@ -0,0 +1,63 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_SearchResources_Paged_async] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.LocationName; +import com.google.cloud.apihub.v1.SearchResourcesRequest; +import com.google.cloud.apihub.v1.SearchResourcesResponse; +import com.google.cloud.apihub.v1.SearchResult; +import com.google.common.base.Strings; + +public class AsyncSearchResourcesPaged { + + public static void main(String[] args) throws Exception { + asyncSearchResourcesPaged(); + } + + public static void asyncSearchResourcesPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + SearchResourcesRequest request = + SearchResourcesRequest.newBuilder() + .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setQuery("query107944136") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + SearchResourcesResponse response = apiHubClient.searchResourcesCallable().call(request); + for (SearchResult element : response.getSearchResultsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END apihub_v1_generated_ApiHub_SearchResources_Paged_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/searchresources/SyncSearchResources.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/searchresources/SyncSearchResources.java new file mode 100644 index 000000000000..e8562351d1d0 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/searchresources/SyncSearchResources.java @@ -0,0 +1,52 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_SearchResources_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.LocationName; +import com.google.cloud.apihub.v1.SearchResourcesRequest; +import com.google.cloud.apihub.v1.SearchResult; + +public class SyncSearchResources { + + public static void main(String[] args) throws Exception { + syncSearchResources(); + } + + public static void syncSearchResources() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + SearchResourcesRequest request = + SearchResourcesRequest.newBuilder() + .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setQuery("query107944136") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (SearchResult element : apiHubClient.searchResources(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_SearchResources_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/searchresources/SyncSearchResourcesLocationnameString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/searchresources/SyncSearchResourcesLocationnameString.java new file mode 100644 index 000000000000..6b1aa62f3cb6 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/searchresources/SyncSearchResourcesLocationnameString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_SearchResources_LocationnameString_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.LocationName; +import com.google.cloud.apihub.v1.SearchResult; + +public class SyncSearchResourcesLocationnameString { + + public static void main(String[] args) throws Exception { + syncSearchResourcesLocationnameString(); + } + + public static void syncSearchResourcesLocationnameString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + LocationName location = LocationName.of("[PROJECT]", "[LOCATION]"); + String query = "query107944136"; + for (SearchResult element : apiHubClient.searchResources(location, query).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_SearchResources_LocationnameString_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/searchresources/SyncSearchResourcesStringString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/searchresources/SyncSearchResourcesStringString.java new file mode 100644 index 000000000000..6654bea02a24 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/searchresources/SyncSearchResourcesStringString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_SearchResources_StringString_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.LocationName; +import com.google.cloud.apihub.v1.SearchResult; + +public class SyncSearchResourcesStringString { + + public static void main(String[] args) throws Exception { + syncSearchResourcesStringString(); + } + + public static void syncSearchResourcesStringString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + String location = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + String query = "query107944136"; + for (SearchResult element : apiHubClient.searchResources(location, query).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHub_SearchResources_StringString_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateapi/AsyncUpdateApi.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateapi/AsyncUpdateApi.java new file mode 100644 index 000000000000..a6c482afedbc --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateapi/AsyncUpdateApi.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_UpdateApi_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.Api; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.UpdateApiRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateApi { + + public static void main(String[] args) throws Exception { + asyncUpdateApi(); + } + + public static void asyncUpdateApi() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + UpdateApiRequest request = + UpdateApiRequest.newBuilder() + .setApi(Api.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = apiHubClient.updateApiCallable().futureCall(request); + // Do something. + Api response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHub_UpdateApi_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateapi/SyncUpdateApi.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateapi/SyncUpdateApi.java new file mode 100644 index 000000000000..9b80fd2adfcf --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateapi/SyncUpdateApi.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_UpdateApi_sync] +import com.google.cloud.apihub.v1.Api; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.UpdateApiRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateApi { + + public static void main(String[] args) throws Exception { + syncUpdateApi(); + } + + public static void syncUpdateApi() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + UpdateApiRequest request = + UpdateApiRequest.newBuilder() + .setApi(Api.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Api response = apiHubClient.updateApi(request); + } + } +} +// [END apihub_v1_generated_ApiHub_UpdateApi_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateapi/SyncUpdateApiApiFieldmask.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateapi/SyncUpdateApiApiFieldmask.java new file mode 100644 index 000000000000..23c0d4947db9 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateapi/SyncUpdateApiApiFieldmask.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_UpdateApi_ApiFieldmask_sync] +import com.google.cloud.apihub.v1.Api; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateApiApiFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateApiApiFieldmask(); + } + + public static void syncUpdateApiApiFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + Api api = Api.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Api response = apiHubClient.updateApi(api, updateMask); + } + } +} +// [END apihub_v1_generated_ApiHub_UpdateApi_ApiFieldmask_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateattribute/AsyncUpdateAttribute.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateattribute/AsyncUpdateAttribute.java new file mode 100644 index 000000000000..d499220b8d29 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateattribute/AsyncUpdateAttribute.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_UpdateAttribute_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Attribute; +import com.google.cloud.apihub.v1.UpdateAttributeRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateAttribute { + + public static void main(String[] args) throws Exception { + asyncUpdateAttribute(); + } + + public static void asyncUpdateAttribute() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + UpdateAttributeRequest request = + UpdateAttributeRequest.newBuilder() + .setAttribute(Attribute.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = apiHubClient.updateAttributeCallable().futureCall(request); + // Do something. + Attribute response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHub_UpdateAttribute_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateattribute/SyncUpdateAttribute.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateattribute/SyncUpdateAttribute.java new file mode 100644 index 000000000000..38b35441257d --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateattribute/SyncUpdateAttribute.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_UpdateAttribute_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Attribute; +import com.google.cloud.apihub.v1.UpdateAttributeRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateAttribute { + + public static void main(String[] args) throws Exception { + syncUpdateAttribute(); + } + + public static void syncUpdateAttribute() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + UpdateAttributeRequest request = + UpdateAttributeRequest.newBuilder() + .setAttribute(Attribute.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Attribute response = apiHubClient.updateAttribute(request); + } + } +} +// [END apihub_v1_generated_ApiHub_UpdateAttribute_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateattribute/SyncUpdateAttributeAttributeFieldmask.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateattribute/SyncUpdateAttributeAttributeFieldmask.java new file mode 100644 index 000000000000..9417d6e25aa5 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateattribute/SyncUpdateAttributeAttributeFieldmask.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_UpdateAttribute_AttributeFieldmask_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Attribute; +import com.google.protobuf.FieldMask; + +public class SyncUpdateAttributeAttributeFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateAttributeAttributeFieldmask(); + } + + public static void syncUpdateAttributeAttributeFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + Attribute attribute = Attribute.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Attribute response = apiHubClient.updateAttribute(attribute, updateMask); + } + } +} +// [END apihub_v1_generated_ApiHub_UpdateAttribute_AttributeFieldmask_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updatedeployment/AsyncUpdateDeployment.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updatedeployment/AsyncUpdateDeployment.java new file mode 100644 index 000000000000..acb39a0c1af6 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updatedeployment/AsyncUpdateDeployment.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_UpdateDeployment_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Deployment; +import com.google.cloud.apihub.v1.UpdateDeploymentRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateDeployment { + + public static void main(String[] args) throws Exception { + asyncUpdateDeployment(); + } + + public static void asyncUpdateDeployment() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + UpdateDeploymentRequest request = + UpdateDeploymentRequest.newBuilder() + .setDeployment(Deployment.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = apiHubClient.updateDeploymentCallable().futureCall(request); + // Do something. + Deployment response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHub_UpdateDeployment_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updatedeployment/SyncUpdateDeployment.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updatedeployment/SyncUpdateDeployment.java new file mode 100644 index 000000000000..13bd703d57aa --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updatedeployment/SyncUpdateDeployment.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_UpdateDeployment_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Deployment; +import com.google.cloud.apihub.v1.UpdateDeploymentRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateDeployment { + + public static void main(String[] args) throws Exception { + syncUpdateDeployment(); + } + + public static void syncUpdateDeployment() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + UpdateDeploymentRequest request = + UpdateDeploymentRequest.newBuilder() + .setDeployment(Deployment.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Deployment response = apiHubClient.updateDeployment(request); + } + } +} +// [END apihub_v1_generated_ApiHub_UpdateDeployment_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updatedeployment/SyncUpdateDeploymentDeploymentFieldmask.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updatedeployment/SyncUpdateDeploymentDeploymentFieldmask.java new file mode 100644 index 000000000000..6565e753e6c8 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updatedeployment/SyncUpdateDeploymentDeploymentFieldmask.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_UpdateDeployment_DeploymentFieldmask_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Deployment; +import com.google.protobuf.FieldMask; + +public class SyncUpdateDeploymentDeploymentFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateDeploymentDeploymentFieldmask(); + } + + public static void syncUpdateDeploymentDeploymentFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + Deployment deployment = Deployment.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Deployment response = apiHubClient.updateDeployment(deployment, updateMask); + } + } +} +// [END apihub_v1_generated_ApiHub_UpdateDeployment_DeploymentFieldmask_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateexternalapi/AsyncUpdateExternalApi.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateexternalapi/AsyncUpdateExternalApi.java new file mode 100644 index 000000000000..fe6f1d7299c9 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateexternalapi/AsyncUpdateExternalApi.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_UpdateExternalApi_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ExternalApi; +import com.google.cloud.apihub.v1.UpdateExternalApiRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateExternalApi { + + public static void main(String[] args) throws Exception { + asyncUpdateExternalApi(); + } + + public static void asyncUpdateExternalApi() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + UpdateExternalApiRequest request = + UpdateExternalApiRequest.newBuilder() + .setExternalApi(ExternalApi.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = apiHubClient.updateExternalApiCallable().futureCall(request); + // Do something. + ExternalApi response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHub_UpdateExternalApi_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateexternalapi/SyncUpdateExternalApi.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateexternalapi/SyncUpdateExternalApi.java new file mode 100644 index 000000000000..e03869256d21 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateexternalapi/SyncUpdateExternalApi.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_UpdateExternalApi_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ExternalApi; +import com.google.cloud.apihub.v1.UpdateExternalApiRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateExternalApi { + + public static void main(String[] args) throws Exception { + syncUpdateExternalApi(); + } + + public static void syncUpdateExternalApi() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + UpdateExternalApiRequest request = + UpdateExternalApiRequest.newBuilder() + .setExternalApi(ExternalApi.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ExternalApi response = apiHubClient.updateExternalApi(request); + } + } +} +// [END apihub_v1_generated_ApiHub_UpdateExternalApi_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateexternalapi/SyncUpdateExternalApiExternalapiFieldmask.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateexternalapi/SyncUpdateExternalApiExternalapiFieldmask.java new file mode 100644 index 000000000000..ce6230eb9ae4 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateexternalapi/SyncUpdateExternalApiExternalapiFieldmask.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_UpdateExternalApi_ExternalapiFieldmask_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.ExternalApi; +import com.google.protobuf.FieldMask; + +public class SyncUpdateExternalApiExternalapiFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateExternalApiExternalapiFieldmask(); + } + + public static void syncUpdateExternalApiExternalapiFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + ExternalApi externalApi = ExternalApi.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + ExternalApi response = apiHubClient.updateExternalApi(externalApi, updateMask); + } + } +} +// [END apihub_v1_generated_ApiHub_UpdateExternalApi_ExternalapiFieldmask_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updatespec/AsyncUpdateSpec.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updatespec/AsyncUpdateSpec.java new file mode 100644 index 000000000000..9667c4a4c4bd --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updatespec/AsyncUpdateSpec.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_UpdateSpec_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Spec; +import com.google.cloud.apihub.v1.UpdateSpecRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateSpec { + + public static void main(String[] args) throws Exception { + asyncUpdateSpec(); + } + + public static void asyncUpdateSpec() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + UpdateSpecRequest request = + UpdateSpecRequest.newBuilder() + .setSpec(Spec.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = apiHubClient.updateSpecCallable().futureCall(request); + // Do something. + Spec response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHub_UpdateSpec_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updatespec/SyncUpdateSpec.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updatespec/SyncUpdateSpec.java new file mode 100644 index 000000000000..9f895606be57 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updatespec/SyncUpdateSpec.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_UpdateSpec_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Spec; +import com.google.cloud.apihub.v1.UpdateSpecRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateSpec { + + public static void main(String[] args) throws Exception { + syncUpdateSpec(); + } + + public static void syncUpdateSpec() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + UpdateSpecRequest request = + UpdateSpecRequest.newBuilder() + .setSpec(Spec.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Spec response = apiHubClient.updateSpec(request); + } + } +} +// [END apihub_v1_generated_ApiHub_UpdateSpec_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updatespec/SyncUpdateSpecSpecFieldmask.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updatespec/SyncUpdateSpecSpecFieldmask.java new file mode 100644 index 000000000000..ec183d054152 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updatespec/SyncUpdateSpecSpecFieldmask.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_UpdateSpec_SpecFieldmask_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Spec; +import com.google.protobuf.FieldMask; + +public class SyncUpdateSpecSpecFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateSpecSpecFieldmask(); + } + + public static void syncUpdateSpecSpecFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + Spec spec = Spec.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Spec response = apiHubClient.updateSpec(spec, updateMask); + } + } +} +// [END apihub_v1_generated_ApiHub_UpdateSpec_SpecFieldmask_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateversion/AsyncUpdateVersion.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateversion/AsyncUpdateVersion.java new file mode 100644 index 000000000000..9ea15e8d5ce7 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateversion/AsyncUpdateVersion.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_UpdateVersion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.UpdateVersionRequest; +import com.google.cloud.apihub.v1.Version; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateVersion { + + public static void main(String[] args) throws Exception { + asyncUpdateVersion(); + } + + public static void asyncUpdateVersion() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + UpdateVersionRequest request = + UpdateVersionRequest.newBuilder() + .setVersion(Version.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = apiHubClient.updateVersionCallable().futureCall(request); + // Do something. + Version response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHub_UpdateVersion_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateversion/SyncUpdateVersion.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateversion/SyncUpdateVersion.java new file mode 100644 index 000000000000..4c8293e05bfe --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateversion/SyncUpdateVersion.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_UpdateVersion_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.UpdateVersionRequest; +import com.google.cloud.apihub.v1.Version; +import com.google.protobuf.FieldMask; + +public class SyncUpdateVersion { + + public static void main(String[] args) throws Exception { + syncUpdateVersion(); + } + + public static void syncUpdateVersion() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + UpdateVersionRequest request = + UpdateVersionRequest.newBuilder() + .setVersion(Version.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Version response = apiHubClient.updateVersion(request); + } + } +} +// [END apihub_v1_generated_ApiHub_UpdateVersion_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateversion/SyncUpdateVersionVersionFieldmask.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateversion/SyncUpdateVersionVersionFieldmask.java new file mode 100644 index 000000000000..b375f8e27e2b --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihub/updateversion/SyncUpdateVersionVersionFieldmask.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHub_UpdateVersion_VersionFieldmask_sync] +import com.google.cloud.apihub.v1.ApiHubClient; +import com.google.cloud.apihub.v1.Version; +import com.google.protobuf.FieldMask; + +public class SyncUpdateVersionVersionFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateVersionVersionFieldmask(); + } + + public static void syncUpdateVersionVersionFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubClient apiHubClient = ApiHubClient.create()) { + Version version = Version.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Version response = apiHubClient.updateVersion(version, updateMask); + } + } +} +// [END apihub_v1_generated_ApiHub_UpdateVersion_VersionFieldmask_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/create/SyncCreateSetCredentialsProvider.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..ce0fc203b618 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependencies_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.apihub.v1.ApiHubDependenciesClient; +import com.google.cloud.apihub.v1.ApiHubDependenciesSettings; +import com.google.cloud.apihub.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ApiHubDependenciesSettings apiHubDependenciesSettings = + ApiHubDependenciesSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + ApiHubDependenciesClient apiHubDependenciesClient = + ApiHubDependenciesClient.create(apiHubDependenciesSettings); + } +} +// [END apihub_v1_generated_ApiHubDependencies_Create_SetCredentialsProvider_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/create/SyncCreateSetCredentialsProvider1.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..e9633d2ab223 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependencies_Create_SetCredentialsProvider1_sync] +import com.google.cloud.apihub.v1.ApiHubDependenciesClient; +import com.google.cloud.apihub.v1.ApiHubDependenciesSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ApiHubDependenciesSettings apiHubDependenciesSettings = + ApiHubDependenciesSettings.newHttpJsonBuilder().build(); + ApiHubDependenciesClient apiHubDependenciesClient = + ApiHubDependenciesClient.create(apiHubDependenciesSettings); + } +} +// [END apihub_v1_generated_ApiHubDependencies_Create_SetCredentialsProvider1_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/create/SyncCreateSetEndpoint.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..f910d6ec05f2 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependencies_Create_SetEndpoint_sync] +import com.google.cloud.apihub.v1.ApiHubDependenciesClient; +import com.google.cloud.apihub.v1.ApiHubDependenciesSettings; +import com.google.cloud.apihub.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ApiHubDependenciesSettings apiHubDependenciesSettings = + ApiHubDependenciesSettings.newBuilder().setEndpoint(myEndpoint).build(); + ApiHubDependenciesClient apiHubDependenciesClient = + ApiHubDependenciesClient.create(apiHubDependenciesSettings); + } +} +// [END apihub_v1_generated_ApiHubDependencies_Create_SetEndpoint_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/createdependency/AsyncCreateDependency.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/createdependency/AsyncCreateDependency.java new file mode 100644 index 000000000000..27639fe72649 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/createdependency/AsyncCreateDependency.java @@ -0,0 +1,52 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependencies_CreateDependency_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubDependenciesClient; +import com.google.cloud.apihub.v1.CreateDependencyRequest; +import com.google.cloud.apihub.v1.Dependency; +import com.google.cloud.apihub.v1.LocationName; + +public class AsyncCreateDependency { + + public static void main(String[] args) throws Exception { + asyncCreateDependency(); + } + + public static void asyncCreateDependency() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + CreateDependencyRequest request = + CreateDependencyRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setDependencyId("dependencyId503788998") + .setDependency(Dependency.newBuilder().build()) + .build(); + ApiFuture future = + apiHubDependenciesClient.createDependencyCallable().futureCall(request); + // Do something. + Dependency response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHubDependencies_CreateDependency_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/createdependency/SyncCreateDependency.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/createdependency/SyncCreateDependency.java new file mode 100644 index 000000000000..285c540882ed --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/createdependency/SyncCreateDependency.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependencies_CreateDependency_sync] +import com.google.cloud.apihub.v1.ApiHubDependenciesClient; +import com.google.cloud.apihub.v1.CreateDependencyRequest; +import com.google.cloud.apihub.v1.Dependency; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncCreateDependency { + + public static void main(String[] args) throws Exception { + syncCreateDependency(); + } + + public static void syncCreateDependency() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + CreateDependencyRequest request = + CreateDependencyRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setDependencyId("dependencyId503788998") + .setDependency(Dependency.newBuilder().build()) + .build(); + Dependency response = apiHubDependenciesClient.createDependency(request); + } + } +} +// [END apihub_v1_generated_ApiHubDependencies_CreateDependency_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/createdependency/SyncCreateDependencyLocationnameDependencyString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/createdependency/SyncCreateDependencyLocationnameDependencyString.java new file mode 100644 index 000000000000..727b3350a515 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/createdependency/SyncCreateDependencyLocationnameDependencyString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependencies_CreateDependency_LocationnameDependencyString_sync] +import com.google.cloud.apihub.v1.ApiHubDependenciesClient; +import com.google.cloud.apihub.v1.Dependency; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncCreateDependencyLocationnameDependencyString { + + public static void main(String[] args) throws Exception { + syncCreateDependencyLocationnameDependencyString(); + } + + public static void syncCreateDependencyLocationnameDependencyString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Dependency dependency = Dependency.newBuilder().build(); + String dependencyId = "dependencyId503788998"; + Dependency response = + apiHubDependenciesClient.createDependency(parent, dependency, dependencyId); + } + } +} +// [END apihub_v1_generated_ApiHubDependencies_CreateDependency_LocationnameDependencyString_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/createdependency/SyncCreateDependencyStringDependencyString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/createdependency/SyncCreateDependencyStringDependencyString.java new file mode 100644 index 000000000000..759f0ca5da9a --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/createdependency/SyncCreateDependencyStringDependencyString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependencies_CreateDependency_StringDependencyString_sync] +import com.google.cloud.apihub.v1.ApiHubDependenciesClient; +import com.google.cloud.apihub.v1.Dependency; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncCreateDependencyStringDependencyString { + + public static void main(String[] args) throws Exception { + syncCreateDependencyStringDependencyString(); + } + + public static void syncCreateDependencyStringDependencyString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + Dependency dependency = Dependency.newBuilder().build(); + String dependencyId = "dependencyId503788998"; + Dependency response = + apiHubDependenciesClient.createDependency(parent, dependency, dependencyId); + } + } +} +// [END apihub_v1_generated_ApiHubDependencies_CreateDependency_StringDependencyString_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/deletedependency/AsyncDeleteDependency.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/deletedependency/AsyncDeleteDependency.java new file mode 100644 index 000000000000..6063fd2927f9 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/deletedependency/AsyncDeleteDependency.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependencies_DeleteDependency_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubDependenciesClient; +import com.google.cloud.apihub.v1.DeleteDependencyRequest; +import com.google.cloud.apihub.v1.DependencyName; +import com.google.protobuf.Empty; + +public class AsyncDeleteDependency { + + public static void main(String[] args) throws Exception { + asyncDeleteDependency(); + } + + public static void asyncDeleteDependency() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + DeleteDependencyRequest request = + DeleteDependencyRequest.newBuilder() + .setName(DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString()) + .build(); + ApiFuture future = + apiHubDependenciesClient.deleteDependencyCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END apihub_v1_generated_ApiHubDependencies_DeleteDependency_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/deletedependency/SyncDeleteDependency.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/deletedependency/SyncDeleteDependency.java new file mode 100644 index 000000000000..2f85987e795d --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/deletedependency/SyncDeleteDependency.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependencies_DeleteDependency_sync] +import com.google.cloud.apihub.v1.ApiHubDependenciesClient; +import com.google.cloud.apihub.v1.DeleteDependencyRequest; +import com.google.cloud.apihub.v1.DependencyName; +import com.google.protobuf.Empty; + +public class SyncDeleteDependency { + + public static void main(String[] args) throws Exception { + syncDeleteDependency(); + } + + public static void syncDeleteDependency() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + DeleteDependencyRequest request = + DeleteDependencyRequest.newBuilder() + .setName(DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString()) + .build(); + apiHubDependenciesClient.deleteDependency(request); + } + } +} +// [END apihub_v1_generated_ApiHubDependencies_DeleteDependency_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/deletedependency/SyncDeleteDependencyDependencyname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/deletedependency/SyncDeleteDependencyDependencyname.java new file mode 100644 index 000000000000..a6f85a9d7308 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/deletedependency/SyncDeleteDependencyDependencyname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependencies_DeleteDependency_Dependencyname_sync] +import com.google.cloud.apihub.v1.ApiHubDependenciesClient; +import com.google.cloud.apihub.v1.DependencyName; +import com.google.protobuf.Empty; + +public class SyncDeleteDependencyDependencyname { + + public static void main(String[] args) throws Exception { + syncDeleteDependencyDependencyname(); + } + + public static void syncDeleteDependencyDependencyname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + DependencyName name = DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]"); + apiHubDependenciesClient.deleteDependency(name); + } + } +} +// [END apihub_v1_generated_ApiHubDependencies_DeleteDependency_Dependencyname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/deletedependency/SyncDeleteDependencyString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/deletedependency/SyncDeleteDependencyString.java new file mode 100644 index 000000000000..fffd6ecd9d95 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/deletedependency/SyncDeleteDependencyString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependencies_DeleteDependency_String_sync] +import com.google.cloud.apihub.v1.ApiHubDependenciesClient; +import com.google.cloud.apihub.v1.DependencyName; +import com.google.protobuf.Empty; + +public class SyncDeleteDependencyString { + + public static void main(String[] args) throws Exception { + syncDeleteDependencyString(); + } + + public static void syncDeleteDependencyString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + String name = DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString(); + apiHubDependenciesClient.deleteDependency(name); + } + } +} +// [END apihub_v1_generated_ApiHubDependencies_DeleteDependency_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/getdependency/AsyncGetDependency.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/getdependency/AsyncGetDependency.java new file mode 100644 index 000000000000..71c8398b0a34 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/getdependency/AsyncGetDependency.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependencies_GetDependency_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubDependenciesClient; +import com.google.cloud.apihub.v1.Dependency; +import com.google.cloud.apihub.v1.DependencyName; +import com.google.cloud.apihub.v1.GetDependencyRequest; + +public class AsyncGetDependency { + + public static void main(String[] args) throws Exception { + asyncGetDependency(); + } + + public static void asyncGetDependency() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + GetDependencyRequest request = + GetDependencyRequest.newBuilder() + .setName(DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString()) + .build(); + ApiFuture future = + apiHubDependenciesClient.getDependencyCallable().futureCall(request); + // Do something. + Dependency response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHubDependencies_GetDependency_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/getdependency/SyncGetDependency.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/getdependency/SyncGetDependency.java new file mode 100644 index 000000000000..0e6e6dd5398c --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/getdependency/SyncGetDependency.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependencies_GetDependency_sync] +import com.google.cloud.apihub.v1.ApiHubDependenciesClient; +import com.google.cloud.apihub.v1.Dependency; +import com.google.cloud.apihub.v1.DependencyName; +import com.google.cloud.apihub.v1.GetDependencyRequest; + +public class SyncGetDependency { + + public static void main(String[] args) throws Exception { + syncGetDependency(); + } + + public static void syncGetDependency() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + GetDependencyRequest request = + GetDependencyRequest.newBuilder() + .setName(DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString()) + .build(); + Dependency response = apiHubDependenciesClient.getDependency(request); + } + } +} +// [END apihub_v1_generated_ApiHubDependencies_GetDependency_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/getdependency/SyncGetDependencyDependencyname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/getdependency/SyncGetDependencyDependencyname.java new file mode 100644 index 000000000000..2fa8bd5e30d7 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/getdependency/SyncGetDependencyDependencyname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependencies_GetDependency_Dependencyname_sync] +import com.google.cloud.apihub.v1.ApiHubDependenciesClient; +import com.google.cloud.apihub.v1.Dependency; +import com.google.cloud.apihub.v1.DependencyName; + +public class SyncGetDependencyDependencyname { + + public static void main(String[] args) throws Exception { + syncGetDependencyDependencyname(); + } + + public static void syncGetDependencyDependencyname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + DependencyName name = DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]"); + Dependency response = apiHubDependenciesClient.getDependency(name); + } + } +} +// [END apihub_v1_generated_ApiHubDependencies_GetDependency_Dependencyname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/getdependency/SyncGetDependencyString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/getdependency/SyncGetDependencyString.java new file mode 100644 index 000000000000..5a26cd1981cf --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/getdependency/SyncGetDependencyString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependencies_GetDependency_String_sync] +import com.google.cloud.apihub.v1.ApiHubDependenciesClient; +import com.google.cloud.apihub.v1.Dependency; +import com.google.cloud.apihub.v1.DependencyName; + +public class SyncGetDependencyString { + + public static void main(String[] args) throws Exception { + syncGetDependencyString(); + } + + public static void syncGetDependencyString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + String name = DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString(); + Dependency response = apiHubDependenciesClient.getDependency(name); + } + } +} +// [END apihub_v1_generated_ApiHubDependencies_GetDependency_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/getlocation/AsyncGetLocation.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..6424fb601990 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/getlocation/AsyncGetLocation.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependencies_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubDependenciesClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = + apiHubDependenciesClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHubDependencies_GetLocation_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/getlocation/SyncGetLocation.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..354f0378f57a --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependencies_GetLocation_sync] +import com.google.cloud.apihub.v1.ApiHubDependenciesClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = apiHubDependenciesClient.getLocation(request); + } + } +} +// [END apihub_v1_generated_ApiHubDependencies_GetLocation_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listdependencies/AsyncListDependencies.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listdependencies/AsyncListDependencies.java new file mode 100644 index 000000000000..c2d7e9e789b2 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listdependencies/AsyncListDependencies.java @@ -0,0 +1,55 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependencies_ListDependencies_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubDependenciesClient; +import com.google.cloud.apihub.v1.Dependency; +import com.google.cloud.apihub.v1.ListDependenciesRequest; +import com.google.cloud.apihub.v1.LocationName; + +public class AsyncListDependencies { + + public static void main(String[] args) throws Exception { + asyncListDependencies(); + } + + public static void asyncListDependencies() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + ListDependenciesRequest request = + ListDependenciesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + apiHubDependenciesClient.listDependenciesPagedCallable().futureCall(request); + // Do something. + for (Dependency element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHubDependencies_ListDependencies_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listdependencies/AsyncListDependenciesPaged.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listdependencies/AsyncListDependenciesPaged.java new file mode 100644 index 000000000000..7d0c75c2579b --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listdependencies/AsyncListDependenciesPaged.java @@ -0,0 +1,63 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependencies_ListDependencies_Paged_async] +import com.google.cloud.apihub.v1.ApiHubDependenciesClient; +import com.google.cloud.apihub.v1.Dependency; +import com.google.cloud.apihub.v1.ListDependenciesRequest; +import com.google.cloud.apihub.v1.ListDependenciesResponse; +import com.google.cloud.apihub.v1.LocationName; +import com.google.common.base.Strings; + +public class AsyncListDependenciesPaged { + + public static void main(String[] args) throws Exception { + asyncListDependenciesPaged(); + } + + public static void asyncListDependenciesPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + ListDependenciesRequest request = + ListDependenciesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListDependenciesResponse response = + apiHubDependenciesClient.listDependenciesCallable().call(request); + for (Dependency element : response.getDependenciesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END apihub_v1_generated_ApiHubDependencies_ListDependencies_Paged_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listdependencies/SyncListDependencies.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listdependencies/SyncListDependencies.java new file mode 100644 index 000000000000..b9c5d9314a27 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listdependencies/SyncListDependencies.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependencies_ListDependencies_sync] +import com.google.cloud.apihub.v1.ApiHubDependenciesClient; +import com.google.cloud.apihub.v1.Dependency; +import com.google.cloud.apihub.v1.ListDependenciesRequest; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncListDependencies { + + public static void main(String[] args) throws Exception { + syncListDependencies(); + } + + public static void syncListDependencies() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + ListDependenciesRequest request = + ListDependenciesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Dependency element : apiHubDependenciesClient.listDependencies(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHubDependencies_ListDependencies_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listdependencies/SyncListDependenciesLocationname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listdependencies/SyncListDependenciesLocationname.java new file mode 100644 index 000000000000..9e402868dcc8 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listdependencies/SyncListDependenciesLocationname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependencies_ListDependencies_Locationname_sync] +import com.google.cloud.apihub.v1.ApiHubDependenciesClient; +import com.google.cloud.apihub.v1.Dependency; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncListDependenciesLocationname { + + public static void main(String[] args) throws Exception { + syncListDependenciesLocationname(); + } + + public static void syncListDependenciesLocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (Dependency element : apiHubDependenciesClient.listDependencies(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHubDependencies_ListDependencies_Locationname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listdependencies/SyncListDependenciesString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listdependencies/SyncListDependenciesString.java new file mode 100644 index 000000000000..87a2ec02d1ea --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listdependencies/SyncListDependenciesString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependencies_ListDependencies_String_sync] +import com.google.cloud.apihub.v1.ApiHubDependenciesClient; +import com.google.cloud.apihub.v1.Dependency; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncListDependenciesString { + + public static void main(String[] args) throws Exception { + syncListDependenciesString(); + } + + public static void syncListDependenciesString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (Dependency element : apiHubDependenciesClient.listDependencies(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHubDependencies_ListDependencies_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listlocations/AsyncListLocations.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..aa8a2cd12420 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listlocations/AsyncListLocations.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependencies_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubDependenciesClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + apiHubDependenciesClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHubDependencies_ListLocations_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listlocations/AsyncListLocationsPaged.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..d9f326ac1919 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependencies_ListLocations_Paged_async] +import com.google.cloud.apihub.v1.ApiHubDependenciesClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = + apiHubDependenciesClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END apihub_v1_generated_ApiHubDependencies_ListLocations_Paged_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listlocations/SyncListLocations.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..f289262fc48a --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependencies_ListLocations_sync] +import com.google.cloud.apihub.v1.ApiHubDependenciesClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : apiHubDependenciesClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHubDependencies_ListLocations_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/updatedependency/AsyncUpdateDependency.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/updatedependency/AsyncUpdateDependency.java new file mode 100644 index 000000000000..ee0844958c8c --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/updatedependency/AsyncUpdateDependency.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependencies_UpdateDependency_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubDependenciesClient; +import com.google.cloud.apihub.v1.Dependency; +import com.google.cloud.apihub.v1.UpdateDependencyRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateDependency { + + public static void main(String[] args) throws Exception { + asyncUpdateDependency(); + } + + public static void asyncUpdateDependency() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + UpdateDependencyRequest request = + UpdateDependencyRequest.newBuilder() + .setDependency(Dependency.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = + apiHubDependenciesClient.updateDependencyCallable().futureCall(request); + // Do something. + Dependency response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHubDependencies_UpdateDependency_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/updatedependency/SyncUpdateDependency.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/updatedependency/SyncUpdateDependency.java new file mode 100644 index 000000000000..d889ae4dd45f --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/updatedependency/SyncUpdateDependency.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependencies_UpdateDependency_sync] +import com.google.cloud.apihub.v1.ApiHubDependenciesClient; +import com.google.cloud.apihub.v1.Dependency; +import com.google.cloud.apihub.v1.UpdateDependencyRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateDependency { + + public static void main(String[] args) throws Exception { + syncUpdateDependency(); + } + + public static void syncUpdateDependency() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + UpdateDependencyRequest request = + UpdateDependencyRequest.newBuilder() + .setDependency(Dependency.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Dependency response = apiHubDependenciesClient.updateDependency(request); + } + } +} +// [END apihub_v1_generated_ApiHubDependencies_UpdateDependency_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/updatedependency/SyncUpdateDependencyDependencyFieldmask.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/updatedependency/SyncUpdateDependencyDependencyFieldmask.java new file mode 100644 index 000000000000..9c407eb08cdf --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependencies/updatedependency/SyncUpdateDependencyDependencyFieldmask.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependencies_UpdateDependency_DependencyFieldmask_sync] +import com.google.cloud.apihub.v1.ApiHubDependenciesClient; +import com.google.cloud.apihub.v1.Dependency; +import com.google.protobuf.FieldMask; + +public class SyncUpdateDependencyDependencyFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateDependencyDependencyFieldmask(); + } + + public static void syncUpdateDependencyDependencyFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + Dependency dependency = Dependency.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Dependency response = apiHubDependenciesClient.updateDependency(dependency, updateMask); + } + } +} +// [END apihub_v1_generated_ApiHubDependencies_UpdateDependency_DependencyFieldmask_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependenciessettings/createdependency/SyncCreateDependency.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependenciessettings/createdependency/SyncCreateDependency.java new file mode 100644 index 000000000000..e1878b56f6be --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubdependenciessettings/createdependency/SyncCreateDependency.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubDependenciesSettings_CreateDependency_sync] +import com.google.cloud.apihub.v1.ApiHubDependenciesSettings; +import java.time.Duration; + +public class SyncCreateDependency { + + public static void main(String[] args) throws Exception { + syncCreateDependency(); + } + + public static void syncCreateDependency() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ApiHubDependenciesSettings.Builder apiHubDependenciesSettingsBuilder = + ApiHubDependenciesSettings.newBuilder(); + apiHubDependenciesSettingsBuilder + .createDependencySettings() + .setRetrySettings( + apiHubDependenciesSettingsBuilder + .createDependencySettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + ApiHubDependenciesSettings apiHubDependenciesSettings = + apiHubDependenciesSettingsBuilder.build(); + } +} +// [END apihub_v1_generated_ApiHubDependenciesSettings_CreateDependency_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/create/SyncCreateSetCredentialsProvider.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..a634422a51fe --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubPlugin_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.apihub.v1.ApiHubPluginClient; +import com.google.cloud.apihub.v1.ApiHubPluginSettings; +import com.google.cloud.apihub.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ApiHubPluginSettings apiHubPluginSettings = + ApiHubPluginSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create(apiHubPluginSettings); + } +} +// [END apihub_v1_generated_ApiHubPlugin_Create_SetCredentialsProvider_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/create/SyncCreateSetCredentialsProvider1.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..ed333eb69ada --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,39 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubPlugin_Create_SetCredentialsProvider1_sync] +import com.google.cloud.apihub.v1.ApiHubPluginClient; +import com.google.cloud.apihub.v1.ApiHubPluginSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ApiHubPluginSettings apiHubPluginSettings = ApiHubPluginSettings.newHttpJsonBuilder().build(); + ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create(apiHubPluginSettings); + } +} +// [END apihub_v1_generated_ApiHubPlugin_Create_SetCredentialsProvider1_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/create/SyncCreateSetEndpoint.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..d69597165d64 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubPlugin_Create_SetEndpoint_sync] +import com.google.cloud.apihub.v1.ApiHubPluginClient; +import com.google.cloud.apihub.v1.ApiHubPluginSettings; +import com.google.cloud.apihub.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ApiHubPluginSettings apiHubPluginSettings = + ApiHubPluginSettings.newBuilder().setEndpoint(myEndpoint).build(); + ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create(apiHubPluginSettings); + } +} +// [END apihub_v1_generated_ApiHubPlugin_Create_SetEndpoint_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/disableplugin/AsyncDisablePlugin.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/disableplugin/AsyncDisablePlugin.java new file mode 100644 index 000000000000..9155cf25734f --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/disableplugin/AsyncDisablePlugin.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubPlugin_DisablePlugin_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubPluginClient; +import com.google.cloud.apihub.v1.DisablePluginRequest; +import com.google.cloud.apihub.v1.Plugin; +import com.google.cloud.apihub.v1.PluginName; + +public class AsyncDisablePlugin { + + public static void main(String[] args) throws Exception { + asyncDisablePlugin(); + } + + public static void asyncDisablePlugin() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) { + DisablePluginRequest request = + DisablePluginRequest.newBuilder() + .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .build(); + ApiFuture future = apiHubPluginClient.disablePluginCallable().futureCall(request); + // Do something. + Plugin response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHubPlugin_DisablePlugin_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/disableplugin/SyncDisablePlugin.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/disableplugin/SyncDisablePlugin.java new file mode 100644 index 000000000000..9d1c5a7b0497 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/disableplugin/SyncDisablePlugin.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubPlugin_DisablePlugin_sync] +import com.google.cloud.apihub.v1.ApiHubPluginClient; +import com.google.cloud.apihub.v1.DisablePluginRequest; +import com.google.cloud.apihub.v1.Plugin; +import com.google.cloud.apihub.v1.PluginName; + +public class SyncDisablePlugin { + + public static void main(String[] args) throws Exception { + syncDisablePlugin(); + } + + public static void syncDisablePlugin() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) { + DisablePluginRequest request = + DisablePluginRequest.newBuilder() + .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .build(); + Plugin response = apiHubPluginClient.disablePlugin(request); + } + } +} +// [END apihub_v1_generated_ApiHubPlugin_DisablePlugin_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/disableplugin/SyncDisablePluginPluginname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/disableplugin/SyncDisablePluginPluginname.java new file mode 100644 index 000000000000..d9455017c638 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/disableplugin/SyncDisablePluginPluginname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubPlugin_DisablePlugin_Pluginname_sync] +import com.google.cloud.apihub.v1.ApiHubPluginClient; +import com.google.cloud.apihub.v1.Plugin; +import com.google.cloud.apihub.v1.PluginName; + +public class SyncDisablePluginPluginname { + + public static void main(String[] args) throws Exception { + syncDisablePluginPluginname(); + } + + public static void syncDisablePluginPluginname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) { + PluginName name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]"); + Plugin response = apiHubPluginClient.disablePlugin(name); + } + } +} +// [END apihub_v1_generated_ApiHubPlugin_DisablePlugin_Pluginname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/disableplugin/SyncDisablePluginString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/disableplugin/SyncDisablePluginString.java new file mode 100644 index 000000000000..967e0b29d920 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/disableplugin/SyncDisablePluginString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubPlugin_DisablePlugin_String_sync] +import com.google.cloud.apihub.v1.ApiHubPluginClient; +import com.google.cloud.apihub.v1.Plugin; +import com.google.cloud.apihub.v1.PluginName; + +public class SyncDisablePluginString { + + public static void main(String[] args) throws Exception { + syncDisablePluginString(); + } + + public static void syncDisablePluginString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) { + String name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString(); + Plugin response = apiHubPluginClient.disablePlugin(name); + } + } +} +// [END apihub_v1_generated_ApiHubPlugin_DisablePlugin_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/enableplugin/AsyncEnablePlugin.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/enableplugin/AsyncEnablePlugin.java new file mode 100644 index 000000000000..aea1b2d56f74 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/enableplugin/AsyncEnablePlugin.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubPlugin_EnablePlugin_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubPluginClient; +import com.google.cloud.apihub.v1.EnablePluginRequest; +import com.google.cloud.apihub.v1.Plugin; +import com.google.cloud.apihub.v1.PluginName; + +public class AsyncEnablePlugin { + + public static void main(String[] args) throws Exception { + asyncEnablePlugin(); + } + + public static void asyncEnablePlugin() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) { + EnablePluginRequest request = + EnablePluginRequest.newBuilder() + .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .build(); + ApiFuture future = apiHubPluginClient.enablePluginCallable().futureCall(request); + // Do something. + Plugin response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHubPlugin_EnablePlugin_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/enableplugin/SyncEnablePlugin.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/enableplugin/SyncEnablePlugin.java new file mode 100644 index 000000000000..6f85e5c900ff --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/enableplugin/SyncEnablePlugin.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubPlugin_EnablePlugin_sync] +import com.google.cloud.apihub.v1.ApiHubPluginClient; +import com.google.cloud.apihub.v1.EnablePluginRequest; +import com.google.cloud.apihub.v1.Plugin; +import com.google.cloud.apihub.v1.PluginName; + +public class SyncEnablePlugin { + + public static void main(String[] args) throws Exception { + syncEnablePlugin(); + } + + public static void syncEnablePlugin() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) { + EnablePluginRequest request = + EnablePluginRequest.newBuilder() + .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .build(); + Plugin response = apiHubPluginClient.enablePlugin(request); + } + } +} +// [END apihub_v1_generated_ApiHubPlugin_EnablePlugin_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/enableplugin/SyncEnablePluginPluginname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/enableplugin/SyncEnablePluginPluginname.java new file mode 100644 index 000000000000..4b0193cc093a --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/enableplugin/SyncEnablePluginPluginname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubPlugin_EnablePlugin_Pluginname_sync] +import com.google.cloud.apihub.v1.ApiHubPluginClient; +import com.google.cloud.apihub.v1.Plugin; +import com.google.cloud.apihub.v1.PluginName; + +public class SyncEnablePluginPluginname { + + public static void main(String[] args) throws Exception { + syncEnablePluginPluginname(); + } + + public static void syncEnablePluginPluginname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) { + PluginName name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]"); + Plugin response = apiHubPluginClient.enablePlugin(name); + } + } +} +// [END apihub_v1_generated_ApiHubPlugin_EnablePlugin_Pluginname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/enableplugin/SyncEnablePluginString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/enableplugin/SyncEnablePluginString.java new file mode 100644 index 000000000000..12bdf6f1a3d1 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/enableplugin/SyncEnablePluginString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubPlugin_EnablePlugin_String_sync] +import com.google.cloud.apihub.v1.ApiHubPluginClient; +import com.google.cloud.apihub.v1.Plugin; +import com.google.cloud.apihub.v1.PluginName; + +public class SyncEnablePluginString { + + public static void main(String[] args) throws Exception { + syncEnablePluginString(); + } + + public static void syncEnablePluginString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) { + String name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString(); + Plugin response = apiHubPluginClient.enablePlugin(name); + } + } +} +// [END apihub_v1_generated_ApiHubPlugin_EnablePlugin_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/getlocation/AsyncGetLocation.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..c13365e3095a --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/getlocation/AsyncGetLocation.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubPlugin_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubPluginClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = apiHubPluginClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHubPlugin_GetLocation_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/getlocation/SyncGetLocation.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..84602b0612e5 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubPlugin_GetLocation_sync] +import com.google.cloud.apihub.v1.ApiHubPluginClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = apiHubPluginClient.getLocation(request); + } + } +} +// [END apihub_v1_generated_ApiHubPlugin_GetLocation_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/getplugin/AsyncGetPlugin.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/getplugin/AsyncGetPlugin.java new file mode 100644 index 000000000000..81f899a11179 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/getplugin/AsyncGetPlugin.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubPlugin_GetPlugin_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubPluginClient; +import com.google.cloud.apihub.v1.GetPluginRequest; +import com.google.cloud.apihub.v1.Plugin; +import com.google.cloud.apihub.v1.PluginName; + +public class AsyncGetPlugin { + + public static void main(String[] args) throws Exception { + asyncGetPlugin(); + } + + public static void asyncGetPlugin() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) { + GetPluginRequest request = + GetPluginRequest.newBuilder() + .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .build(); + ApiFuture future = apiHubPluginClient.getPluginCallable().futureCall(request); + // Do something. + Plugin response = future.get(); + } + } +} +// [END apihub_v1_generated_ApiHubPlugin_GetPlugin_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/getplugin/SyncGetPlugin.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/getplugin/SyncGetPlugin.java new file mode 100644 index 000000000000..5cc1d2cd0616 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/getplugin/SyncGetPlugin.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubPlugin_GetPlugin_sync] +import com.google.cloud.apihub.v1.ApiHubPluginClient; +import com.google.cloud.apihub.v1.GetPluginRequest; +import com.google.cloud.apihub.v1.Plugin; +import com.google.cloud.apihub.v1.PluginName; + +public class SyncGetPlugin { + + public static void main(String[] args) throws Exception { + syncGetPlugin(); + } + + public static void syncGetPlugin() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) { + GetPluginRequest request = + GetPluginRequest.newBuilder() + .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .build(); + Plugin response = apiHubPluginClient.getPlugin(request); + } + } +} +// [END apihub_v1_generated_ApiHubPlugin_GetPlugin_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/getplugin/SyncGetPluginPluginname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/getplugin/SyncGetPluginPluginname.java new file mode 100644 index 000000000000..b9fc2c43a077 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/getplugin/SyncGetPluginPluginname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubPlugin_GetPlugin_Pluginname_sync] +import com.google.cloud.apihub.v1.ApiHubPluginClient; +import com.google.cloud.apihub.v1.Plugin; +import com.google.cloud.apihub.v1.PluginName; + +public class SyncGetPluginPluginname { + + public static void main(String[] args) throws Exception { + syncGetPluginPluginname(); + } + + public static void syncGetPluginPluginname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) { + PluginName name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]"); + Plugin response = apiHubPluginClient.getPlugin(name); + } + } +} +// [END apihub_v1_generated_ApiHubPlugin_GetPlugin_Pluginname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/getplugin/SyncGetPluginString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/getplugin/SyncGetPluginString.java new file mode 100644 index 000000000000..8235e4dc8fa1 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/getplugin/SyncGetPluginString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubPlugin_GetPlugin_String_sync] +import com.google.cloud.apihub.v1.ApiHubPluginClient; +import com.google.cloud.apihub.v1.Plugin; +import com.google.cloud.apihub.v1.PluginName; + +public class SyncGetPluginString { + + public static void main(String[] args) throws Exception { + syncGetPluginString(); + } + + public static void syncGetPluginString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) { + String name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString(); + Plugin response = apiHubPluginClient.getPlugin(name); + } + } +} +// [END apihub_v1_generated_ApiHubPlugin_GetPlugin_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/listlocations/AsyncListLocations.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..9a20e58ea343 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/listlocations/AsyncListLocations.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubPlugin_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubPluginClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + apiHubPluginClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHubPlugin_ListLocations_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/listlocations/AsyncListLocationsPaged.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..869b3cfd84c5 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,61 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubPlugin_ListLocations_Paged_async] +import com.google.cloud.apihub.v1.ApiHubPluginClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = apiHubPluginClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END apihub_v1_generated_ApiHubPlugin_ListLocations_Paged_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/listlocations/SyncListLocations.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..3d5ab15d3f30 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubplugin/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubPlugin_ListLocations_sync] +import com.google.cloud.apihub.v1.ApiHubPluginClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : apiHubPluginClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_ApiHubPlugin_ListLocations_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubpluginsettings/getplugin/SyncGetPlugin.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubpluginsettings/getplugin/SyncGetPlugin.java new file mode 100644 index 000000000000..478da87b2853 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubpluginsettings/getplugin/SyncGetPlugin.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubPluginSettings_GetPlugin_sync] +import com.google.cloud.apihub.v1.ApiHubPluginSettings; +import java.time.Duration; + +public class SyncGetPlugin { + + public static void main(String[] args) throws Exception { + syncGetPlugin(); + } + + public static void syncGetPlugin() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ApiHubPluginSettings.Builder apiHubPluginSettingsBuilder = ApiHubPluginSettings.newBuilder(); + apiHubPluginSettingsBuilder + .getPluginSettings() + .setRetrySettings( + apiHubPluginSettingsBuilder + .getPluginSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + ApiHubPluginSettings apiHubPluginSettings = apiHubPluginSettingsBuilder.build(); + } +} +// [END apihub_v1_generated_ApiHubPluginSettings_GetPlugin_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubsettings/createapi/SyncCreateApi.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubsettings/createapi/SyncCreateApi.java new file mode 100644 index 000000000000..e57d8e9f4bb9 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/apihubsettings/createapi/SyncCreateApi.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ApiHubSettings_CreateApi_sync] +import com.google.cloud.apihub.v1.ApiHubSettings; +import java.time.Duration; + +public class SyncCreateApi { + + public static void main(String[] args) throws Exception { + syncCreateApi(); + } + + public static void syncCreateApi() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ApiHubSettings.Builder apiHubSettingsBuilder = ApiHubSettings.newBuilder(); + apiHubSettingsBuilder + .createApiSettings() + .setRetrySettings( + apiHubSettingsBuilder + .createApiSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + ApiHubSettings apiHubSettings = apiHubSettingsBuilder.build(); + } +} +// [END apihub_v1_generated_ApiHubSettings_CreateApi_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/create/SyncCreateSetCredentialsProvider.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..e930e6e094d3 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_HostProjectRegistrationService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient; +import com.google.cloud.apihub.v1.HostProjectRegistrationServiceSettings; +import com.google.cloud.apihub.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + HostProjectRegistrationServiceSettings hostProjectRegistrationServiceSettings = + HostProjectRegistrationServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = + HostProjectRegistrationServiceClient.create(hostProjectRegistrationServiceSettings); + } +} +// [END apihub_v1_generated_HostProjectRegistrationService_Create_SetCredentialsProvider_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/create/SyncCreateSetCredentialsProvider1.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..2cbf64db33f3 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_HostProjectRegistrationService_Create_SetCredentialsProvider1_sync] +import com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient; +import com.google.cloud.apihub.v1.HostProjectRegistrationServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + HostProjectRegistrationServiceSettings hostProjectRegistrationServiceSettings = + HostProjectRegistrationServiceSettings.newHttpJsonBuilder().build(); + HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = + HostProjectRegistrationServiceClient.create(hostProjectRegistrationServiceSettings); + } +} +// [END apihub_v1_generated_HostProjectRegistrationService_Create_SetCredentialsProvider1_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/create/SyncCreateSetEndpoint.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..b22c8a9bcd05 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_HostProjectRegistrationService_Create_SetEndpoint_sync] +import com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient; +import com.google.cloud.apihub.v1.HostProjectRegistrationServiceSettings; +import com.google.cloud.apihub.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + HostProjectRegistrationServiceSettings hostProjectRegistrationServiceSettings = + HostProjectRegistrationServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = + HostProjectRegistrationServiceClient.create(hostProjectRegistrationServiceSettings); + } +} +// [END apihub_v1_generated_HostProjectRegistrationService_Create_SetEndpoint_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/createhostprojectregistration/AsyncCreateHostProjectRegistration.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/createhostprojectregistration/AsyncCreateHostProjectRegistration.java new file mode 100644 index 000000000000..6b0021909286 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/createhostprojectregistration/AsyncCreateHostProjectRegistration.java @@ -0,0 +1,55 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_HostProjectRegistrationService_CreateHostProjectRegistration_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest; +import com.google.cloud.apihub.v1.HostProjectRegistration; +import com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient; +import com.google.cloud.apihub.v1.LocationName; + +public class AsyncCreateHostProjectRegistration { + + public static void main(String[] args) throws Exception { + asyncCreateHostProjectRegistration(); + } + + public static void asyncCreateHostProjectRegistration() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = + HostProjectRegistrationServiceClient.create()) { + CreateHostProjectRegistrationRequest request = + CreateHostProjectRegistrationRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setHostProjectRegistrationId("hostProjectRegistrationId1352651365") + .setHostProjectRegistration(HostProjectRegistration.newBuilder().build()) + .build(); + ApiFuture future = + hostProjectRegistrationServiceClient + .createHostProjectRegistrationCallable() + .futureCall(request); + // Do something. + HostProjectRegistration response = future.get(); + } + } +} +// [END apihub_v1_generated_HostProjectRegistrationService_CreateHostProjectRegistration_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/createhostprojectregistration/SyncCreateHostProjectRegistration.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/createhostprojectregistration/SyncCreateHostProjectRegistration.java new file mode 100644 index 000000000000..8b38bb9e9fe7 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/createhostprojectregistration/SyncCreateHostProjectRegistration.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_HostProjectRegistrationService_CreateHostProjectRegistration_sync] +import com.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest; +import com.google.cloud.apihub.v1.HostProjectRegistration; +import com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncCreateHostProjectRegistration { + + public static void main(String[] args) throws Exception { + syncCreateHostProjectRegistration(); + } + + public static void syncCreateHostProjectRegistration() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = + HostProjectRegistrationServiceClient.create()) { + CreateHostProjectRegistrationRequest request = + CreateHostProjectRegistrationRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setHostProjectRegistrationId("hostProjectRegistrationId1352651365") + .setHostProjectRegistration(HostProjectRegistration.newBuilder().build()) + .build(); + HostProjectRegistration response = + hostProjectRegistrationServiceClient.createHostProjectRegistration(request); + } + } +} +// [END apihub_v1_generated_HostProjectRegistrationService_CreateHostProjectRegistration_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/createhostprojectregistration/SyncCreateHostProjectRegistrationLocationnameHostprojectregistrationString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/createhostprojectregistration/SyncCreateHostProjectRegistrationLocationnameHostprojectregistrationString.java new file mode 100644 index 000000000000..9478bb588876 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/createhostprojectregistration/SyncCreateHostProjectRegistrationLocationnameHostprojectregistrationString.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_HostProjectRegistrationService_CreateHostProjectRegistration_LocationnameHostprojectregistrationString_sync] +import com.google.cloud.apihub.v1.HostProjectRegistration; +import com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncCreateHostProjectRegistrationLocationnameHostprojectregistrationString { + + public static void main(String[] args) throws Exception { + syncCreateHostProjectRegistrationLocationnameHostprojectregistrationString(); + } + + public static void syncCreateHostProjectRegistrationLocationnameHostprojectregistrationString() + throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = + HostProjectRegistrationServiceClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + HostProjectRegistration hostProjectRegistration = + HostProjectRegistration.newBuilder().build(); + String hostProjectRegistrationId = "hostProjectRegistrationId1352651365"; + HostProjectRegistration response = + hostProjectRegistrationServiceClient.createHostProjectRegistration( + parent, hostProjectRegistration, hostProjectRegistrationId); + } + } +} +// [END apihub_v1_generated_HostProjectRegistrationService_CreateHostProjectRegistration_LocationnameHostprojectregistrationString_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/createhostprojectregistration/SyncCreateHostProjectRegistrationStringHostprojectregistrationString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/createhostprojectregistration/SyncCreateHostProjectRegistrationStringHostprojectregistrationString.java new file mode 100644 index 000000000000..e3e7dfa155f1 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/createhostprojectregistration/SyncCreateHostProjectRegistrationStringHostprojectregistrationString.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_HostProjectRegistrationService_CreateHostProjectRegistration_StringHostprojectregistrationString_sync] +import com.google.cloud.apihub.v1.HostProjectRegistration; +import com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncCreateHostProjectRegistrationStringHostprojectregistrationString { + + public static void main(String[] args) throws Exception { + syncCreateHostProjectRegistrationStringHostprojectregistrationString(); + } + + public static void syncCreateHostProjectRegistrationStringHostprojectregistrationString() + throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = + HostProjectRegistrationServiceClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + HostProjectRegistration hostProjectRegistration = + HostProjectRegistration.newBuilder().build(); + String hostProjectRegistrationId = "hostProjectRegistrationId1352651365"; + HostProjectRegistration response = + hostProjectRegistrationServiceClient.createHostProjectRegistration( + parent, hostProjectRegistration, hostProjectRegistrationId); + } + } +} +// [END apihub_v1_generated_HostProjectRegistrationService_CreateHostProjectRegistration_StringHostprojectregistrationString_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/gethostprojectregistration/AsyncGetHostProjectRegistration.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/gethostprojectregistration/AsyncGetHostProjectRegistration.java new file mode 100644 index 000000000000..f75686cb14ae --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/gethostprojectregistration/AsyncGetHostProjectRegistration.java @@ -0,0 +1,56 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_HostProjectRegistrationService_GetHostProjectRegistration_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest; +import com.google.cloud.apihub.v1.HostProjectRegistration; +import com.google.cloud.apihub.v1.HostProjectRegistrationName; +import com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient; + +public class AsyncGetHostProjectRegistration { + + public static void main(String[] args) throws Exception { + asyncGetHostProjectRegistration(); + } + + public static void asyncGetHostProjectRegistration() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = + HostProjectRegistrationServiceClient.create()) { + GetHostProjectRegistrationRequest request = + GetHostProjectRegistrationRequest.newBuilder() + .setName( + HostProjectRegistrationName.of( + "[PROJECT]", "[LOCATION]", "[HOST_PROJECT_REGISTRATION]") + .toString()) + .build(); + ApiFuture future = + hostProjectRegistrationServiceClient + .getHostProjectRegistrationCallable() + .futureCall(request); + // Do something. + HostProjectRegistration response = future.get(); + } + } +} +// [END apihub_v1_generated_HostProjectRegistrationService_GetHostProjectRegistration_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/gethostprojectregistration/SyncGetHostProjectRegistration.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/gethostprojectregistration/SyncGetHostProjectRegistration.java new file mode 100644 index 000000000000..de15b32396f6 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/gethostprojectregistration/SyncGetHostProjectRegistration.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_HostProjectRegistrationService_GetHostProjectRegistration_sync] +import com.google.cloud.apihub.v1.GetHostProjectRegistrationRequest; +import com.google.cloud.apihub.v1.HostProjectRegistration; +import com.google.cloud.apihub.v1.HostProjectRegistrationName; +import com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient; + +public class SyncGetHostProjectRegistration { + + public static void main(String[] args) throws Exception { + syncGetHostProjectRegistration(); + } + + public static void syncGetHostProjectRegistration() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = + HostProjectRegistrationServiceClient.create()) { + GetHostProjectRegistrationRequest request = + GetHostProjectRegistrationRequest.newBuilder() + .setName( + HostProjectRegistrationName.of( + "[PROJECT]", "[LOCATION]", "[HOST_PROJECT_REGISTRATION]") + .toString()) + .build(); + HostProjectRegistration response = + hostProjectRegistrationServiceClient.getHostProjectRegistration(request); + } + } +} +// [END apihub_v1_generated_HostProjectRegistrationService_GetHostProjectRegistration_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/gethostprojectregistration/SyncGetHostProjectRegistrationHostprojectregistrationname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/gethostprojectregistration/SyncGetHostProjectRegistrationHostprojectregistrationname.java new file mode 100644 index 000000000000..a6642c31d9d5 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/gethostprojectregistration/SyncGetHostProjectRegistrationHostprojectregistrationname.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_HostProjectRegistrationService_GetHostProjectRegistration_Hostprojectregistrationname_sync] +import com.google.cloud.apihub.v1.HostProjectRegistration; +import com.google.cloud.apihub.v1.HostProjectRegistrationName; +import com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient; + +public class SyncGetHostProjectRegistrationHostprojectregistrationname { + + public static void main(String[] args) throws Exception { + syncGetHostProjectRegistrationHostprojectregistrationname(); + } + + public static void syncGetHostProjectRegistrationHostprojectregistrationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = + HostProjectRegistrationServiceClient.create()) { + HostProjectRegistrationName name = + HostProjectRegistrationName.of("[PROJECT]", "[LOCATION]", "[HOST_PROJECT_REGISTRATION]"); + HostProjectRegistration response = + hostProjectRegistrationServiceClient.getHostProjectRegistration(name); + } + } +} +// [END apihub_v1_generated_HostProjectRegistrationService_GetHostProjectRegistration_Hostprojectregistrationname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/gethostprojectregistration/SyncGetHostProjectRegistrationString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/gethostprojectregistration/SyncGetHostProjectRegistrationString.java new file mode 100644 index 000000000000..c668f7643f3b --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/gethostprojectregistration/SyncGetHostProjectRegistrationString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_HostProjectRegistrationService_GetHostProjectRegistration_String_sync] +import com.google.cloud.apihub.v1.HostProjectRegistration; +import com.google.cloud.apihub.v1.HostProjectRegistrationName; +import com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient; + +public class SyncGetHostProjectRegistrationString { + + public static void main(String[] args) throws Exception { + syncGetHostProjectRegistrationString(); + } + + public static void syncGetHostProjectRegistrationString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = + HostProjectRegistrationServiceClient.create()) { + String name = + HostProjectRegistrationName.of("[PROJECT]", "[LOCATION]", "[HOST_PROJECT_REGISTRATION]") + .toString(); + HostProjectRegistration response = + hostProjectRegistrationServiceClient.getHostProjectRegistration(name); + } + } +} +// [END apihub_v1_generated_HostProjectRegistrationService_GetHostProjectRegistration_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/getlocation/AsyncGetLocation.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..12135bcd1c28 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/getlocation/AsyncGetLocation.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_HostProjectRegistrationService_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = + HostProjectRegistrationServiceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = + hostProjectRegistrationServiceClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END apihub_v1_generated_HostProjectRegistrationService_GetLocation_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/getlocation/SyncGetLocation.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..a0452ee09332 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/getlocation/SyncGetLocation.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_HostProjectRegistrationService_GetLocation_sync] +import com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = + HostProjectRegistrationServiceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = hostProjectRegistrationServiceClient.getLocation(request); + } + } +} +// [END apihub_v1_generated_HostProjectRegistrationService_GetLocation_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listhostprojectregistrations/AsyncListHostProjectRegistrations.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listhostprojectregistrations/AsyncListHostProjectRegistrations.java new file mode 100644 index 000000000000..24ad0be0d3b9 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listhostprojectregistrations/AsyncListHostProjectRegistrations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_HostProjectRegistrationService_ListHostProjectRegistrations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.HostProjectRegistration; +import com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient; +import com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest; +import com.google.cloud.apihub.v1.LocationName; + +public class AsyncListHostProjectRegistrations { + + public static void main(String[] args) throws Exception { + asyncListHostProjectRegistrations(); + } + + public static void asyncListHostProjectRegistrations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = + HostProjectRegistrationServiceClient.create()) { + ListHostProjectRegistrationsRequest request = + ListHostProjectRegistrationsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + hostProjectRegistrationServiceClient + .listHostProjectRegistrationsPagedCallable() + .futureCall(request); + // Do something. + for (HostProjectRegistration element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_HostProjectRegistrationService_ListHostProjectRegistrations_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listhostprojectregistrations/AsyncListHostProjectRegistrationsPaged.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listhostprojectregistrations/AsyncListHostProjectRegistrationsPaged.java new file mode 100644 index 000000000000..b26458e9c641 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listhostprojectregistrations/AsyncListHostProjectRegistrationsPaged.java @@ -0,0 +1,67 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_HostProjectRegistrationService_ListHostProjectRegistrations_Paged_async] +import com.google.cloud.apihub.v1.HostProjectRegistration; +import com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient; +import com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest; +import com.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse; +import com.google.cloud.apihub.v1.LocationName; +import com.google.common.base.Strings; + +public class AsyncListHostProjectRegistrationsPaged { + + public static void main(String[] args) throws Exception { + asyncListHostProjectRegistrationsPaged(); + } + + public static void asyncListHostProjectRegistrationsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = + HostProjectRegistrationServiceClient.create()) { + ListHostProjectRegistrationsRequest request = + ListHostProjectRegistrationsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListHostProjectRegistrationsResponse response = + hostProjectRegistrationServiceClient + .listHostProjectRegistrationsCallable() + .call(request); + for (HostProjectRegistration element : response.getHostProjectRegistrationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END apihub_v1_generated_HostProjectRegistrationService_ListHostProjectRegistrations_Paged_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listhostprojectregistrations/SyncListHostProjectRegistrations.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listhostprojectregistrations/SyncListHostProjectRegistrations.java new file mode 100644 index 000000000000..c990cf467772 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listhostprojectregistrations/SyncListHostProjectRegistrations.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_HostProjectRegistrationService_ListHostProjectRegistrations_sync] +import com.google.cloud.apihub.v1.HostProjectRegistration; +import com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient; +import com.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncListHostProjectRegistrations { + + public static void main(String[] args) throws Exception { + syncListHostProjectRegistrations(); + } + + public static void syncListHostProjectRegistrations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = + HostProjectRegistrationServiceClient.create()) { + ListHostProjectRegistrationsRequest request = + ListHostProjectRegistrationsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (HostProjectRegistration element : + hostProjectRegistrationServiceClient.listHostProjectRegistrations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_HostProjectRegistrationService_ListHostProjectRegistrations_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listhostprojectregistrations/SyncListHostProjectRegistrationsLocationname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listhostprojectregistrations/SyncListHostProjectRegistrationsLocationname.java new file mode 100644 index 000000000000..987157da5795 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listhostprojectregistrations/SyncListHostProjectRegistrationsLocationname.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_HostProjectRegistrationService_ListHostProjectRegistrations_Locationname_sync] +import com.google.cloud.apihub.v1.HostProjectRegistration; +import com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncListHostProjectRegistrationsLocationname { + + public static void main(String[] args) throws Exception { + syncListHostProjectRegistrationsLocationname(); + } + + public static void syncListHostProjectRegistrationsLocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = + HostProjectRegistrationServiceClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (HostProjectRegistration element : + hostProjectRegistrationServiceClient.listHostProjectRegistrations(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_HostProjectRegistrationService_ListHostProjectRegistrations_Locationname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listhostprojectregistrations/SyncListHostProjectRegistrationsString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listhostprojectregistrations/SyncListHostProjectRegistrationsString.java new file mode 100644 index 000000000000..a5aedf6ae32e --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listhostprojectregistrations/SyncListHostProjectRegistrationsString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_HostProjectRegistrationService_ListHostProjectRegistrations_String_sync] +import com.google.cloud.apihub.v1.HostProjectRegistration; +import com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient; +import com.google.cloud.apihub.v1.LocationName; + +public class SyncListHostProjectRegistrationsString { + + public static void main(String[] args) throws Exception { + syncListHostProjectRegistrationsString(); + } + + public static void syncListHostProjectRegistrationsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = + HostProjectRegistrationServiceClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (HostProjectRegistration element : + hostProjectRegistrationServiceClient.listHostProjectRegistrations(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_HostProjectRegistrationService_ListHostProjectRegistrations_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listlocations/AsyncListLocations.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..ea54b5bea468 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listlocations/AsyncListLocations.java @@ -0,0 +1,55 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_HostProjectRegistrationService_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = + HostProjectRegistrationServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + hostProjectRegistrationServiceClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_HostProjectRegistrationService_ListLocations_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listlocations/AsyncListLocationsPaged.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..4a14b78d1aba --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,63 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_HostProjectRegistrationService_ListLocations_Paged_async] +import com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = + HostProjectRegistrationServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = + hostProjectRegistrationServiceClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END apihub_v1_generated_HostProjectRegistrationService_ListLocations_Paged_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listlocations/SyncListLocations.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..2320a767d083 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservice/listlocations/SyncListLocations.java @@ -0,0 +1,52 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_HostProjectRegistrationService_ListLocations_sync] +import com.google.cloud.apihub.v1.HostProjectRegistrationServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = + HostProjectRegistrationServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : + hostProjectRegistrationServiceClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_HostProjectRegistrationService_ListLocations_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservicesettings/createhostprojectregistration/SyncCreateHostProjectRegistration.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservicesettings/createhostprojectregistration/SyncCreateHostProjectRegistration.java new file mode 100644 index 000000000000..16be5cda3424 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/hostprojectregistrationservicesettings/createhostprojectregistration/SyncCreateHostProjectRegistration.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_HostProjectRegistrationServiceSettings_CreateHostProjectRegistration_sync] +import com.google.cloud.apihub.v1.HostProjectRegistrationServiceSettings; +import java.time.Duration; + +public class SyncCreateHostProjectRegistration { + + public static void main(String[] args) throws Exception { + syncCreateHostProjectRegistration(); + } + + public static void syncCreateHostProjectRegistration() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + HostProjectRegistrationServiceSettings.Builder hostProjectRegistrationServiceSettingsBuilder = + HostProjectRegistrationServiceSettings.newBuilder(); + hostProjectRegistrationServiceSettingsBuilder + .createHostProjectRegistrationSettings() + .setRetrySettings( + hostProjectRegistrationServiceSettingsBuilder + .createHostProjectRegistrationSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + HostProjectRegistrationServiceSettings hostProjectRegistrationServiceSettings = + hostProjectRegistrationServiceSettingsBuilder.build(); + } +} +// [END apihub_v1_generated_HostProjectRegistrationServiceSettings_CreateHostProjectRegistration_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/create/SyncCreateSetCredentialsProvider.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..6d1fc867e76e --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_LintingService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.apihub.v1.LintingServiceClient; +import com.google.cloud.apihub.v1.LintingServiceSettings; +import com.google.cloud.apihub.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + LintingServiceSettings lintingServiceSettings = + LintingServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + LintingServiceClient lintingServiceClient = LintingServiceClient.create(lintingServiceSettings); + } +} +// [END apihub_v1_generated_LintingService_Create_SetCredentialsProvider_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/create/SyncCreateSetCredentialsProvider1.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..c0d681698193 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,40 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_LintingService_Create_SetCredentialsProvider1_sync] +import com.google.cloud.apihub.v1.LintingServiceClient; +import com.google.cloud.apihub.v1.LintingServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + LintingServiceSettings lintingServiceSettings = + LintingServiceSettings.newHttpJsonBuilder().build(); + LintingServiceClient lintingServiceClient = LintingServiceClient.create(lintingServiceSettings); + } +} +// [END apihub_v1_generated_LintingService_Create_SetCredentialsProvider1_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/create/SyncCreateSetEndpoint.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..0ef16a1c5631 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_LintingService_Create_SetEndpoint_sync] +import com.google.cloud.apihub.v1.LintingServiceClient; +import com.google.cloud.apihub.v1.LintingServiceSettings; +import com.google.cloud.apihub.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + LintingServiceSettings lintingServiceSettings = + LintingServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + LintingServiceClient lintingServiceClient = LintingServiceClient.create(lintingServiceSettings); + } +} +// [END apihub_v1_generated_LintingService_Create_SetEndpoint_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getlocation/AsyncGetLocation.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..fbfb5013416e --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getlocation/AsyncGetLocation.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_LintingService_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.LintingServiceClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = lintingServiceClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END apihub_v1_generated_LintingService_GetLocation_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getlocation/SyncGetLocation.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..2f2b25b5286e --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_LintingService_GetLocation_sync] +import com.google.cloud.apihub.v1.LintingServiceClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = lintingServiceClient.getLocation(request); + } + } +} +// [END apihub_v1_generated_LintingService_GetLocation_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguide/AsyncGetStyleGuide.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguide/AsyncGetStyleGuide.java new file mode 100644 index 000000000000..bd94f65da9c4 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguide/AsyncGetStyleGuide.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_LintingService_GetStyleGuide_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.GetStyleGuideRequest; +import com.google.cloud.apihub.v1.LintingServiceClient; +import com.google.cloud.apihub.v1.StyleGuide; +import com.google.cloud.apihub.v1.StyleGuideName; + +public class AsyncGetStyleGuide { + + public static void main(String[] args) throws Exception { + asyncGetStyleGuide(); + } + + public static void asyncGetStyleGuide() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) { + GetStyleGuideRequest request = + GetStyleGuideRequest.newBuilder() + .setName(StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .build(); + ApiFuture future = + lintingServiceClient.getStyleGuideCallable().futureCall(request); + // Do something. + StyleGuide response = future.get(); + } + } +} +// [END apihub_v1_generated_LintingService_GetStyleGuide_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguide/SyncGetStyleGuide.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguide/SyncGetStyleGuide.java new file mode 100644 index 000000000000..d6a8137930a8 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguide/SyncGetStyleGuide.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_LintingService_GetStyleGuide_sync] +import com.google.cloud.apihub.v1.GetStyleGuideRequest; +import com.google.cloud.apihub.v1.LintingServiceClient; +import com.google.cloud.apihub.v1.StyleGuide; +import com.google.cloud.apihub.v1.StyleGuideName; + +public class SyncGetStyleGuide { + + public static void main(String[] args) throws Exception { + syncGetStyleGuide(); + } + + public static void syncGetStyleGuide() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) { + GetStyleGuideRequest request = + GetStyleGuideRequest.newBuilder() + .setName(StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .build(); + StyleGuide response = lintingServiceClient.getStyleGuide(request); + } + } +} +// [END apihub_v1_generated_LintingService_GetStyleGuide_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguide/SyncGetStyleGuideString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguide/SyncGetStyleGuideString.java new file mode 100644 index 000000000000..6621de7bf70c --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguide/SyncGetStyleGuideString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_LintingService_GetStyleGuide_String_sync] +import com.google.cloud.apihub.v1.LintingServiceClient; +import com.google.cloud.apihub.v1.StyleGuide; +import com.google.cloud.apihub.v1.StyleGuideName; + +public class SyncGetStyleGuideString { + + public static void main(String[] args) throws Exception { + syncGetStyleGuideString(); + } + + public static void syncGetStyleGuideString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) { + String name = StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString(); + StyleGuide response = lintingServiceClient.getStyleGuide(name); + } + } +} +// [END apihub_v1_generated_LintingService_GetStyleGuide_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguide/SyncGetStyleGuideStyleguidename.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguide/SyncGetStyleGuideStyleguidename.java new file mode 100644 index 000000000000..99e68fc609d6 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguide/SyncGetStyleGuideStyleguidename.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_LintingService_GetStyleGuide_Styleguidename_sync] +import com.google.cloud.apihub.v1.LintingServiceClient; +import com.google.cloud.apihub.v1.StyleGuide; +import com.google.cloud.apihub.v1.StyleGuideName; + +public class SyncGetStyleGuideStyleguidename { + + public static void main(String[] args) throws Exception { + syncGetStyleGuideStyleguidename(); + } + + public static void syncGetStyleGuideStyleguidename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) { + StyleGuideName name = StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]"); + StyleGuide response = lintingServiceClient.getStyleGuide(name); + } + } +} +// [END apihub_v1_generated_LintingService_GetStyleGuide_Styleguidename_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguidecontents/AsyncGetStyleGuideContents.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguidecontents/AsyncGetStyleGuideContents.java new file mode 100644 index 000000000000..8bec443a0f7e --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguidecontents/AsyncGetStyleGuideContents.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_LintingService_GetStyleGuideContents_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.GetStyleGuideContentsRequest; +import com.google.cloud.apihub.v1.LintingServiceClient; +import com.google.cloud.apihub.v1.StyleGuideContents; +import com.google.cloud.apihub.v1.StyleGuideName; + +public class AsyncGetStyleGuideContents { + + public static void main(String[] args) throws Exception { + asyncGetStyleGuideContents(); + } + + public static void asyncGetStyleGuideContents() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) { + GetStyleGuideContentsRequest request = + GetStyleGuideContentsRequest.newBuilder() + .setName(StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .build(); + ApiFuture future = + lintingServiceClient.getStyleGuideContentsCallable().futureCall(request); + // Do something. + StyleGuideContents response = future.get(); + } + } +} +// [END apihub_v1_generated_LintingService_GetStyleGuideContents_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguidecontents/SyncGetStyleGuideContents.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguidecontents/SyncGetStyleGuideContents.java new file mode 100644 index 000000000000..d1c6e9d344c3 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguidecontents/SyncGetStyleGuideContents.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_LintingService_GetStyleGuideContents_sync] +import com.google.cloud.apihub.v1.GetStyleGuideContentsRequest; +import com.google.cloud.apihub.v1.LintingServiceClient; +import com.google.cloud.apihub.v1.StyleGuideContents; +import com.google.cloud.apihub.v1.StyleGuideName; + +public class SyncGetStyleGuideContents { + + public static void main(String[] args) throws Exception { + syncGetStyleGuideContents(); + } + + public static void syncGetStyleGuideContents() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) { + GetStyleGuideContentsRequest request = + GetStyleGuideContentsRequest.newBuilder() + .setName(StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString()) + .build(); + StyleGuideContents response = lintingServiceClient.getStyleGuideContents(request); + } + } +} +// [END apihub_v1_generated_LintingService_GetStyleGuideContents_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguidecontents/SyncGetStyleGuideContentsString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguidecontents/SyncGetStyleGuideContentsString.java new file mode 100644 index 000000000000..49acbdc0c787 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguidecontents/SyncGetStyleGuideContentsString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_LintingService_GetStyleGuideContents_String_sync] +import com.google.cloud.apihub.v1.LintingServiceClient; +import com.google.cloud.apihub.v1.StyleGuideContents; +import com.google.cloud.apihub.v1.StyleGuideName; + +public class SyncGetStyleGuideContentsString { + + public static void main(String[] args) throws Exception { + syncGetStyleGuideContentsString(); + } + + public static void syncGetStyleGuideContentsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) { + String name = StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString(); + StyleGuideContents response = lintingServiceClient.getStyleGuideContents(name); + } + } +} +// [END apihub_v1_generated_LintingService_GetStyleGuideContents_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguidecontents/SyncGetStyleGuideContentsStyleguidename.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguidecontents/SyncGetStyleGuideContentsStyleguidename.java new file mode 100644 index 000000000000..57752e0807ae --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/getstyleguidecontents/SyncGetStyleGuideContentsStyleguidename.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_LintingService_GetStyleGuideContents_Styleguidename_sync] +import com.google.cloud.apihub.v1.LintingServiceClient; +import com.google.cloud.apihub.v1.StyleGuideContents; +import com.google.cloud.apihub.v1.StyleGuideName; + +public class SyncGetStyleGuideContentsStyleguidename { + + public static void main(String[] args) throws Exception { + syncGetStyleGuideContentsStyleguidename(); + } + + public static void syncGetStyleGuideContentsStyleguidename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) { + StyleGuideName name = StyleGuideName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]"); + StyleGuideContents response = lintingServiceClient.getStyleGuideContents(name); + } + } +} +// [END apihub_v1_generated_LintingService_GetStyleGuideContents_Styleguidename_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/lintspec/AsyncLintSpec.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/lintspec/AsyncLintSpec.java new file mode 100644 index 000000000000..e4ee80fdc076 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/lintspec/AsyncLintSpec.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_LintingService_LintSpec_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.LintSpecRequest; +import com.google.cloud.apihub.v1.LintingServiceClient; +import com.google.cloud.apihub.v1.SpecName; +import com.google.protobuf.Empty; + +public class AsyncLintSpec { + + public static void main(String[] args) throws Exception { + asyncLintSpec(); + } + + public static void asyncLintSpec() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) { + LintSpecRequest request = + LintSpecRequest.newBuilder() + .setName( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .build(); + ApiFuture future = lintingServiceClient.lintSpecCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END apihub_v1_generated_LintingService_LintSpec_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/lintspec/SyncLintSpec.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/lintspec/SyncLintSpec.java new file mode 100644 index 000000000000..f98e65d7ecab --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/lintspec/SyncLintSpec.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_LintingService_LintSpec_sync] +import com.google.cloud.apihub.v1.LintSpecRequest; +import com.google.cloud.apihub.v1.LintingServiceClient; +import com.google.cloud.apihub.v1.SpecName; +import com.google.protobuf.Empty; + +public class SyncLintSpec { + + public static void main(String[] args) throws Exception { + syncLintSpec(); + } + + public static void syncLintSpec() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) { + LintSpecRequest request = + LintSpecRequest.newBuilder() + .setName( + SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + .build(); + lintingServiceClient.lintSpec(request); + } + } +} +// [END apihub_v1_generated_LintingService_LintSpec_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/listlocations/AsyncListLocations.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..d1ab21ab3164 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/listlocations/AsyncListLocations.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_LintingService_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.LintingServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + lintingServiceClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_LintingService_ListLocations_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/listlocations/AsyncListLocationsPaged.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..986f08b4e798 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,61 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_LintingService_ListLocations_Paged_async] +import com.google.cloud.apihub.v1.LintingServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = lintingServiceClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END apihub_v1_generated_LintingService_ListLocations_Paged_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/listlocations/SyncListLocations.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..0e66437c9cb0 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_LintingService_ListLocations_sync] +import com.google.cloud.apihub.v1.LintingServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : lintingServiceClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_LintingService_ListLocations_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/updatestyleguide/AsyncUpdateStyleGuide.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/updatestyleguide/AsyncUpdateStyleGuide.java new file mode 100644 index 000000000000..adb7191b0be7 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/updatestyleguide/AsyncUpdateStyleGuide.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_LintingService_UpdateStyleGuide_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.LintingServiceClient; +import com.google.cloud.apihub.v1.StyleGuide; +import com.google.cloud.apihub.v1.UpdateStyleGuideRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateStyleGuide { + + public static void main(String[] args) throws Exception { + asyncUpdateStyleGuide(); + } + + public static void asyncUpdateStyleGuide() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) { + UpdateStyleGuideRequest request = + UpdateStyleGuideRequest.newBuilder() + .setStyleGuide(StyleGuide.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = + lintingServiceClient.updateStyleGuideCallable().futureCall(request); + // Do something. + StyleGuide response = future.get(); + } + } +} +// [END apihub_v1_generated_LintingService_UpdateStyleGuide_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/updatestyleguide/SyncUpdateStyleGuide.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/updatestyleguide/SyncUpdateStyleGuide.java new file mode 100644 index 000000000000..8f7c281f6b91 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/updatestyleguide/SyncUpdateStyleGuide.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_LintingService_UpdateStyleGuide_sync] +import com.google.cloud.apihub.v1.LintingServiceClient; +import com.google.cloud.apihub.v1.StyleGuide; +import com.google.cloud.apihub.v1.UpdateStyleGuideRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateStyleGuide { + + public static void main(String[] args) throws Exception { + syncUpdateStyleGuide(); + } + + public static void syncUpdateStyleGuide() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) { + UpdateStyleGuideRequest request = + UpdateStyleGuideRequest.newBuilder() + .setStyleGuide(StyleGuide.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + StyleGuide response = lintingServiceClient.updateStyleGuide(request); + } + } +} +// [END apihub_v1_generated_LintingService_UpdateStyleGuide_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/updatestyleguide/SyncUpdateStyleGuideStyleguideFieldmask.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/updatestyleguide/SyncUpdateStyleGuideStyleguideFieldmask.java new file mode 100644 index 000000000000..836ab226e9b4 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservice/updatestyleguide/SyncUpdateStyleGuideStyleguideFieldmask.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_LintingService_UpdateStyleGuide_StyleguideFieldmask_sync] +import com.google.cloud.apihub.v1.LintingServiceClient; +import com.google.cloud.apihub.v1.StyleGuide; +import com.google.protobuf.FieldMask; + +public class SyncUpdateStyleGuideStyleguideFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateStyleGuideStyleguideFieldmask(); + } + + public static void syncUpdateStyleGuideStyleguideFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LintingServiceClient lintingServiceClient = LintingServiceClient.create()) { + StyleGuide styleGuide = StyleGuide.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + StyleGuide response = lintingServiceClient.updateStyleGuide(styleGuide, updateMask); + } + } +} +// [END apihub_v1_generated_LintingService_UpdateStyleGuide_StyleguideFieldmask_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservicesettings/getstyleguide/SyncGetStyleGuide.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservicesettings/getstyleguide/SyncGetStyleGuide.java new file mode 100644 index 000000000000..bfbc2e40debf --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/lintingservicesettings/getstyleguide/SyncGetStyleGuide.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_LintingServiceSettings_GetStyleGuide_sync] +import com.google.cloud.apihub.v1.LintingServiceSettings; +import java.time.Duration; + +public class SyncGetStyleGuide { + + public static void main(String[] args) throws Exception { + syncGetStyleGuide(); + } + + public static void syncGetStyleGuide() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + LintingServiceSettings.Builder lintingServiceSettingsBuilder = + LintingServiceSettings.newBuilder(); + lintingServiceSettingsBuilder + .getStyleGuideSettings() + .setRetrySettings( + lintingServiceSettingsBuilder + .getStyleGuideSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + LintingServiceSettings lintingServiceSettings = lintingServiceSettingsBuilder.build(); + } +} +// [END apihub_v1_generated_LintingServiceSettings_GetStyleGuide_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/create/SyncCreateSetCredentialsProvider.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..32760cfeaf2a --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_Provisioning_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.apihub.v1.ProvisioningClient; +import com.google.cloud.apihub.v1.ProvisioningSettings; +import com.google.cloud.apihub.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ProvisioningSettings provisioningSettings = + ProvisioningSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + ProvisioningClient provisioningClient = ProvisioningClient.create(provisioningSettings); + } +} +// [END apihub_v1_generated_Provisioning_Create_SetCredentialsProvider_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/create/SyncCreateSetCredentialsProvider1.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..147b4deee4fd --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,39 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_Provisioning_Create_SetCredentialsProvider1_sync] +import com.google.cloud.apihub.v1.ProvisioningClient; +import com.google.cloud.apihub.v1.ProvisioningSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ProvisioningSettings provisioningSettings = ProvisioningSettings.newHttpJsonBuilder().build(); + ProvisioningClient provisioningClient = ProvisioningClient.create(provisioningSettings); + } +} +// [END apihub_v1_generated_Provisioning_Create_SetCredentialsProvider1_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/create/SyncCreateSetEndpoint.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..8bf11101c2e6 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_Provisioning_Create_SetEndpoint_sync] +import com.google.cloud.apihub.v1.ProvisioningClient; +import com.google.cloud.apihub.v1.ProvisioningSettings; +import com.google.cloud.apihub.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ProvisioningSettings provisioningSettings = + ProvisioningSettings.newBuilder().setEndpoint(myEndpoint).build(); + ProvisioningClient provisioningClient = ProvisioningClient.create(provisioningSettings); + } +} +// [END apihub_v1_generated_Provisioning_Create_SetEndpoint_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/createapihubinstance/AsyncCreateApiHubInstance.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/createapihubinstance/AsyncCreateApiHubInstance.java new file mode 100644 index 000000000000..337556e70d64 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/createapihubinstance/AsyncCreateApiHubInstance.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_Provisioning_CreateApiHubInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubInstance; +import com.google.cloud.apihub.v1.CreateApiHubInstanceRequest; +import com.google.cloud.apihub.v1.LocationName; +import com.google.cloud.apihub.v1.ProvisioningClient; +import com.google.longrunning.Operation; + +public class AsyncCreateApiHubInstance { + + public static void main(String[] args) throws Exception { + asyncCreateApiHubInstance(); + } + + public static void asyncCreateApiHubInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ProvisioningClient provisioningClient = ProvisioningClient.create()) { + CreateApiHubInstanceRequest request = + CreateApiHubInstanceRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setApiHubInstanceId("apiHubInstanceId-1318600853") + .setApiHubInstance(ApiHubInstance.newBuilder().build()) + .build(); + ApiFuture future = + provisioningClient.createApiHubInstanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END apihub_v1_generated_Provisioning_CreateApiHubInstance_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/createapihubinstance/AsyncCreateApiHubInstanceLRO.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/createapihubinstance/AsyncCreateApiHubInstanceLRO.java new file mode 100644 index 000000000000..d7084946ceea --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/createapihubinstance/AsyncCreateApiHubInstanceLRO.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_Provisioning_CreateApiHubInstance_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.apihub.v1.ApiHubInstance; +import com.google.cloud.apihub.v1.CreateApiHubInstanceRequest; +import com.google.cloud.apihub.v1.LocationName; +import com.google.cloud.apihub.v1.OperationMetadata; +import com.google.cloud.apihub.v1.ProvisioningClient; + +public class AsyncCreateApiHubInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncCreateApiHubInstanceLRO(); + } + + public static void asyncCreateApiHubInstanceLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ProvisioningClient provisioningClient = ProvisioningClient.create()) { + CreateApiHubInstanceRequest request = + CreateApiHubInstanceRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setApiHubInstanceId("apiHubInstanceId-1318600853") + .setApiHubInstance(ApiHubInstance.newBuilder().build()) + .build(); + OperationFuture future = + provisioningClient.createApiHubInstanceOperationCallable().futureCall(request); + // Do something. + ApiHubInstance response = future.get(); + } + } +} +// [END apihub_v1_generated_Provisioning_CreateApiHubInstance_LRO_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/createapihubinstance/SyncCreateApiHubInstance.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/createapihubinstance/SyncCreateApiHubInstance.java new file mode 100644 index 000000000000..c6d4267ff6e8 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/createapihubinstance/SyncCreateApiHubInstance.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_Provisioning_CreateApiHubInstance_sync] +import com.google.cloud.apihub.v1.ApiHubInstance; +import com.google.cloud.apihub.v1.CreateApiHubInstanceRequest; +import com.google.cloud.apihub.v1.LocationName; +import com.google.cloud.apihub.v1.ProvisioningClient; + +public class SyncCreateApiHubInstance { + + public static void main(String[] args) throws Exception { + syncCreateApiHubInstance(); + } + + public static void syncCreateApiHubInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ProvisioningClient provisioningClient = ProvisioningClient.create()) { + CreateApiHubInstanceRequest request = + CreateApiHubInstanceRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setApiHubInstanceId("apiHubInstanceId-1318600853") + .setApiHubInstance(ApiHubInstance.newBuilder().build()) + .build(); + ApiHubInstance response = provisioningClient.createApiHubInstanceAsync(request).get(); + } + } +} +// [END apihub_v1_generated_Provisioning_CreateApiHubInstance_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/createapihubinstance/SyncCreateApiHubInstanceLocationnameApihubinstanceString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/createapihubinstance/SyncCreateApiHubInstanceLocationnameApihubinstanceString.java new file mode 100644 index 000000000000..99a967e95ad9 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/createapihubinstance/SyncCreateApiHubInstanceLocationnameApihubinstanceString.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_Provisioning_CreateApiHubInstance_LocationnameApihubinstanceString_sync] +import com.google.cloud.apihub.v1.ApiHubInstance; +import com.google.cloud.apihub.v1.LocationName; +import com.google.cloud.apihub.v1.ProvisioningClient; + +public class SyncCreateApiHubInstanceLocationnameApihubinstanceString { + + public static void main(String[] args) throws Exception { + syncCreateApiHubInstanceLocationnameApihubinstanceString(); + } + + public static void syncCreateApiHubInstanceLocationnameApihubinstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ProvisioningClient provisioningClient = ProvisioningClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ApiHubInstance apiHubInstance = ApiHubInstance.newBuilder().build(); + String apiHubInstanceId = "apiHubInstanceId-1318600853"; + ApiHubInstance response = + provisioningClient + .createApiHubInstanceAsync(parent, apiHubInstance, apiHubInstanceId) + .get(); + } + } +} +// [END apihub_v1_generated_Provisioning_CreateApiHubInstance_LocationnameApihubinstanceString_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/createapihubinstance/SyncCreateApiHubInstanceStringApihubinstanceString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/createapihubinstance/SyncCreateApiHubInstanceStringApihubinstanceString.java new file mode 100644 index 000000000000..fc3f4e3787b7 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/createapihubinstance/SyncCreateApiHubInstanceStringApihubinstanceString.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_Provisioning_CreateApiHubInstance_StringApihubinstanceString_sync] +import com.google.cloud.apihub.v1.ApiHubInstance; +import com.google.cloud.apihub.v1.LocationName; +import com.google.cloud.apihub.v1.ProvisioningClient; + +public class SyncCreateApiHubInstanceStringApihubinstanceString { + + public static void main(String[] args) throws Exception { + syncCreateApiHubInstanceStringApihubinstanceString(); + } + + public static void syncCreateApiHubInstanceStringApihubinstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ProvisioningClient provisioningClient = ProvisioningClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + ApiHubInstance apiHubInstance = ApiHubInstance.newBuilder().build(); + String apiHubInstanceId = "apiHubInstanceId-1318600853"; + ApiHubInstance response = + provisioningClient + .createApiHubInstanceAsync(parent, apiHubInstance, apiHubInstanceId) + .get(); + } + } +} +// [END apihub_v1_generated_Provisioning_CreateApiHubInstance_StringApihubinstanceString_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/getapihubinstance/AsyncGetApiHubInstance.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/getapihubinstance/AsyncGetApiHubInstance.java new file mode 100644 index 000000000000..13abefde9f38 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/getapihubinstance/AsyncGetApiHubInstance.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_Provisioning_GetApiHubInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ApiHubInstance; +import com.google.cloud.apihub.v1.ApiHubInstanceName; +import com.google.cloud.apihub.v1.GetApiHubInstanceRequest; +import com.google.cloud.apihub.v1.ProvisioningClient; + +public class AsyncGetApiHubInstance { + + public static void main(String[] args) throws Exception { + asyncGetApiHubInstance(); + } + + public static void asyncGetApiHubInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ProvisioningClient provisioningClient = ProvisioningClient.create()) { + GetApiHubInstanceRequest request = + GetApiHubInstanceRequest.newBuilder() + .setName( + ApiHubInstanceName.of("[PROJECT]", "[LOCATION]", "[API_HUB_INSTANCE]").toString()) + .build(); + ApiFuture future = + provisioningClient.getApiHubInstanceCallable().futureCall(request); + // Do something. + ApiHubInstance response = future.get(); + } + } +} +// [END apihub_v1_generated_Provisioning_GetApiHubInstance_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/getapihubinstance/SyncGetApiHubInstance.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/getapihubinstance/SyncGetApiHubInstance.java new file mode 100644 index 000000000000..7550ec573a85 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/getapihubinstance/SyncGetApiHubInstance.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_Provisioning_GetApiHubInstance_sync] +import com.google.cloud.apihub.v1.ApiHubInstance; +import com.google.cloud.apihub.v1.ApiHubInstanceName; +import com.google.cloud.apihub.v1.GetApiHubInstanceRequest; +import com.google.cloud.apihub.v1.ProvisioningClient; + +public class SyncGetApiHubInstance { + + public static void main(String[] args) throws Exception { + syncGetApiHubInstance(); + } + + public static void syncGetApiHubInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ProvisioningClient provisioningClient = ProvisioningClient.create()) { + GetApiHubInstanceRequest request = + GetApiHubInstanceRequest.newBuilder() + .setName( + ApiHubInstanceName.of("[PROJECT]", "[LOCATION]", "[API_HUB_INSTANCE]").toString()) + .build(); + ApiHubInstance response = provisioningClient.getApiHubInstance(request); + } + } +} +// [END apihub_v1_generated_Provisioning_GetApiHubInstance_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/getapihubinstance/SyncGetApiHubInstanceApihubinstancename.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/getapihubinstance/SyncGetApiHubInstanceApihubinstancename.java new file mode 100644 index 000000000000..a018573553fc --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/getapihubinstance/SyncGetApiHubInstanceApihubinstancename.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_Provisioning_GetApiHubInstance_Apihubinstancename_sync] +import com.google.cloud.apihub.v1.ApiHubInstance; +import com.google.cloud.apihub.v1.ApiHubInstanceName; +import com.google.cloud.apihub.v1.ProvisioningClient; + +public class SyncGetApiHubInstanceApihubinstancename { + + public static void main(String[] args) throws Exception { + syncGetApiHubInstanceApihubinstancename(); + } + + public static void syncGetApiHubInstanceApihubinstancename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ProvisioningClient provisioningClient = ProvisioningClient.create()) { + ApiHubInstanceName name = + ApiHubInstanceName.of("[PROJECT]", "[LOCATION]", "[API_HUB_INSTANCE]"); + ApiHubInstance response = provisioningClient.getApiHubInstance(name); + } + } +} +// [END apihub_v1_generated_Provisioning_GetApiHubInstance_Apihubinstancename_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/getapihubinstance/SyncGetApiHubInstanceString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/getapihubinstance/SyncGetApiHubInstanceString.java new file mode 100644 index 000000000000..57f9d09d4026 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/getapihubinstance/SyncGetApiHubInstanceString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_Provisioning_GetApiHubInstance_String_sync] +import com.google.cloud.apihub.v1.ApiHubInstance; +import com.google.cloud.apihub.v1.ApiHubInstanceName; +import com.google.cloud.apihub.v1.ProvisioningClient; + +public class SyncGetApiHubInstanceString { + + public static void main(String[] args) throws Exception { + syncGetApiHubInstanceString(); + } + + public static void syncGetApiHubInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ProvisioningClient provisioningClient = ProvisioningClient.create()) { + String name = + ApiHubInstanceName.of("[PROJECT]", "[LOCATION]", "[API_HUB_INSTANCE]").toString(); + ApiHubInstance response = provisioningClient.getApiHubInstance(name); + } + } +} +// [END apihub_v1_generated_Provisioning_GetApiHubInstance_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/getlocation/AsyncGetLocation.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..ed89e90df668 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/getlocation/AsyncGetLocation.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_Provisioning_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ProvisioningClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ProvisioningClient provisioningClient = ProvisioningClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = provisioningClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END apihub_v1_generated_Provisioning_GetLocation_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/getlocation/SyncGetLocation.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..cfbf1f9d3c3b --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_Provisioning_GetLocation_sync] +import com.google.cloud.apihub.v1.ProvisioningClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ProvisioningClient provisioningClient = ProvisioningClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = provisioningClient.getLocation(request); + } + } +} +// [END apihub_v1_generated_Provisioning_GetLocation_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/listlocations/AsyncListLocations.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..79a112e5ad35 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/listlocations/AsyncListLocations.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_Provisioning_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ProvisioningClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ProvisioningClient provisioningClient = ProvisioningClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + provisioningClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_Provisioning_ListLocations_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/listlocations/AsyncListLocationsPaged.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..5148d03945b2 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,61 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_Provisioning_ListLocations_Paged_async] +import com.google.cloud.apihub.v1.ProvisioningClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ProvisioningClient provisioningClient = ProvisioningClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = provisioningClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END apihub_v1_generated_Provisioning_ListLocations_Paged_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/listlocations/SyncListLocations.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..3863710d7dca --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_Provisioning_ListLocations_sync] +import com.google.cloud.apihub.v1.ProvisioningClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ProvisioningClient provisioningClient = ProvisioningClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : provisioningClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_Provisioning_ListLocations_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/lookupapihubinstance/AsyncLookupApiHubInstance.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/lookupapihubinstance/AsyncLookupApiHubInstance.java new file mode 100644 index 000000000000..d2f4f4620dd3 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/lookupapihubinstance/AsyncLookupApiHubInstance.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_Provisioning_LookupApiHubInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.LocationName; +import com.google.cloud.apihub.v1.LookupApiHubInstanceRequest; +import com.google.cloud.apihub.v1.LookupApiHubInstanceResponse; +import com.google.cloud.apihub.v1.ProvisioningClient; + +public class AsyncLookupApiHubInstance { + + public static void main(String[] args) throws Exception { + asyncLookupApiHubInstance(); + } + + public static void asyncLookupApiHubInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ProvisioningClient provisioningClient = ProvisioningClient.create()) { + LookupApiHubInstanceRequest request = + LookupApiHubInstanceRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .build(); + ApiFuture future = + provisioningClient.lookupApiHubInstanceCallable().futureCall(request); + // Do something. + LookupApiHubInstanceResponse response = future.get(); + } + } +} +// [END apihub_v1_generated_Provisioning_LookupApiHubInstance_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/lookupapihubinstance/SyncLookupApiHubInstance.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/lookupapihubinstance/SyncLookupApiHubInstance.java new file mode 100644 index 000000000000..d8e3f7353bf0 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/lookupapihubinstance/SyncLookupApiHubInstance.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_Provisioning_LookupApiHubInstance_sync] +import com.google.cloud.apihub.v1.LocationName; +import com.google.cloud.apihub.v1.LookupApiHubInstanceRequest; +import com.google.cloud.apihub.v1.LookupApiHubInstanceResponse; +import com.google.cloud.apihub.v1.ProvisioningClient; + +public class SyncLookupApiHubInstance { + + public static void main(String[] args) throws Exception { + syncLookupApiHubInstance(); + } + + public static void syncLookupApiHubInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ProvisioningClient provisioningClient = ProvisioningClient.create()) { + LookupApiHubInstanceRequest request = + LookupApiHubInstanceRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .build(); + LookupApiHubInstanceResponse response = provisioningClient.lookupApiHubInstance(request); + } + } +} +// [END apihub_v1_generated_Provisioning_LookupApiHubInstance_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/lookupapihubinstance/SyncLookupApiHubInstanceLocationname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/lookupapihubinstance/SyncLookupApiHubInstanceLocationname.java new file mode 100644 index 000000000000..e1733c486098 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/lookupapihubinstance/SyncLookupApiHubInstanceLocationname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_Provisioning_LookupApiHubInstance_Locationname_sync] +import com.google.cloud.apihub.v1.LocationName; +import com.google.cloud.apihub.v1.LookupApiHubInstanceResponse; +import com.google.cloud.apihub.v1.ProvisioningClient; + +public class SyncLookupApiHubInstanceLocationname { + + public static void main(String[] args) throws Exception { + syncLookupApiHubInstanceLocationname(); + } + + public static void syncLookupApiHubInstanceLocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ProvisioningClient provisioningClient = ProvisioningClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + LookupApiHubInstanceResponse response = provisioningClient.lookupApiHubInstance(parent); + } + } +} +// [END apihub_v1_generated_Provisioning_LookupApiHubInstance_Locationname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/lookupapihubinstance/SyncLookupApiHubInstanceString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/lookupapihubinstance/SyncLookupApiHubInstanceString.java new file mode 100644 index 000000000000..dece98c495ee --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioning/lookupapihubinstance/SyncLookupApiHubInstanceString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_Provisioning_LookupApiHubInstance_String_sync] +import com.google.cloud.apihub.v1.LocationName; +import com.google.cloud.apihub.v1.LookupApiHubInstanceResponse; +import com.google.cloud.apihub.v1.ProvisioningClient; + +public class SyncLookupApiHubInstanceString { + + public static void main(String[] args) throws Exception { + syncLookupApiHubInstanceString(); + } + + public static void syncLookupApiHubInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ProvisioningClient provisioningClient = ProvisioningClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + LookupApiHubInstanceResponse response = provisioningClient.lookupApiHubInstance(parent); + } + } +} +// [END apihub_v1_generated_Provisioning_LookupApiHubInstance_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioningsettings/getapihubinstance/SyncGetApiHubInstance.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioningsettings/getapihubinstance/SyncGetApiHubInstance.java new file mode 100644 index 000000000000..8cae8e658e33 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/provisioningsettings/getapihubinstance/SyncGetApiHubInstance.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_ProvisioningSettings_GetApiHubInstance_sync] +import com.google.cloud.apihub.v1.ProvisioningSettings; +import java.time.Duration; + +public class SyncGetApiHubInstance { + + public static void main(String[] args) throws Exception { + syncGetApiHubInstance(); + } + + public static void syncGetApiHubInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ProvisioningSettings.Builder provisioningSettingsBuilder = ProvisioningSettings.newBuilder(); + provisioningSettingsBuilder + .getApiHubInstanceSettings() + .setRetrySettings( + provisioningSettingsBuilder + .getApiHubInstanceSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + ProvisioningSettings provisioningSettings = provisioningSettingsBuilder.build(); + } +} +// [END apihub_v1_generated_ProvisioningSettings_GetApiHubInstance_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/create/SyncCreateSetCredentialsProvider.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..2bcd75ca4898 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceSettings; +import com.google.cloud.apihub.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + RuntimeProjectAttachmentServiceSettings runtimeProjectAttachmentServiceSettings = + RuntimeProjectAttachmentServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create(runtimeProjectAttachmentServiceSettings); + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_Create_SetCredentialsProvider_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/create/SyncCreateSetCredentialsProvider1.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..46391d4ba8d2 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_Create_SetCredentialsProvider1_sync] +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + RuntimeProjectAttachmentServiceSettings runtimeProjectAttachmentServiceSettings = + RuntimeProjectAttachmentServiceSettings.newHttpJsonBuilder().build(); + RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create(runtimeProjectAttachmentServiceSettings); + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_Create_SetCredentialsProvider1_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/create/SyncCreateSetEndpoint.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..4abd24d0749b --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_Create_SetEndpoint_sync] +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceSettings; +import com.google.cloud.apihub.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + RuntimeProjectAttachmentServiceSettings runtimeProjectAttachmentServiceSettings = + RuntimeProjectAttachmentServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create(runtimeProjectAttachmentServiceSettings); + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_Create_SetEndpoint_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/createruntimeprojectattachment/AsyncCreateRuntimeProjectAttachment.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/createruntimeprojectattachment/AsyncCreateRuntimeProjectAttachment.java new file mode 100644 index 000000000000..8d88aaba3289 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/createruntimeprojectattachment/AsyncCreateRuntimeProjectAttachment.java @@ -0,0 +1,55 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_CreateRuntimeProjectAttachment_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest; +import com.google.cloud.apihub.v1.LocationName; +import com.google.cloud.apihub.v1.RuntimeProjectAttachment; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; + +public class AsyncCreateRuntimeProjectAttachment { + + public static void main(String[] args) throws Exception { + asyncCreateRuntimeProjectAttachment(); + } + + public static void asyncCreateRuntimeProjectAttachment() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create()) { + CreateRuntimeProjectAttachmentRequest request = + CreateRuntimeProjectAttachmentRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setRuntimeProjectAttachmentId("runtimeProjectAttachmentId-753213345") + .setRuntimeProjectAttachment(RuntimeProjectAttachment.newBuilder().build()) + .build(); + ApiFuture future = + runtimeProjectAttachmentServiceClient + .createRuntimeProjectAttachmentCallable() + .futureCall(request); + // Do something. + RuntimeProjectAttachment response = future.get(); + } + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_CreateRuntimeProjectAttachment_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/createruntimeprojectattachment/SyncCreateRuntimeProjectAttachment.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/createruntimeprojectattachment/SyncCreateRuntimeProjectAttachment.java new file mode 100644 index 000000000000..1b8450411d49 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/createruntimeprojectattachment/SyncCreateRuntimeProjectAttachment.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_CreateRuntimeProjectAttachment_sync] +import com.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest; +import com.google.cloud.apihub.v1.LocationName; +import com.google.cloud.apihub.v1.RuntimeProjectAttachment; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; + +public class SyncCreateRuntimeProjectAttachment { + + public static void main(String[] args) throws Exception { + syncCreateRuntimeProjectAttachment(); + } + + public static void syncCreateRuntimeProjectAttachment() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create()) { + CreateRuntimeProjectAttachmentRequest request = + CreateRuntimeProjectAttachmentRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setRuntimeProjectAttachmentId("runtimeProjectAttachmentId-753213345") + .setRuntimeProjectAttachment(RuntimeProjectAttachment.newBuilder().build()) + .build(); + RuntimeProjectAttachment response = + runtimeProjectAttachmentServiceClient.createRuntimeProjectAttachment(request); + } + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_CreateRuntimeProjectAttachment_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/createruntimeprojectattachment/SyncCreateRuntimeProjectAttachmentLocationnameRuntimeprojectattachmentString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/createruntimeprojectattachment/SyncCreateRuntimeProjectAttachmentLocationnameRuntimeprojectattachmentString.java new file mode 100644 index 000000000000..76f5b5e07670 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/createruntimeprojectattachment/SyncCreateRuntimeProjectAttachmentLocationnameRuntimeprojectattachmentString.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_CreateRuntimeProjectAttachment_LocationnameRuntimeprojectattachmentString_sync] +import com.google.cloud.apihub.v1.LocationName; +import com.google.cloud.apihub.v1.RuntimeProjectAttachment; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; + +public class SyncCreateRuntimeProjectAttachmentLocationnameRuntimeprojectattachmentString { + + public static void main(String[] args) throws Exception { + syncCreateRuntimeProjectAttachmentLocationnameRuntimeprojectattachmentString(); + } + + public static void syncCreateRuntimeProjectAttachmentLocationnameRuntimeprojectattachmentString() + throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + RuntimeProjectAttachment runtimeProjectAttachment = + RuntimeProjectAttachment.newBuilder().build(); + String runtimeProjectAttachmentId = "runtimeProjectAttachmentId-753213345"; + RuntimeProjectAttachment response = + runtimeProjectAttachmentServiceClient.createRuntimeProjectAttachment( + parent, runtimeProjectAttachment, runtimeProjectAttachmentId); + } + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_CreateRuntimeProjectAttachment_LocationnameRuntimeprojectattachmentString_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/createruntimeprojectattachment/SyncCreateRuntimeProjectAttachmentStringRuntimeprojectattachmentString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/createruntimeprojectattachment/SyncCreateRuntimeProjectAttachmentStringRuntimeprojectattachmentString.java new file mode 100644 index 000000000000..e160f25282be --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/createruntimeprojectattachment/SyncCreateRuntimeProjectAttachmentStringRuntimeprojectattachmentString.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_CreateRuntimeProjectAttachment_StringRuntimeprojectattachmentString_sync] +import com.google.cloud.apihub.v1.LocationName; +import com.google.cloud.apihub.v1.RuntimeProjectAttachment; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; + +public class SyncCreateRuntimeProjectAttachmentStringRuntimeprojectattachmentString { + + public static void main(String[] args) throws Exception { + syncCreateRuntimeProjectAttachmentStringRuntimeprojectattachmentString(); + } + + public static void syncCreateRuntimeProjectAttachmentStringRuntimeprojectattachmentString() + throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + RuntimeProjectAttachment runtimeProjectAttachment = + RuntimeProjectAttachment.newBuilder().build(); + String runtimeProjectAttachmentId = "runtimeProjectAttachmentId-753213345"; + RuntimeProjectAttachment response = + runtimeProjectAttachmentServiceClient.createRuntimeProjectAttachment( + parent, runtimeProjectAttachment, runtimeProjectAttachmentId); + } + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_CreateRuntimeProjectAttachment_StringRuntimeprojectattachmentString_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/deleteruntimeprojectattachment/AsyncDeleteRuntimeProjectAttachment.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/deleteruntimeprojectattachment/AsyncDeleteRuntimeProjectAttachment.java new file mode 100644 index 000000000000..e8b01472efb8 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/deleteruntimeprojectattachment/AsyncDeleteRuntimeProjectAttachment.java @@ -0,0 +1,56 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_DeleteRuntimeProjectAttachment_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentName; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; +import com.google.protobuf.Empty; + +public class AsyncDeleteRuntimeProjectAttachment { + + public static void main(String[] args) throws Exception { + asyncDeleteRuntimeProjectAttachment(); + } + + public static void asyncDeleteRuntimeProjectAttachment() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create()) { + DeleteRuntimeProjectAttachmentRequest request = + DeleteRuntimeProjectAttachmentRequest.newBuilder() + .setName( + RuntimeProjectAttachmentName.of( + "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]") + .toString()) + .build(); + ApiFuture future = + runtimeProjectAttachmentServiceClient + .deleteRuntimeProjectAttachmentCallable() + .futureCall(request); + // Do something. + future.get(); + } + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_DeleteRuntimeProjectAttachment_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/deleteruntimeprojectattachment/SyncDeleteRuntimeProjectAttachment.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/deleteruntimeprojectattachment/SyncDeleteRuntimeProjectAttachment.java new file mode 100644 index 000000000000..88719a7e6054 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/deleteruntimeprojectattachment/SyncDeleteRuntimeProjectAttachment.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_DeleteRuntimeProjectAttachment_sync] +import com.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentName; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteRuntimeProjectAttachment { + + public static void main(String[] args) throws Exception { + syncDeleteRuntimeProjectAttachment(); + } + + public static void syncDeleteRuntimeProjectAttachment() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create()) { + DeleteRuntimeProjectAttachmentRequest request = + DeleteRuntimeProjectAttachmentRequest.newBuilder() + .setName( + RuntimeProjectAttachmentName.of( + "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]") + .toString()) + .build(); + runtimeProjectAttachmentServiceClient.deleteRuntimeProjectAttachment(request); + } + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_DeleteRuntimeProjectAttachment_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/deleteruntimeprojectattachment/SyncDeleteRuntimeProjectAttachmentRuntimeprojectattachmentname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/deleteruntimeprojectattachment/SyncDeleteRuntimeProjectAttachmentRuntimeprojectattachmentname.java new file mode 100644 index 000000000000..4f6e70b636f5 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/deleteruntimeprojectattachment/SyncDeleteRuntimeProjectAttachmentRuntimeprojectattachmentname.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_DeleteRuntimeProjectAttachment_Runtimeprojectattachmentname_sync] +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentName; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteRuntimeProjectAttachmentRuntimeprojectattachmentname { + + public static void main(String[] args) throws Exception { + syncDeleteRuntimeProjectAttachmentRuntimeprojectattachmentname(); + } + + public static void syncDeleteRuntimeProjectAttachmentRuntimeprojectattachmentname() + throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create()) { + RuntimeProjectAttachmentName name = + RuntimeProjectAttachmentName.of( + "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]"); + runtimeProjectAttachmentServiceClient.deleteRuntimeProjectAttachment(name); + } + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_DeleteRuntimeProjectAttachment_Runtimeprojectattachmentname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/deleteruntimeprojectattachment/SyncDeleteRuntimeProjectAttachmentString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/deleteruntimeprojectattachment/SyncDeleteRuntimeProjectAttachmentString.java new file mode 100644 index 000000000000..ca1ef115fe71 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/deleteruntimeprojectattachment/SyncDeleteRuntimeProjectAttachmentString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_DeleteRuntimeProjectAttachment_String_sync] +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentName; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteRuntimeProjectAttachmentString { + + public static void main(String[] args) throws Exception { + syncDeleteRuntimeProjectAttachmentString(); + } + + public static void syncDeleteRuntimeProjectAttachmentString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create()) { + String name = + RuntimeProjectAttachmentName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]") + .toString(); + runtimeProjectAttachmentServiceClient.deleteRuntimeProjectAttachment(name); + } + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_DeleteRuntimeProjectAttachment_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/getlocation/AsyncGetLocation.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..8ffc52bedf32 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/getlocation/AsyncGetLocation.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = + runtimeProjectAttachmentServiceClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_GetLocation_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/getlocation/SyncGetLocation.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..ad6ced2c1309 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/getlocation/SyncGetLocation.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_GetLocation_sync] +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = runtimeProjectAttachmentServiceClient.getLocation(request); + } + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_GetLocation_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/getruntimeprojectattachment/AsyncGetRuntimeProjectAttachment.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/getruntimeprojectattachment/AsyncGetRuntimeProjectAttachment.java new file mode 100644 index 000000000000..7e4c05416214 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/getruntimeprojectattachment/AsyncGetRuntimeProjectAttachment.java @@ -0,0 +1,56 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_GetRuntimeProjectAttachment_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest; +import com.google.cloud.apihub.v1.RuntimeProjectAttachment; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentName; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; + +public class AsyncGetRuntimeProjectAttachment { + + public static void main(String[] args) throws Exception { + asyncGetRuntimeProjectAttachment(); + } + + public static void asyncGetRuntimeProjectAttachment() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create()) { + GetRuntimeProjectAttachmentRequest request = + GetRuntimeProjectAttachmentRequest.newBuilder() + .setName( + RuntimeProjectAttachmentName.of( + "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]") + .toString()) + .build(); + ApiFuture future = + runtimeProjectAttachmentServiceClient + .getRuntimeProjectAttachmentCallable() + .futureCall(request); + // Do something. + RuntimeProjectAttachment response = future.get(); + } + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_GetRuntimeProjectAttachment_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/getruntimeprojectattachment/SyncGetRuntimeProjectAttachment.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/getruntimeprojectattachment/SyncGetRuntimeProjectAttachment.java new file mode 100644 index 000000000000..7adfdc3a0592 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/getruntimeprojectattachment/SyncGetRuntimeProjectAttachment.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_GetRuntimeProjectAttachment_sync] +import com.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest; +import com.google.cloud.apihub.v1.RuntimeProjectAttachment; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentName; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; + +public class SyncGetRuntimeProjectAttachment { + + public static void main(String[] args) throws Exception { + syncGetRuntimeProjectAttachment(); + } + + public static void syncGetRuntimeProjectAttachment() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create()) { + GetRuntimeProjectAttachmentRequest request = + GetRuntimeProjectAttachmentRequest.newBuilder() + .setName( + RuntimeProjectAttachmentName.of( + "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]") + .toString()) + .build(); + RuntimeProjectAttachment response = + runtimeProjectAttachmentServiceClient.getRuntimeProjectAttachment(request); + } + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_GetRuntimeProjectAttachment_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/getruntimeprojectattachment/SyncGetRuntimeProjectAttachmentRuntimeprojectattachmentname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/getruntimeprojectattachment/SyncGetRuntimeProjectAttachmentRuntimeprojectattachmentname.java new file mode 100644 index 000000000000..1ab26bd98c66 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/getruntimeprojectattachment/SyncGetRuntimeProjectAttachmentRuntimeprojectattachmentname.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_GetRuntimeProjectAttachment_Runtimeprojectattachmentname_sync] +import com.google.cloud.apihub.v1.RuntimeProjectAttachment; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentName; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; + +public class SyncGetRuntimeProjectAttachmentRuntimeprojectattachmentname { + + public static void main(String[] args) throws Exception { + syncGetRuntimeProjectAttachmentRuntimeprojectattachmentname(); + } + + public static void syncGetRuntimeProjectAttachmentRuntimeprojectattachmentname() + throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create()) { + RuntimeProjectAttachmentName name = + RuntimeProjectAttachmentName.of( + "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]"); + RuntimeProjectAttachment response = + runtimeProjectAttachmentServiceClient.getRuntimeProjectAttachment(name); + } + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_GetRuntimeProjectAttachment_Runtimeprojectattachmentname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/getruntimeprojectattachment/SyncGetRuntimeProjectAttachmentString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/getruntimeprojectattachment/SyncGetRuntimeProjectAttachmentString.java new file mode 100644 index 000000000000..65dae1875e55 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/getruntimeprojectattachment/SyncGetRuntimeProjectAttachmentString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_GetRuntimeProjectAttachment_String_sync] +import com.google.cloud.apihub.v1.RuntimeProjectAttachment; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentName; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; + +public class SyncGetRuntimeProjectAttachmentString { + + public static void main(String[] args) throws Exception { + syncGetRuntimeProjectAttachmentString(); + } + + public static void syncGetRuntimeProjectAttachmentString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create()) { + String name = + RuntimeProjectAttachmentName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]") + .toString(); + RuntimeProjectAttachment response = + runtimeProjectAttachmentServiceClient.getRuntimeProjectAttachment(name); + } + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_GetRuntimeProjectAttachment_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listlocations/AsyncListLocations.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..185b0b5b9b2b --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listlocations/AsyncListLocations.java @@ -0,0 +1,55 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + runtimeProjectAttachmentServiceClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_ListLocations_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listlocations/AsyncListLocationsPaged.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..404b7efb4077 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,63 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_ListLocations_Paged_async] +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = + runtimeProjectAttachmentServiceClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_ListLocations_Paged_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listlocations/SyncListLocations.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..db750cb4e08e --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listlocations/SyncListLocations.java @@ -0,0 +1,52 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_ListLocations_sync] +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : + runtimeProjectAttachmentServiceClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_ListLocations_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listruntimeprojectattachments/AsyncListRuntimeProjectAttachments.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listruntimeprojectattachments/AsyncListRuntimeProjectAttachments.java new file mode 100644 index 000000000000..3cd85f0b469d --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listruntimeprojectattachments/AsyncListRuntimeProjectAttachments.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_ListRuntimeProjectAttachments_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest; +import com.google.cloud.apihub.v1.LocationName; +import com.google.cloud.apihub.v1.RuntimeProjectAttachment; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; + +public class AsyncListRuntimeProjectAttachments { + + public static void main(String[] args) throws Exception { + asyncListRuntimeProjectAttachments(); + } + + public static void asyncListRuntimeProjectAttachments() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create()) { + ListRuntimeProjectAttachmentsRequest request = + ListRuntimeProjectAttachmentsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + runtimeProjectAttachmentServiceClient + .listRuntimeProjectAttachmentsPagedCallable() + .futureCall(request); + // Do something. + for (RuntimeProjectAttachment element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_ListRuntimeProjectAttachments_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listruntimeprojectattachments/AsyncListRuntimeProjectAttachmentsPaged.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listruntimeprojectattachments/AsyncListRuntimeProjectAttachmentsPaged.java new file mode 100644 index 000000000000..c2f105d942a4 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listruntimeprojectattachments/AsyncListRuntimeProjectAttachmentsPaged.java @@ -0,0 +1,67 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_ListRuntimeProjectAttachments_Paged_async] +import com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest; +import com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse; +import com.google.cloud.apihub.v1.LocationName; +import com.google.cloud.apihub.v1.RuntimeProjectAttachment; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; +import com.google.common.base.Strings; + +public class AsyncListRuntimeProjectAttachmentsPaged { + + public static void main(String[] args) throws Exception { + asyncListRuntimeProjectAttachmentsPaged(); + } + + public static void asyncListRuntimeProjectAttachmentsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create()) { + ListRuntimeProjectAttachmentsRequest request = + ListRuntimeProjectAttachmentsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListRuntimeProjectAttachmentsResponse response = + runtimeProjectAttachmentServiceClient + .listRuntimeProjectAttachmentsCallable() + .call(request); + for (RuntimeProjectAttachment element : response.getRuntimeProjectAttachmentsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_ListRuntimeProjectAttachments_Paged_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listruntimeprojectattachments/SyncListRuntimeProjectAttachments.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listruntimeprojectattachments/SyncListRuntimeProjectAttachments.java new file mode 100644 index 000000000000..173018e9b5a0 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listruntimeprojectattachments/SyncListRuntimeProjectAttachments.java @@ -0,0 +1,56 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_ListRuntimeProjectAttachments_sync] +import com.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest; +import com.google.cloud.apihub.v1.LocationName; +import com.google.cloud.apihub.v1.RuntimeProjectAttachment; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; + +public class SyncListRuntimeProjectAttachments { + + public static void main(String[] args) throws Exception { + syncListRuntimeProjectAttachments(); + } + + public static void syncListRuntimeProjectAttachments() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create()) { + ListRuntimeProjectAttachmentsRequest request = + ListRuntimeProjectAttachmentsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (RuntimeProjectAttachment element : + runtimeProjectAttachmentServiceClient + .listRuntimeProjectAttachments(request) + .iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_ListRuntimeProjectAttachments_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listruntimeprojectattachments/SyncListRuntimeProjectAttachmentsLocationname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listruntimeprojectattachments/SyncListRuntimeProjectAttachmentsLocationname.java new file mode 100644 index 000000000000..f3bdc5e96c19 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listruntimeprojectattachments/SyncListRuntimeProjectAttachmentsLocationname.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_ListRuntimeProjectAttachments_Locationname_sync] +import com.google.cloud.apihub.v1.LocationName; +import com.google.cloud.apihub.v1.RuntimeProjectAttachment; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; + +public class SyncListRuntimeProjectAttachmentsLocationname { + + public static void main(String[] args) throws Exception { + syncListRuntimeProjectAttachmentsLocationname(); + } + + public static void syncListRuntimeProjectAttachmentsLocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (RuntimeProjectAttachment element : + runtimeProjectAttachmentServiceClient + .listRuntimeProjectAttachments(parent) + .iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_ListRuntimeProjectAttachments_Locationname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listruntimeprojectattachments/SyncListRuntimeProjectAttachmentsString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listruntimeprojectattachments/SyncListRuntimeProjectAttachmentsString.java new file mode 100644 index 000000000000..1604c208c9b1 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/listruntimeprojectattachments/SyncListRuntimeProjectAttachmentsString.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_ListRuntimeProjectAttachments_String_sync] +import com.google.cloud.apihub.v1.LocationName; +import com.google.cloud.apihub.v1.RuntimeProjectAttachment; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; + +public class SyncListRuntimeProjectAttachmentsString { + + public static void main(String[] args) throws Exception { + syncListRuntimeProjectAttachmentsString(); + } + + public static void syncListRuntimeProjectAttachmentsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (RuntimeProjectAttachment element : + runtimeProjectAttachmentServiceClient + .listRuntimeProjectAttachments(parent) + .iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_ListRuntimeProjectAttachments_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/lookupruntimeprojectattachment/AsyncLookupRuntimeProjectAttachment.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/lookupruntimeprojectattachment/AsyncLookupRuntimeProjectAttachment.java new file mode 100644 index 000000000000..04f754505fd5 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/lookupruntimeprojectattachment/AsyncLookupRuntimeProjectAttachment.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_LookupRuntimeProjectAttachment_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apihub.v1.LocationName; +import com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest; +import com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; + +public class AsyncLookupRuntimeProjectAttachment { + + public static void main(String[] args) throws Exception { + asyncLookupRuntimeProjectAttachment(); + } + + public static void asyncLookupRuntimeProjectAttachment() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create()) { + LookupRuntimeProjectAttachmentRequest request = + LookupRuntimeProjectAttachmentRequest.newBuilder() + .setName(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .build(); + ApiFuture future = + runtimeProjectAttachmentServiceClient + .lookupRuntimeProjectAttachmentCallable() + .futureCall(request); + // Do something. + LookupRuntimeProjectAttachmentResponse response = future.get(); + } + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_LookupRuntimeProjectAttachment_async] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/lookupruntimeprojectattachment/SyncLookupRuntimeProjectAttachment.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/lookupruntimeprojectattachment/SyncLookupRuntimeProjectAttachment.java new file mode 100644 index 000000000000..8ba6203d5860 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/lookupruntimeprojectattachment/SyncLookupRuntimeProjectAttachment.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_LookupRuntimeProjectAttachment_sync] +import com.google.cloud.apihub.v1.LocationName; +import com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest; +import com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; + +public class SyncLookupRuntimeProjectAttachment { + + public static void main(String[] args) throws Exception { + syncLookupRuntimeProjectAttachment(); + } + + public static void syncLookupRuntimeProjectAttachment() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create()) { + LookupRuntimeProjectAttachmentRequest request = + LookupRuntimeProjectAttachmentRequest.newBuilder() + .setName(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .build(); + LookupRuntimeProjectAttachmentResponse response = + runtimeProjectAttachmentServiceClient.lookupRuntimeProjectAttachment(request); + } + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_LookupRuntimeProjectAttachment_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/lookupruntimeprojectattachment/SyncLookupRuntimeProjectAttachmentLocationname.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/lookupruntimeprojectattachment/SyncLookupRuntimeProjectAttachmentLocationname.java new file mode 100644 index 000000000000..1e335a415bb0 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/lookupruntimeprojectattachment/SyncLookupRuntimeProjectAttachmentLocationname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_LookupRuntimeProjectAttachment_Locationname_sync] +import com.google.cloud.apihub.v1.LocationName; +import com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; + +public class SyncLookupRuntimeProjectAttachmentLocationname { + + public static void main(String[] args) throws Exception { + syncLookupRuntimeProjectAttachmentLocationname(); + } + + public static void syncLookupRuntimeProjectAttachmentLocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create()) { + LocationName name = LocationName.of("[PROJECT]", "[LOCATION]"); + LookupRuntimeProjectAttachmentResponse response = + runtimeProjectAttachmentServiceClient.lookupRuntimeProjectAttachment(name); + } + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_LookupRuntimeProjectAttachment_Locationname_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/lookupruntimeprojectattachment/SyncLookupRuntimeProjectAttachmentString.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/lookupruntimeprojectattachment/SyncLookupRuntimeProjectAttachmentString.java new file mode 100644 index 000000000000..84edc0b8169a --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservice/lookupruntimeprojectattachment/SyncLookupRuntimeProjectAttachmentString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentService_LookupRuntimeProjectAttachment_String_sync] +import com.google.cloud.apihub.v1.LocationName; +import com.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse; +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient; + +public class SyncLookupRuntimeProjectAttachmentString { + + public static void main(String[] args) throws Exception { + syncLookupRuntimeProjectAttachmentString(); + } + + public static void syncLookupRuntimeProjectAttachmentString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient = + RuntimeProjectAttachmentServiceClient.create()) { + String name = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + LookupRuntimeProjectAttachmentResponse response = + runtimeProjectAttachmentServiceClient.lookupRuntimeProjectAttachment(name); + } + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentService_LookupRuntimeProjectAttachment_String_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservicesettings/createruntimeprojectattachment/SyncCreateRuntimeProjectAttachment.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservicesettings/createruntimeprojectattachment/SyncCreateRuntimeProjectAttachment.java new file mode 100644 index 000000000000..d641cc62f3dd --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/runtimeprojectattachmentservicesettings/createruntimeprojectattachment/SyncCreateRuntimeProjectAttachment.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentServiceSettings_CreateRuntimeProjectAttachment_sync] +import com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceSettings; +import java.time.Duration; + +public class SyncCreateRuntimeProjectAttachment { + + public static void main(String[] args) throws Exception { + syncCreateRuntimeProjectAttachment(); + } + + public static void syncCreateRuntimeProjectAttachment() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + RuntimeProjectAttachmentServiceSettings.Builder runtimeProjectAttachmentServiceSettingsBuilder = + RuntimeProjectAttachmentServiceSettings.newBuilder(); + runtimeProjectAttachmentServiceSettingsBuilder + .createRuntimeProjectAttachmentSettings() + .setRetrySettings( + runtimeProjectAttachmentServiceSettingsBuilder + .createRuntimeProjectAttachmentSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + RuntimeProjectAttachmentServiceSettings runtimeProjectAttachmentServiceSettings = + runtimeProjectAttachmentServiceSettingsBuilder.build(); + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentServiceSettings_CreateRuntimeProjectAttachment_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/stub/apihubdependenciesstubsettings/createdependency/SyncCreateDependency.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/stub/apihubdependenciesstubsettings/createdependency/SyncCreateDependency.java new file mode 100644 index 000000000000..e1ec6fd77b36 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/stub/apihubdependenciesstubsettings/createdependency/SyncCreateDependency.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub.samples; + +// [START apihub_v1_generated_ApiHubDependenciesStubSettings_CreateDependency_sync] +import com.google.cloud.apihub.v1.stub.ApiHubDependenciesStubSettings; +import java.time.Duration; + +public class SyncCreateDependency { + + public static void main(String[] args) throws Exception { + syncCreateDependency(); + } + + public static void syncCreateDependency() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ApiHubDependenciesStubSettings.Builder apiHubDependenciesSettingsBuilder = + ApiHubDependenciesStubSettings.newBuilder(); + apiHubDependenciesSettingsBuilder + .createDependencySettings() + .setRetrySettings( + apiHubDependenciesSettingsBuilder + .createDependencySettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + ApiHubDependenciesStubSettings apiHubDependenciesSettings = + apiHubDependenciesSettingsBuilder.build(); + } +} +// [END apihub_v1_generated_ApiHubDependenciesStubSettings_CreateDependency_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/stub/apihubpluginstubsettings/getplugin/SyncGetPlugin.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/stub/apihubpluginstubsettings/getplugin/SyncGetPlugin.java new file mode 100644 index 000000000000..1d625245a7bd --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/stub/apihubpluginstubsettings/getplugin/SyncGetPlugin.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub.samples; + +// [START apihub_v1_generated_ApiHubPluginStubSettings_GetPlugin_sync] +import com.google.cloud.apihub.v1.stub.ApiHubPluginStubSettings; +import java.time.Duration; + +public class SyncGetPlugin { + + public static void main(String[] args) throws Exception { + syncGetPlugin(); + } + + public static void syncGetPlugin() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ApiHubPluginStubSettings.Builder apiHubPluginSettingsBuilder = + ApiHubPluginStubSettings.newBuilder(); + apiHubPluginSettingsBuilder + .getPluginSettings() + .setRetrySettings( + apiHubPluginSettingsBuilder + .getPluginSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + ApiHubPluginStubSettings apiHubPluginSettings = apiHubPluginSettingsBuilder.build(); + } +} +// [END apihub_v1_generated_ApiHubPluginStubSettings_GetPlugin_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/stub/apihubstubsettings/createapi/SyncCreateApi.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/stub/apihubstubsettings/createapi/SyncCreateApi.java new file mode 100644 index 000000000000..cf23770da4dc --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/stub/apihubstubsettings/createapi/SyncCreateApi.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub.samples; + +// [START apihub_v1_generated_ApiHubStubSettings_CreateApi_sync] +import com.google.cloud.apihub.v1.stub.ApiHubStubSettings; +import java.time.Duration; + +public class SyncCreateApi { + + public static void main(String[] args) throws Exception { + syncCreateApi(); + } + + public static void syncCreateApi() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ApiHubStubSettings.Builder apiHubSettingsBuilder = ApiHubStubSettings.newBuilder(); + apiHubSettingsBuilder + .createApiSettings() + .setRetrySettings( + apiHubSettingsBuilder + .createApiSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + ApiHubStubSettings apiHubSettings = apiHubSettingsBuilder.build(); + } +} +// [END apihub_v1_generated_ApiHubStubSettings_CreateApi_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/stub/hostprojectregistrationservicestubsettings/createhostprojectregistration/SyncCreateHostProjectRegistration.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/stub/hostprojectregistrationservicestubsettings/createhostprojectregistration/SyncCreateHostProjectRegistration.java new file mode 100644 index 000000000000..9cc8e8df1274 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/stub/hostprojectregistrationservicestubsettings/createhostprojectregistration/SyncCreateHostProjectRegistration.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub.samples; + +// [START apihub_v1_generated_HostProjectRegistrationServiceStubSettings_CreateHostProjectRegistration_sync] +import com.google.cloud.apihub.v1.stub.HostProjectRegistrationServiceStubSettings; +import java.time.Duration; + +public class SyncCreateHostProjectRegistration { + + public static void main(String[] args) throws Exception { + syncCreateHostProjectRegistration(); + } + + public static void syncCreateHostProjectRegistration() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + HostProjectRegistrationServiceStubSettings.Builder + hostProjectRegistrationServiceSettingsBuilder = + HostProjectRegistrationServiceStubSettings.newBuilder(); + hostProjectRegistrationServiceSettingsBuilder + .createHostProjectRegistrationSettings() + .setRetrySettings( + hostProjectRegistrationServiceSettingsBuilder + .createHostProjectRegistrationSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + HostProjectRegistrationServiceStubSettings hostProjectRegistrationServiceSettings = + hostProjectRegistrationServiceSettingsBuilder.build(); + } +} +// [END apihub_v1_generated_HostProjectRegistrationServiceStubSettings_CreateHostProjectRegistration_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/stub/lintingservicestubsettings/getstyleguide/SyncGetStyleGuide.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/stub/lintingservicestubsettings/getstyleguide/SyncGetStyleGuide.java new file mode 100644 index 000000000000..3e0c4cee44ec --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/stub/lintingservicestubsettings/getstyleguide/SyncGetStyleGuide.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub.samples; + +// [START apihub_v1_generated_LintingServiceStubSettings_GetStyleGuide_sync] +import com.google.cloud.apihub.v1.stub.LintingServiceStubSettings; +import java.time.Duration; + +public class SyncGetStyleGuide { + + public static void main(String[] args) throws Exception { + syncGetStyleGuide(); + } + + public static void syncGetStyleGuide() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + LintingServiceStubSettings.Builder lintingServiceSettingsBuilder = + LintingServiceStubSettings.newBuilder(); + lintingServiceSettingsBuilder + .getStyleGuideSettings() + .setRetrySettings( + lintingServiceSettingsBuilder + .getStyleGuideSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + LintingServiceStubSettings lintingServiceSettings = lintingServiceSettingsBuilder.build(); + } +} +// [END apihub_v1_generated_LintingServiceStubSettings_GetStyleGuide_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/stub/provisioningstubsettings/getapihubinstance/SyncGetApiHubInstance.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/stub/provisioningstubsettings/getapihubinstance/SyncGetApiHubInstance.java new file mode 100644 index 000000000000..8a49a9c3fe2c --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/stub/provisioningstubsettings/getapihubinstance/SyncGetApiHubInstance.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub.samples; + +// [START apihub_v1_generated_ProvisioningStubSettings_GetApiHubInstance_sync] +import com.google.cloud.apihub.v1.stub.ProvisioningStubSettings; +import java.time.Duration; + +public class SyncGetApiHubInstance { + + public static void main(String[] args) throws Exception { + syncGetApiHubInstance(); + } + + public static void syncGetApiHubInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ProvisioningStubSettings.Builder provisioningSettingsBuilder = + ProvisioningStubSettings.newBuilder(); + provisioningSettingsBuilder + .getApiHubInstanceSettings() + .setRetrySettings( + provisioningSettingsBuilder + .getApiHubInstanceSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + ProvisioningStubSettings provisioningSettings = provisioningSettingsBuilder.build(); + } +} +// [END apihub_v1_generated_ProvisioningStubSettings_GetApiHubInstance_sync] diff --git a/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/stub/runtimeprojectattachmentservicestubsettings/createruntimeprojectattachment/SyncCreateRuntimeProjectAttachment.java b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/stub/runtimeprojectattachmentservicestubsettings/createruntimeprojectattachment/SyncCreateRuntimeProjectAttachment.java new file mode 100644 index 000000000000..aef375a9b404 --- /dev/null +++ b/java-apihub/samples/snippets/generated/com/google/cloud/apihub/v1/stub/runtimeprojectattachmentservicestubsettings/createruntimeprojectattachment/SyncCreateRuntimeProjectAttachment.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.apihub.v1.stub.samples; + +// [START apihub_v1_generated_RuntimeProjectAttachmentServiceStubSettings_CreateRuntimeProjectAttachment_sync] +import com.google.cloud.apihub.v1.stub.RuntimeProjectAttachmentServiceStubSettings; +import java.time.Duration; + +public class SyncCreateRuntimeProjectAttachment { + + public static void main(String[] args) throws Exception { + syncCreateRuntimeProjectAttachment(); + } + + public static void syncCreateRuntimeProjectAttachment() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + RuntimeProjectAttachmentServiceStubSettings.Builder + runtimeProjectAttachmentServiceSettingsBuilder = + RuntimeProjectAttachmentServiceStubSettings.newBuilder(); + runtimeProjectAttachmentServiceSettingsBuilder + .createRuntimeProjectAttachmentSettings() + .setRetrySettings( + runtimeProjectAttachmentServiceSettingsBuilder + .createRuntimeProjectAttachmentSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + RuntimeProjectAttachmentServiceStubSettings runtimeProjectAttachmentServiceSettings = + runtimeProjectAttachmentServiceSettingsBuilder.build(); + } +} +// [END apihub_v1_generated_RuntimeProjectAttachmentServiceStubSettings_CreateRuntimeProjectAttachment_sync] diff --git a/pom.xml b/pom.xml index 67ffcf89070c..fb650a5bf65d 100644 --- a/pom.xml +++ b/pom.xml @@ -27,6 +27,7 @@ java-api-gateway java-apigee-connect java-apigee-registry + java-apihub java-apikeys java-appengine-admin java-apphub diff --git a/versions.txt b/versions.txt index cefec577149c..cffb0d92795a 100644 --- a/versions.txt +++ b/versions.txt @@ -803,3 +803,6 @@ grpc-google-cloud-gdchardwaremanagement-v1alpha:0.2.0:0.3.0-SNAPSHOT google-cloud-privilegedaccessmanager:0.1.0:0.2.0-SNAPSHOT proto-google-cloud-privilegedaccessmanager-v1:0.1.0:0.2.0-SNAPSHOT grpc-google-cloud-privilegedaccessmanager-v1:0.1.0:0.2.0-SNAPSHOT +google-cloud-apihub:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-apihub-v1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-apihub-v1:0.0.0:0.0.1-SNAPSHOT